aboutsummaryrefslogtreecommitdiff
path: root/share/hydra/mass
diff options
context:
space:
mode:
authorSilvio Rhatto <rhatto@riseup.net>2010-11-14 14:50:55 -0200
committerSilvio Rhatto <rhatto@riseup.net>2010-11-14 14:50:55 -0200
commit2c1c916fc6b0a11ca572ede5a95e63b46fa1e61d (patch)
treee7b8ea9677150f7e234ff4e59a22a2a92f5a724e /share/hydra/mass
parentdbf0e0cb984c7be0f805f58d20e65b6780dc6f77 (diff)
downloadhydra-2c1c916fc6b0a11ca572ede5a95e63b46fa1e61d.tar.gz
hydra-2c1c916fc6b0a11ca572ede5a95e63b46fa1e61d.tar.bz2
Nodes and mass updates
Diffstat (limited to 'share/hydra/mass')
-rwxr-xr-xshare/hydra/mass15
1 files changed, 7 insertions, 8 deletions
diff --git a/share/hydra/mass b/share/hydra/mass
index 06447c2..9b87d4a 100755
--- a/share/hydra/mass
+++ b/share/hydra/mass
@@ -17,7 +17,7 @@ function mass_loop {
for node in $NODES; do
echo "Issuing $COMMAND on multiple nodes..."
echo "Connecting to $node..."
- ssh -o ConnectTimeout=15 $node $COMMAND
+ ssh -o ConnectTimeout=15 $node sudo $COMMAND
done
}
@@ -29,18 +29,17 @@ hydra_config_load
BASENAME="`basename $0`"
COMMAND="$*"
+# Initial node list
+NODES="`hydra $HYDRA nodes`"
+
# Validation
if [ "$BASENAME" == "mass-update" ]; then
- COMMAND="sudo aptitude update"
+ COMMAND="aptitude update"
elif [ "$BASENAME" == "mass-update" ]; then
- COMMAND="sudo aptitude safe-upgrade"
+ COMMAND="aptitude safe-upgrade"
elif [ "$BASENAME" == "mass-web" ]; then
- echo "Currently not implemented."
- exit 1
+ NODES="`hydra $HYDRA nodes web`"
fi
-# Build node list
-NODES="`hydra $HYDRA nodes`"
-
# Execute commands in hosts
mass_loop $COMMAND