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