From 6ede4e0f23ea1569edb1030e831534e39b338c02 Mon Sep 17 00:00:00 2001 From: Donald Burr Date: Sat, 21 Feb 2015 09:33:38 -0800 Subject: [PATCH] do not reobot machines --- acatcher/provision_streamers.sh | 5 +++-- acatcher/set_hostname.sh | 7 ++++++- 2 files changed, 9 insertions(+), 3 deletions(-) diff --git a/acatcher/provision_streamers.sh b/acatcher/provision_streamers.sh index a2963ad..f23fb0e 100755 --- a/acatcher/provision_streamers.sh +++ b/acatcher/provision_streamers.sh @@ -24,7 +24,8 @@ for HOST in $HOSTS; do ssh pi@$HOST "if ! dpkg -s screen >/dev/null 2>&1 ; then sudo apt-get -y install screen; fi" ssh pi@$HOST "make v4lcap" ssh pi@$HOST "cd \$HOME && bash set_hostname.sh" - ssh pi@$HOST "sudo reboot" + #ssh pi@$HOST "sudo reboot" done -echo "all machines will require a few minutes to reboot, be patient grasshopper" +echo "all machines provisioned." +#echo "all machines will require a few minutes to reboot, be patient grasshopper" diff --git a/acatcher/set_hostname.sh b/acatcher/set_hostname.sh index d2b244a..f6be38a 100755 --- a/acatcher/set_hostname.sh +++ b/acatcher/set_hostname.sh @@ -3,6 +3,10 @@ MAC=`/sbin/ifconfig eth0 | grep -o -E '([[:xdigit:]]{1,2}:){5}[[:xdigit:]]{1,2}' | tr '[A-Z]' '[a-z]'` if grep -q $MAC HOSTS; then HOSTNAME=`grep $MAC HOSTS | cut -d\| -f1` + if [ "$HOSTNAME" = "`hostname`" ]; then + echo 'hostname is already correct' + exit 1 + fi echo "setting hostname to $HOSTNAME" echo "$HOSTNAME" > /tmp/HOSTNAME.$$ sudo rm -f /etc/hostname @@ -10,7 +14,8 @@ if grep -q $MAC HOSTS; then sudo chown root:root /etc/hostname sudo chmod 644 /etc/hostname sudo /etc/init.d/hostname.sh + exit 0 else echo "cannot determine hostname" + exit 1 fi -exit 1