From 0dab8e618e4b8075748c75093df517475cf224dd Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Thu, 19 Feb 2015 10:30:00 -0800 Subject: [PATCH] allow for provisioning opnly one host --- acatcher/provision_streamers.sh | 16 +++++++++++++--- 1 file changed, 13 insertions(+), 3 deletions(-) diff --git a/acatcher/provision_streamers.sh b/acatcher/provision_streamers.sh index b5d2620..ad46ce4 100755 --- a/acatcher/provision_streamers.sh +++ b/acatcher/provision_streamers.sh @@ -4,10 +4,20 @@ if [ ! -f "$1" ]; then exit 1 fi -./mkhosts.sh "$1" -./mkacatcher_cpp.sh "$1" +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