comparison master/bin/bindWorkerVars.sh @ 54:1099246f22b6

new scripts
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 08 Feb 2019 17:46:49 +0000
parents
children
comparison
equal deleted inserted replaced
53:9df880d45440 54:1099246f22b6
1 # Usage . bindWorkerVars.sh name
2 # (Re)init worker environment vars
3 name=$1
4 f=$HOME/.parallel/$name
5 rm -f $f
6 az vmss list-instance-connection-info -g cc -n $name | tr -s ',": ' '\t' | \
7 tail -n +2 | fgrep instance |cut -f 4,5 | \
8 while read ip port
9 do
10 echo ssh -p $port $ip >> $f
11 done
12 ip=$(head -1 $f | cut -f 4 -d ' ')
13 export $name=$ip
14 export WORKERS=$name
15 sed '/export WORKERS/s/=.*$/='$name'/;/WORKERS names/s/ .*=[^ ]* / '$name'='$ip' /' -i $HOME/.bashrc
16 echo $name=$ip