diff options
author | Renato Botelho <renato@netgate.com> | 2015-08-25 08:08:24 -0300 |
---|---|---|
committer | Renato Botelho <renato@netgate.com> | 2015-08-25 14:49:54 -0300 |
commit | 46bc6e545a17e77202aaf01ec0cd8d5a46567525 (patch) | |
tree | 32d18dda436ec739c67c489ceb771e8629cd926f /src/usr/local/sbin/ppp-linkdown | |
parent | 4d9801c2dbd2b3e54a39578ee62b93af66607227 (diff) | |
download | pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.zip pfsense-46bc6e545a17e77202aaf01ec0cd8d5a46567525.tar.gz |
Move main pfSense content to src/
Diffstat (limited to 'src/usr/local/sbin/ppp-linkdown')
-rwxr-xr-x | src/usr/local/sbin/ppp-linkdown | 31 |
1 files changed, 31 insertions, 0 deletions
diff --git a/src/usr/local/sbin/ppp-linkdown b/src/usr/local/sbin/ppp-linkdown new file mode 100755 index 0000000..62d07ed --- /dev/null +++ b/src/usr/local/sbin/ppp-linkdown @@ -0,0 +1,31 @@ +#!/bin/sh + +IF="${1}" +LOCAL_IP="${3}" + +if [ -f /tmp/${IF}up ] && [ -f /conf/${IF}.log ]; then + seconds=$((`date -j +%s` - `/usr/bin/stat -f %m /tmp/${IF}up`)) + /usr/local/sbin/ppp-log-uptime.sh $seconds ${IF} & +fi + +/etc/rc.kill_states ${IF} ${LOCAL_IP} + +if [ -s "/tmp/${IF}_defaultgw" ]; then + GW=`head -n 1 /tmp/${IF}_defaultgw` + [ -n "${GW}" ] \ + && /sbin/route delete default ${GW} +fi +# delete the node just in case mpd cannot do that +/usr/sbin/ngctl shutdown ${IF}: +if [ -f "/var/etc/nameserver_${IF}" ]; then + # Remove old entries + for nameserver in `cat /var/etc/nameserver_${IF}`; do + /sbin/route delete ${nameserver} >/dev/null 2>&1 + done + /bin/rm -f /var/etc/nameserver_${IF} +fi +# Do not remove gateway used during filter reload. +/bin/rm -f /tmp/${IF}_router +/bin/rm -f /tmp/${IF}up +/bin/rm -f /tmp/${IF}_ip +/usr/local/sbin/pfSctl -c 'service reload dns' |