Project

General

Profile

Download (1018 Bytes) Statistics
| Branch: | Tag: | Revision:
1
#!/bin/sh
2
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
if [ "$3" != "" ]; then
7
	if echo "$3" | grep -q '/'; then
8
		LOCAL_IP="${3}"
9
	else
10
		LOCAL_IP="${3}/32"
11
	fi
12

    
13
	echo "Removing states from ${LOCAL_IP}" | logger -t ppp-linkdown
14
	/sbin/pfctl -k 0.0.0.0/0 -k ${LOCAL_IP}
15
	/sbin/pfctl -k ${LOCAL_IP}
16
	pfctl -K ${LOCAL_IP}
17
fi
18

    
19
/sbin/pfctl -i $1 -k 0.0.0.0/0
20
if [ -f "/tmp/${1}_defaultgw" ]; then
21
	route delete default ${OLD_ROUTER}
22
fi
23
# delete the node just in case mpd cannot do that
24
/usr/sbin/ngctl shutdown $1:
25
if [ -f "/var/etc/nameserver_$1" ]; then
26
	# Remove old entries
27
	for nameserver in `cat /var/etc/nameserver_$1`; do
28
		/sbin/route delete $nameserver >/dev/null 2>&1
29
	done
30
	/bin/rm -f /var/etc/nameserver_$1
31
fi
32
# Do not remove gateway used during filter reload.
33
/bin/rm -f /tmp/$1_router
34
/bin/rm -f /tmp/$1up
35
/bin/rm -f /tmp/$1_ip
36
/usr/local/sbin/pfSctl -c 'service reload dns'
(27-27/34)