annotate master/bin/wbash.sh @ 54:1099246f22b6

new scripts
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 08 Feb 2019 17:46:49 +0000
parents 9275e2a8b5e2
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
9
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
1 #!/bin/bash
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
2 if [ $# -lt 1 ]
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
3 then
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
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
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
6 Where SSname is the name of a VM scale set.
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
7
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
8 Runs bash [with args] on every machine in a scale set,
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
9 on commands from stdin
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
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
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
14 EOF
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
15 exit 1
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
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
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
22 ss=$1
55e953e5c66f wrun.sh, invoke.sh:
Henry S. Thompson <ht@markup.co.uk>
parents:
diff changeset
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