1
|
#!/bin/sh
|
2
|
|
3
|
if [ "${dev_type}" = "tun" ]; then
|
4
|
if [ -n "${route_vpn_gateway}" ]; then
|
5
|
/bin/echo ${route_vpn_gateway} > /tmp/${1}_router
|
6
|
elif [ -n "${ifconfig_remote}" ]; then
|
7
|
/bin/echo ${ifconfig_remote} > /tmp/${1}_router
|
8
|
elif [ -n "${ifconfig_local}" ]; then
|
9
|
/bin/echo ${ifconfig_local} > /tmp/${1}_router
|
10
|
else
|
11
|
/bin/echo ${5} > /tmp/${1}_router
|
12
|
fi
|
13
|
else
|
14
|
if [ -n "${route_vpn_gateway}" ]; then
|
15
|
/bin/echo ${route_vpn_gateway} > /tmp/${1}_router
|
16
|
fi
|
17
|
fi
|
18
|
|
19
|
/usr/bin/touch /tmp/${1}up
|
20
|
# reload filter
|
21
|
/usr/local/sbin/pfSctl -c "interface newip ${1}"
|
22
|
exit 0
|