adding more resiliancy to the ifup-public script. we want it to maybe fail if it doesn't know what to do with the variable. not just silently continue

This commit is contained in:
toby 2019-02-21 01:02:35 +00:00
parent 13be20d519
commit fb96f1daa8
1 changed files with 8 additions and 4 deletions

View File

@ -62,7 +62,11 @@ for IP in "${IPS[@]}"; do
echo "we got IPv6 with prefix ${BASH_REMATCH[0]}"
ip route add ${IP} dev ${IFACE} via $(eui64 $PUBLICMAC)
else ### don't know what we have but something we can't work with
elif [[ $IP =~ ^\ *$ ]]; then
echo "we just got an empty string. so not gonna do anything. probably due to splitting the comma"
else
echo "Unable to detect with what prefix I'm working with"
exit 10
fi
done