diff --git a/hooks/install b/hooks/install index 0f129e635d47f864018aa3e859786e58feb15696..fc11be12420d4119be63ed74c24294b5bf36cafc 100644 --- a/hooks/install +++ b/hooks/install @@ -1,9 +1,7 @@ #!/bin/bash # Here do anything needed to install the service -# i.e. apt-get install -y foo or bzr branch http://myserver/mycode /srv/webroot -# Make sure this hook exits cleanly and is idempotent, common problems here are -# failing to account for a debconf question on a dependency, or trying to pull -# from github without installing git first. +# i.e. apt install -y foo +# Make sure this hook exits cleanly and is idempotent. set -e status-set maintenance "Changing Default gateway" @@ -23,7 +21,6 @@ if [ "$GATEWAY_IP" == "$OLD_GATEWAY_IP" ]; then exit 0 fi - apt install -y sipcalc GATEWAY_NET=`sipcalc $GATEWAY | grep "Network address" | awk '{print $4}'` @@ -31,7 +28,7 @@ GATEWAY_NET=`sipcalc $GATEWAY | grep "Network address" | awk '{print $4}'` old_IFS=$IFS IFS=$'\n' LINE=0 -for INTERFACE in $(grep adress /etc/network/interfaces); +for INTERFACE in $(grep address /etc/network/interfaces); do ADDRESS=`echo $INTERFACE | awk '{ print $3}'` ADDRESS_NET=`sipcalc $ADDRESS | grep "Network address" | awk '{print $4}'`