Skip to content

Commit

Permalink
adding in support for machine groups
Browse files Browse the repository at this point in the history
  • Loading branch information
malloc47 committed Jul 30, 2012
1 parent 7749e32 commit ab8918c
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 3 deletions.
10 changes: 8 additions & 2 deletions cmd
Original file line number Diff line number Diff line change
@@ -1,8 +1,14 @@
#!/bin/bash
source config
for m in `cat $MACHINES` ; do
if [ -f "$1" ] ; then
MACHINE_LIST=$(cat $1)
shift
else
MACHINE_LIST=$(cat $MACHINES)
fi
for m in $MACHINE_LIST ; do
if [[ "$m" != "`hostname -s`" ]]; then
echo $m:
ssh $m $@
echo ssh $m $@
fi
done
6 changes: 5 additions & 1 deletion sync
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,11 @@ source ./config
FILE_LIST=$(cd $SHARED_DIR ; find . -type f | grep -v \\.$ | cut -b 2-)

if [ $# -gt 0 ]; then
MACHINE_LIST=$1
if [ -f "$1" ] ; then
MACHINE_LIST=$(cat $1)
else
MACHINE_LIST=$@
fi
else
MACHINE_LIST=$(cat $MACHINES)
fi
Expand Down

0 comments on commit ab8918c

Please sign in to comment.