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 |
197c30ae
|
jim-p
|
if [ "$3" != "" ]; then
|
7 |
c15a87f7
|
Renato Botelho
|
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 |
197c30ae
|
jim-p
|
fi
|
18 |
766cd450
|
jim-p
|
|
19 |
8f563bb4
|
Ermal
|
/sbin/pfctl -i $1 -Fs
|
20 |
9eb49a51
|
Ermal
|
if [ -f "/tmp/${1}_defaultgw" ]; then
|
21 |
|
|
route delete default ${OLD_ROUTER}
|
22 |
04c528e7
|
Ermal
|
fi
|
23 |
cbe4111f
|
Ermal Luçi
|
# delete the node just in case mpd cannot do that
|
24 |
d32a40c1
|
gnhb
|
/usr/sbin/ngctl shutdown $1:
|
25 |
f7ea0505
|
Ermal
|
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 |
b439dc01
|
Ermal
|
# Do not remove gateway used during filter reload.
|
33 |
3d471a14
|
Ermal
|
/bin/rm -f /tmp/$1_router
|
34 |
d32a40c1
|
gnhb
|
/bin/rm -f /tmp/$1up
|
35 |
0c452870
|
Ermal
|
/bin/rm -f /tmp/$1_ip
|
36 |
0ae6daf8
|
Ermal
|
/usr/local/sbin/pfSctl -c 'service reload dns'
|