From 9eb49a5152a8f3affbf85eaf1923e60eef3b1375 Mon Sep 17 00:00:00 2001 From: Ermal Date: Wed, 30 Jan 2013 10:22:02 +0000 Subject: pfctl -b is gone just use std tools of pfctl --- usr/local/sbin/ovpn-linkdown | 2 +- usr/local/sbin/ppp-linkdown | 11 +++-------- usr/local/sbin/ppp-linkup | 2 +- 3 files changed, 5 insertions(+), 10 deletions(-) (limited to 'usr') diff --git a/usr/local/sbin/ovpn-linkdown b/usr/local/sbin/ovpn-linkdown index b300aed..4780b4f 100755 --- a/usr/local/sbin/ovpn-linkdown +++ b/usr/local/sbin/ovpn-linkdown @@ -1,5 +1,5 @@ #!/bin/sh -# /sbin/pfctl -b $4 -b $5 +/sbin/pfctl -i $1 -k 0.0.0.0/0 # delete the node just in case mpd cannot do that /bin/rm -f /var/etc/nameserver_$1 /bin/rm -f /tmp/$1_router diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown index 87560f7..2ab0b6b 100755 --- a/usr/local/sbin/ppp-linkdown +++ b/usr/local/sbin/ppp-linkdown @@ -16,14 +16,9 @@ if [ "$3" != "" ]; then pfctl -K ${LOCAL_IP} fi -OLD_ROUTER=`/bin/cat /tmp/${1}_router` -if [ "${OLD_ROUTER}" != "" ]; then - echo "Removing states to ${OLD_ROUTER}" | logger -t ppp-linkdown - /sbin/pfctl -b 0.0.0.0/32 -b ${OLD_ROUTER}/32 - - if [ -f "/tmp/${interface}_defaultgw" ]; then - route delete default ${OLD_ROUTER} - fi +/sbin/pfctl -i $1 -k 0.0.0.0/0 +if [ -f "/tmp/${1}_defaultgw" ]; then + route delete default ${OLD_ROUTER} fi # delete the node just in case mpd cannot do that /usr/sbin/ngctl shutdown $1: diff --git a/usr/local/sbin/ppp-linkup b/usr/local/sbin/ppp-linkup index 3a62fbb..50308b1 100755 --- a/usr/local/sbin/ppp-linkup +++ b/usr/local/sbin/ppp-linkup @@ -5,7 +5,7 @@ if [ "$2" == "inet" ]; then OLD_ROUTER=`/bin/cat /tmp/${1}_router` if [ "${OLD_ROUTER}" != "" ]; then echo "Removing states to old router ${OLD_ROUTER}" | logger -t ppp-linkup - /sbin/pfctl -b 0.0.0.0/32 -b ${OLD_ROUTER}/32 + /sbin/pfctl -i $1 -k 0.0.0.0/0 -k ${OLD_ROUTER}/32 fi # let the configuration system know that the ipv4 has changed. -- cgit v1.1