2011
01.30

Recently I have been been doing quite a bit of reconfiguring of my home network including a subnet change, introducing more vlans and migrating server shares. The manual process of updating host files, IP configs and NFS/SAMBA shares can become rather repetitive after awhile especially when I am forever moving things around on the network. Below is one of the scripts I use to overwrite config files across the network before implementing any network changes.

#!/bin/bash
SERVERS=`cat servers`;
for i in $SERVERS;
do scp /path/to/file root@${i}:/path/to/file/
done

Equally important is appending updates to any config files:

#!/bin/bash
SERVERS=`cat servers`;
for i in $SERVERS;
do
cat
/path/to/file | ssh root@${i} "cat >> /path/to/file"
done

No Comment.

Add Your Comment