2 ################################################################################
5 # Description: Runs an arbitrary command on all machines
6 # Author: Andrew@DeFaria.com
7 # Created: Fri Apr 30 14:17:40 PDT 1999
9 # Modifications:Added trapping of INT so that you can abort a non-responding
12 # (c) Copyright 2001, Andrew@DeFaria.com, all rights reserved
14 ################################################################################
15 # Set me to command name
18 # Source /etc/site_parms
19 if [ -f /etc/site_parms ]; then
22 echo "$me: WARNING: /etc/site_parms does not exist!"
26 adm_base="$SITE_TOOLS_PATH/adm"
29 adm_fpath=${adm_fpath:-$adm_base/functions}
37 if [ "$1" = "-r" ]; then
43 echo "$currmachine:$cmd interrupted"
44 echo -e "(A)bort $me or (C)ontinue with next machine? \c"
46 response=$(echo $response | tr [:upper:] [:lower:])
50 display "Aborting $me..."
54 display "Continuing on with the next machine..."
57 # Gather all machines into the machines variable so we can
63 tr [:upper:] [:lower:] > /tmp/$me.$$
65 machines=$(cat /tmp/$me.$$);
68 # This loop executes the command
71 for machine in $machines; do
73 # Execute command. Note if no command is given then the effect is to
74 # rlogin to each machine.
78 if [ "$root_remsh" = "true" ]; then
79 rsh $machine -nl root "$cmd"
81 rsh $machine -n "$cmd"
84 if [ "$root_remsh" = "true" ]; then
87 echo "Executing rlogin $machine"