comparison master/bin/wbash.sh @ 30:9275e2a8b5e2

hacking to get id into wbash.sh, maybe buggy?
author Henry S. Thompson <ht@markup.co.uk>
date Mon, 19 Nov 2018 18:32:30 +0000
parents 55e953e5c66f
children
comparison
equal deleted inserted replaced
29:2bde174fe9e2 30:9275e2a8b5e2
1 #!/bin/bash 1 #!/bin/bash
2 if [ $# -lt 1 ] 2 if [ $# -lt 1 ]
3 then 3 then
4 cat 1>&2 <<EOF 4 cat 1>&2 <<EOF
5 Usage: cat cmds | $0 SSname [...args] 5 Usage: cat cmds | $0 [-d] [-x] SSname [...args]
6 Where SSname is the name of a VM scale set. 6 Where SSname is the name of a VM scale set.
7 7
8 Runs bash [with args] on every machine in a scale set, 8 Runs bash [with args] on every machine in a scale set,
9 on commands from stdin 9 on commands from stdin
10 by doing as it were 10 by doing as it were
11 cat | ssh machine "bash \$args" 11 cat | ssh machine [$id] "bash \$args"
12
13 if -d, show command eventually on stderr
12 EOF 14 EOF
13 exit 1 15 exit 1
14 fi 16 fi
17 if [ $1 = -d ]
18 then
19 shift
20 debug=-d
21 fi
15 ss=$1 22 ss=$1
16 shift 23 shift
17 wrun.sh $ss bash -x -ff - -i "$@" '\<ifile.txt' 24 wrun.sh $ss '"bash -s"' $debug -ff - -i "$@" '\<ifile.txt'
25
26