fixing bug in regex of qemu-ifup-public public IP matching

This commit is contained in:
toby 2018-10-08 18:22:22 +02:00
parent 1b891db635
commit 4f7f177cc6
1 changed files with 2 additions and 2 deletions

View File

@ -37,8 +37,8 @@ arp -i ${IFACE} -Ds 169.254.0.1 ${IFACE} netmask 255.255.255.255 pub
IFS=',' read -ra IPS <<< "$IP"
for IP in "${IPS[@]}"; do
echo $IP
if [[ $IP =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]/([0-9]{2})$ ]]; then ### we got a IPv4 prefix < maxprefixv4
echo matched ${BASH_REMATCH[1]}
if [[ $IP =~ ^[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}/([0-9]{2})$ ]]; then ### we got a IPv4 prefix < maxprefixv4
echo matched ${BASH_REMATCH[1]}
if [ ${BASH_REMATCH[1]} -lt $maxprefixv4 ]; then
echo "we don't support such a big customer net?"
continue