Mercurial > hg > cc > azure
view master/bin/internal/vmss_setup.sh @ 9:55e953e5c66f
wrun.sh, invoke.sh:
add control of use of nohup, with -i(mmediately) and -w(ait) respectively
wrun.sh: add support for fixed file input via -ff, handle -ff - in obvious way
wbash.sh: use -ff - and -i to execute shell commands on all workers
author | Henry S. Thompson <ht@markup.co.uk> |
---|---|
date | Tue, 02 Oct 2018 10:52:45 +0000 |
parents | a7637c994964 |
children | 68cca895e872 |
line wrap: on
line source
#!/bin/bash set -e #Arguments are instance port host --resource-group $resource --name $name instance=$1 port=$2 host=$3 shift 3 #Accept host keys :-( if ! ssh-keyscan -p $port $host >>~/.ssh/known_hosts 2>/dev/null; then echo $host:$port does not seem to be up, might be overprovisioned 1>&2 exit 1 fi #Copy azure credentials over and make delete/deallocate commands (echo $@ --instance-ids $instance; cd ~; tar c .azure) |ssh -o ConnectTimeout=5 -p $port $host 'read a; echo -e '\''#!/bin/bash\n'\''az vmss deallocate $a >deallocate && echo -e '\''#!/bin/bash\n'\''az vmss delete-instances $a >delete && chmod +x deallocate delete && tar x && sudo mv deallocate delete /bin' echo ssh -p $port $host " #id $instance"