comparison master/bin/makeWorker.sh @ 3:be5de30147ab

just barely
author Henry S. Thompson <ht@markup.co.uk>
date Fri, 28 Sep 2018 12:29:29 +0000
parents
children 56d8823c68e0
comparison
equal deleted inserted replaced
2:b4b731c105e2 3:be5de30147ab
1 #!/usr/bin/bash
2 # Usage . makeWorker.sh name
3 # Source this to get the worker name set to its IP address
4 name=$1
5 ip=$(az vm list-ip-addresses -g cc -n $name|egrep -o '"ipAddress": ".*"' | cut -f 2 -d ' ' | tr -d \")
6 export $name=$ip
7 echo $name=$ip
8 ssh -o StrictHostKeyChecking=no $ip <cat /var/cc/workers/bin/setupTemplate.sh
9 sudo bash -c "cd ~cc/.ssh && tar -czf - authorized_keys id_rsa id_rsa.pub" | \
10 ssh $ip "sudo su -c 'cd ~/.ssh && tar -xzf -' cd"
11