summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/ovpn-linkup
blob: 0f1ca80bcf5a7458b389c25cf7b4adac9bb15206 (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 [ -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"
exit 0
OpenPOWER on IntegriCloud