From 40fd50c8d044069e144fea38ce5c288f34b6e725 Mon Sep 17 00:00:00 2001 From: Ermal Date: Fri, 1 Jul 2011 21:21:07 +0000 Subject: Do not add an automatic gateway on openvpn tap case since its only the netmask. --- usr/local/sbin/ovpn-linkup | 14 ++++++++++---- 1 file changed, 10 insertions(+), 4 deletions(-) diff --git a/usr/local/sbin/ovpn-linkup b/usr/local/sbin/ovpn-linkup index b613a9a..0f1ca80 100755 --- a/usr/local/sbin/ovpn-linkup +++ b/usr/local/sbin/ovpn-linkup @@ -2,11 +2,17 @@ # let the configuration system know that the ip has changed. #/usr/local/sbin/pfSctl -c "interface newip $interface" -if [ "" != "$route_vpn_gateway" ]; then - /bin/echo $route_vpn_gateway > /tmp/$1_router -else - /bin/echo $5 > /tmp/$1_router + + +ifindex="${1##?????}" +if [ -f /dev/tun$ifindex ]; then + if [ "" != "$route_vpn_gateway" ]; then + /bin/echo $route_vpn_gateway > /tmp/$1_router + else + /bin/echo $5 > /tmp/$1_router + fi fi + /usr/bin/touch /tmp/$1up # reload filter /usr/local/sbin/pfSctl -c "interface newip $1" -- cgit v1.1