We have a small network of 15 users. I need to install some new libraries using yum on all computers on the network. I already have a csh script which allows me rsh onto all computers on the system so I could manually switch to root and install the required dependencies for each rsh. Is there a more effective means of doing this?
I have tried to do this using the following csh script. I have continued to use rsh for the moment while testing. However the script dies as soon as I rsh to another host file. What am I doing wrong?
if ($1 == "")then echo -n "Please enter a package to install\n" set package=$< else set package = $#argv endif set numlines = `cat $NM_HOME/sh_local/nc_network2.txt | grep -v "^#" | fgrep "%" | wc -l` while ($numlines>0) set line = `cat $NM_HOME/sh_local/nc_network2.txt | grep -v "^#" | fgrep "%" | tail -$numlines | head -1` set host2 = `echo $line | cut -f 1 -d %` set where = `echo $line | cut -f 2 -d %` if ($host2 == $this_machine) then echo "This is $host2....skipping rsh to this machine" echo "" goto yum endif echo "" echo "logging into $host2 $where" echo "" sleep 1 rsh $host2 yum: echo "" echo "Preparing to install $package on $host2" sudo yum -y install $package if ($host2 == $this_machine) then goto decrement else logout goto decrement endif decrement: @ numlines-- end