Mercurial > hg > cc > azure
annotate master/bin/wbash.sh @ 32:9342f6269edf
rewritten to be faster, maybe, and avoid earlier bug
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 20 Nov 2018 10:31:05 +0000 |
parents | 9275e2a8b5e2 |
children |
rev | line source |
---|---|
9 | 1 #!/bin/bash |
2 if [ $# -lt 1 ] | |
3 then | |
4 cat 1>&2 <<EOF | |
30
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
5 Usage: cat cmds | $0 [-d] [-x] SSname [...args] |
9 | 6 Where SSname is the name of a VM scale set. |
7 | |
8 Runs bash [with args] on every machine in a scale set, | |
9 on commands from stdin | |
10 by doing as it were | |
30
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
11 cat | ssh machine [$id] "bash \$args" |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
12 |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
13 if -d, show command eventually on stderr |
9 | 14 EOF |
15 exit 1 | |
16 fi | |
30
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
17 if [ $1 = -d ] |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
18 then |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
19 shift |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
20 debug=-d |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
21 fi |
9 | 22 ss=$1 |
23 shift | |
30
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
24 wrun.sh $ss '"bash -s"' $debug -ff - -i "$@" '\<ifile.txt' |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
25 |
9275e2a8b5e2
hacking to get id into wbash.sh, maybe buggy?
Henry S. Thompson <ht@markup.co.uk>
parents:
9
diff
changeset
|
26 |