Skip to content
Snippets Groups Projects
Commit 4a383408 authored by Giuseppe Attardi's avatar Giuseppe Attardi
Browse files

Update install

parent b0baf019
No related branches found
No related tags found
No related merge requests found
......@@ -25,20 +25,19 @@ apt install -y sipcalc
GATEWAY_NET=`sipcalc $GATEWAY | grep "Network address" | awk '{print $4}'`
old_IFS=$IFS
IFS=$'\n'
LINE=0
FOUND=0
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}'`
if [ "$ADDRESS_NET" == "$GATEWAY_NET" ]; then
LINE=`address'`
LINE=1
fi
done
IFS=$old_IFS
unset IFS
if [ "$LINE" -gt 0 ]; then
if [ "$FOUND" -gt 0 ]; then
juju-log "Default gateway $GATEWAY_IP is setting..."
sed -i "/address/i\ gateway $GATEWAY_IP" /etc/network/interfaces
if [ ! -z "$OLD_GATEWAY_IP" ]; then
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment