summaryrefslogtreecommitdiffstats
path: root/usr/local
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:29 -0400
commit196dafe90e83bdfed0cf1a20fd393898f8c99aae (patch)
treee196508b025c5f673167e6f3186ca6425ec91b6b /usr/local
parentdefe335cd33381b9aa087ba697069cf72cd0e0a8 (diff)
downloadpfsense-196dafe90e83bdfed0cf1a20fd393898f8c99aae.zip
pfsense-196dafe90e83bdfed0cf1a20fd393898f8c99aae.tar.gz
Make sure this does not operate on empty parameters, and also log when removing states.
Diffstat (limited to 'usr/local')
-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