The `\s` is a GNU extension to awk and doesn't work on BSD's awk. Use
`[[:space:]]` instead to work with BSD's awk.
Signed-off-by: Aaron LI <aly@aaronly.me>
# Get rid of lines containing IPv6 addresses (':')
# Get rid of lines for link-local routes (https://superuser.com/a/1067742)
# Get rid of lines containing $TUNDEV (we don't want loopback)
- netstat -r -n | awk '/:/ { next; } /link\#/ { next; } /\s'"$TUNDEV"'(\s|$)/ { next; } /^(default|0\.0\.0\.0(\s|\/0))/ { print $2; exit; }'
+ netstat -r -n | awk '/:/ { next; } /link\#/ { next; } /[[:space:]]'"$TUNDEV"'([[:space:]]|$)/ { next; } /^(default|0\.0\.0\.0([[:space:]]|\/0))/ { print $2; exit; }'
}
set_vpngateway_route() {