summaryrefslogtreecommitdiffstats
path: root/usr
diff options
context:
space:
mode:
Diffstat (limited to 'usr')
-rwxr-xr-xusr/local/sbin/ppp-linkdown11
-rwxr-xr-xusr/local/sbin/ppp-linkup7
2 files changed, 13 insertions, 5 deletions
diff --git a/usr/local/sbin/ppp-linkdown b/usr/local/sbin/ppp-linkdown
index bd4f606..56a96d9 100755
--- a/usr/local/sbin/ppp-linkdown
+++ b/usr/local/sbin/ppp-linkdown
@@ -9,14 +9,15 @@ if [ "$3" != "" ]; then
/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
+
+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 $4
+ route delete default ${OLD_ROUTER}
fi
-
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 dba4412..3a62fbb 100755
--- a/usr/local/sbin/ppp-linkup
+++ b/usr/local/sbin/ppp-linkup
@@ -1,6 +1,13 @@
#!/bin/sh
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
+ fi
+
# let the configuration system know that the ipv4 has changed.
/bin/echo $4 > /tmp/$1_router
/bin/echo $3 > /tmp/$1_ip
OpenPOWER on IntegriCloud