Project

General

Profile

Download (992 Bytes) Statistics
| Branch: | Tag: | Revision:
1 cbe4111f Ermal Luçi
#!/bin/sh
2 2c27096c Renato Botelho
3
IF="${1}"
4 6c452777 David Wood
PROTOCOL="${2}"
5 2c27096c Renato Botelho
LOCAL_IP="${3}"
6
7
if [ -f /tmp/${IF}up ] && [ -f /conf/${IF}.log ]; then
8
	seconds=$((`date -j +%s` - `/usr/bin/stat -f %m /tmp/${IF}up`))
9
	/usr/local/sbin/ppp-log-uptime.sh $seconds ${IF} &
10 63292199 gnhb
fi
11 766cd450 jim-p
12 46e27ea7 Renato Botelho
/etc/rc.kill_states ${IF} ${LOCAL_IP}
13
14 6df89ece David Wood
if [ "${PROTOCOL}" == "inet" && -s "/tmp/${IF}_defaultgw" ]; then
15 def432e6 Renato Botelho
	GW=`head -n 1 /tmp/${IF}_defaultgw`
16
	[ -n "${GW}" ] \
17 f7dfd39f David Wood
		&& /sbin/route -q delete default ${GW}
18 04c528e7 Ermal
fi
19 6c452777 David Wood
if [ "${PROTOCOL}" == "inet6" ]; then
20
	/usr/local/sbin/ppp-ipv6 ${IF} down
21
fi
22 cbe4111f Ermal Luçi
# delete the node just in case mpd cannot do that
23 2c27096c Renato Botelho
/usr/sbin/ngctl shutdown ${IF}:
24
if [ -f "/var/etc/nameserver_${IF}" ]; then
25 f7ea0505 Ermal
	# Remove old entries
26 2c27096c Renato Botelho
	for nameserver in `cat /var/etc/nameserver_${IF}`; do
27 f7dfd39f David Wood
		/sbin/route -q delete ${nameserver} >/dev/null 2>&1
28 f7ea0505 Ermal
	done
29 2c27096c Renato Botelho
	/bin/rm -f /var/etc/nameserver_${IF}
30 f7ea0505 Ermal
fi
31 b439dc01 Ermal
# Do not remove gateway used during filter reload.
32 2c27096c Renato Botelho
/bin/rm -f /tmp/${IF}_router
33
/bin/rm -f /tmp/${IF}up
34
/bin/rm -f /tmp/${IF}_ip
35 0ae6daf8 Ermal
/usr/local/sbin/pfSctl -c 'service reload dns'