diff options
author | Ermal <eri@pfsense.org> | 2011-04-29 18:23:11 +0000 |
---|---|---|
committer | Ermal <eri@pfsense.org> | 2011-04-29 18:23:11 +0000 |
commit | f7ea05059649a0b8eb1a17d34328928447a16123 (patch) | |
tree | 1a23d86bcc52871e67ec98afd31ac019f7d66980 | |
parent | a73a9886e7ca043efa3e8d6ea8cfb3611ae95aa3 (diff) | |
download | pfsense-f7ea05059649a0b8eb1a17d34328928447a16123.zip pfsense-f7ea05059649a0b8eb1a17d34328928447a16123.tar.gz |
Remove static routes that are added for dns servers when allow override is allowed when a ppp interface goes down. Code borrowed from dhclient-script.
-rwxr-xr-x | usr/local/sbin/ppp-linkdown | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown index 4d4db42..f6a78b9 100755 --- a/usr/local/sbin/ppp-linkdown +++ b/usr/local/sbin/ppp-linkdown @@ -9,7 +9,13 @@ fi /sbin/pfctl -b $3 -b $4 # delete the node just in case mpd cannot do that /usr/sbin/ngctl shutdown $1: -/bin/rm -f /var/etc/nameserver_$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 |