Project

General

Profile

Download (995 Bytes) Statistics
| Branch: | Tag: | Revision:
1 cbe4111f Ermal Luçi
#!/bin/sh
2 63292199 gnhb
if [ -f /tmp/$1up ] && [ -f /conf/$1.log ]; then
3
        seconds=$((`date -j +%s` - `/usr/bin/stat -f %m /tmp/$1up`))
4
        /usr/local/sbin/ppp-log-uptime.sh $seconds $1 &
5
fi
6 196dafe9 jim-p
if [ "$3" != "" ]; then
7
	echo "Removing states from $3" | logger -t ppp-linkdown
8
	/sbin/pfctl -k 0.0.0.0/0 -k $3/32
9
	/sbin/pfctl -k $3/32
10
	pfctl -K $3/32
11
fi
12
if [ "$4" != "" ]; then
13
	echo "Removing states to $4" | logger -t ppp-linkdown
14
	/sbin/pfctl -b 0.0.0.0/32 -b $4/32
15
16
	if [ -f "/tmp/${interface}_defaultgw" ]; then
17
		route delete default $4
18
	fi
19
20 04c528e7 Ermal
fi
21 cbe4111f Ermal Luçi
# delete the node just in case mpd cannot do that
22 d32a40c1 gnhb
/usr/sbin/ngctl shutdown $1:
23 f7ea0505 Ermal
if [ -f "/var/etc/nameserver_$1" ]; then
24
	# Remove old entries
25
	for nameserver in `cat /var/etc/nameserver_$1`; do
26
		/sbin/route delete $nameserver >/dev/null 2>&1
27
	done
28
	/bin/rm -f /var/etc/nameserver_$1
29
fi
30 b439dc01 Ermal
# Do not remove gateway used during filter reload.
31 3d471a14 Ermal
/bin/rm -f /tmp/$1_router
32 d32a40c1 gnhb
/bin/rm -f /tmp/$1up
33 0c452870 Ermal
/bin/rm -f /tmp/$1_ip
34 0ae6daf8 Ermal
/usr/local/sbin/pfSctl -c 'service reload dns'