copyfile uses rsync, check that args exist
[gnt-info] / emulator / gnt-cluster
1 #!/bin/sh -e
2
3 op=$1 ; shift
4
5 test -z "$1" && exit 1
6
7 if [ "$op" = "command" ] ; then
8
9         show_machine=0
10         if [ $1 = '-M' ] ; then # FIXME --machine
11                 shift
12                 show_machine=1
13         fi
14
15         for host in lib10 lib15 lib20 ; do
16
17                 prefix=''
18                 test $show_machine && prefix="$host: "
19                 #echo "# ssh $host $*"
20                 ssh $host $* | sed "s/^/$prefix/"
21
22         done
23
24 elif [ "$op" = "copyfile" ] ; then
25
26         rsync $1 lib10:$1
27         rsync $1 lib20:$1
28
29 else
30         echo "UNKNOWN [$op] $*"
31         exit 1
32 fi