summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/ovpn-linkup
blob: 3ebf32ee7952a8ec94cfff02679299affe67a752 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
#!/bin/sh

# let the configuration system know that the ip has changed.
#/usr/local/sbin/pfSctl -c "interface newip $interface"


ifindex="${1##?????}"
if [ -e /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"
exit 0
OpenPOWER on IntegriCloud