diff options
author | jim-p <jimp@pfsense.org> | 2011-08-24 12:58:19 -0400 |
---|---|---|
committer | jim-p <jimp@pfsense.org> | 2011-08-24 12:59:29 -0400 |
commit | 196dafe90e83bdfed0cf1a20fd393898f8c99aae (patch) | |
tree | e196508b025c5f673167e6f3186ca6425ec91b6b /usr/local | |
parent | defe335cd33381b9aa087ba697069cf72cd0e0a8 (diff) | |
download | pfsense-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-x | usr/local/sbin/ppp-linkdown | 20 |
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 |