summaryrefslogtreecommitdiffstats
path: root/usr/local/sbin/ppp-linkdown
diff options
context:
space:
mode:
authorjim-p <jimp@pfsense.org>2011-08-24 12:58:19 -0400
committerjim-p <jimp@pfsense.org>2011-08-24 12:59:13 -0400
commit197c30ae98aafb2a565c3937eded6a9b583b7baa (patch)
treed0468c494a9ec2e1780bd7e757703cd1e34dfcb8 /usr/local/sbin/ppp-linkdown
parent923d15bf87b01cb3ecff0ee1e5c5de8eb0f81f8f (diff)
downloadpfsense-197c30ae98aafb2a565c3937eded6a9b583b7baa.zip
pfsense-197c30ae98aafb2a565c3937eded6a9b583b7baa.tar.gz
Make sure this does not operate on empty parameters, and also log when removing states.
Diffstat (limited to 'usr/local/sbin/ppp-linkdown')
-rwxr-xr-xusr/local/sbin/ppp-linkdown20
1 files changed, 14 insertions, 6 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index 4c1ad15..bd4f606 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -3,13 +3,21 @@ 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 [ -f "/tmp/${interface}_defaultgw" ]; then
- route delete default $4
+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
+if [ "$4" != "" ]; then
+ echo "Removing states to $4" | logger -t ppp-linkdown
+ /sbin/pfctl -b 0.0.0.0/32 -b $4/32
+
+ if [ -f "/tmp/${interface}_defaultgw" ]; then
+ route delete default $4
+ fi
+
fi
-/sbin/pfctl -k 0.0.0.0/0 -k $3/32
-/sbin/pfctl -k $3/32
-pfctl -K $3/32
-/sbin/pfctl -b 0.0.0.0/32 -b $4/32
# delete the node just in case mpd cannot do that
/usr/sbin/ngctl shutdown $1:
if [ -f "/var/etc/nameserver_$1" ]; then
OpenPOWER on IntegriCloud