allow for provisioning opnly one host
This commit is contained in:
parent
627ce44fa0
commit
0dab8e618e
1 changed files with 13 additions and 3 deletions
|
@ -4,10 +4,20 @@ if [ ! -f "$1" ]; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if [ -z "$2" ]; then
|
||||
./mkhosts.sh "$1"
|
||||
./mkacatcher_cpp.sh "$1"
|
||||
fi
|
||||
|
||||
for HOST in `cat "$1"`; do
|
||||
if [ ! -z "$2" ]; then
|
||||
if grep -q "$2" "$1" ]; then
|
||||
HOSTS="$2"
|
||||
fi
|
||||
else
|
||||
HOSTS="`cat $1`"
|
||||
fi
|
||||
echo $HOSTS
|
||||
for HOST in $HOSTS; do
|
||||
>&2 echo "provisioning host $HOST"
|
||||
ssh pi@$HOST "if [ ! -d \$HOME/.ssh ]; then mkdir \$HOME/.ssh; fi; echo `cat $HOME/.ssh/id_rsa.pub` >> \$HOME/.ssh/authorized_keys; chmod 700 \$HOME/.ssh; chmod 644 \$HOME/.ssh/authorized_keys"
|
||||
for FILE in HOSTS SERVERIP stream.sh set_hostname.sh v4lcap.c; do scp $FILE pi@$HOST:$FILE; done
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue