diff --git a/files/qemu-ifup-public b/files/qemu-ifup-public index 36e2d27..eea116e 100755 --- a/files/qemu-ifup-public +++ b/files/qemu-ifup-public @@ -11,7 +11,7 @@ maxprefixv4=25 if [ -z $IP ]; then echo "got nothing back from the API" - exit 10 + exit 10 fi eui64() { @@ -45,7 +45,7 @@ for IP in "${IPS[@]}"; do fi echo "we got IPv4 with prefix ${BASH_REMATCH[0]}" - ip route add ${IP} dev ${IFACE} + ip route add ${IP} dev ${IFACE} elif [[ $IP =~ ^2604:bbc0:[0-9,a-f,:]{1,444}/([0-9]{2,3})$ ]]; then ### we got a PIv6 prefix < masprefixv6 @@ -60,9 +60,13 @@ for IP in "${IPS[@]}"; do fi echo "we got IPv6 with prefix ${BASH_REMATCH[0]}" - ip route add ${IP} dev ${IFACE} via $(eui64 $PUBLICMAC) + 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