summaryrefslogtreecommitdiffstats
path: root/package/ppp/files/etc/ppp/ip-down
diff options
context:
space:
mode:
Diffstat (limited to 'package/ppp/files/etc/ppp/ip-down')
-rwxr-xr-xpackage/ppp/files/etc/ppp/ip-down16
1 files changed, 15 insertions, 1 deletions
diff --git a/package/ppp/files/etc/ppp/ip-down b/package/ppp/files/etc/ppp/ip-down
index 814948e0b..f3d63a019 100755
--- a/package/ppp/files/etc/ppp/ip-down
+++ b/package/ppp/files/etc/ppp/ip-down
@@ -1,5 +1,19 @@
#!/bin/sh
-[ -z "$6" ] || env -i ACTION="ifdown" INTERFACE="$6" DEVICE="$1" PROTO=ppp /sbin/hotplug-call "iface"
+PPP_IFACE="$1"
+PPP_TTY="$2"
+PPP_SPEED="$3"
+PPP_LOCAL="$4"
+PPP_REMOTE="$5"
+PPP_IPPARAM="$6"
+export PPP_IFACE PPP_TTY PPP_SPEED PPP_LOCAL PPP_REMOTE PPP_IPPARAM
+[ -z "$PPP_IPPARAM" ] || {
+ env -i ACTION="ifdown" INTERFACE="$PPP_IPPARAM" DEVICE="$PPP_IFACE" PROTO=ppp /sbin/hotplug-call "iface"
+
+ # remove the interface's network state
+ FILE=/var/state/network.$$
+ grep -v "^config_set '$PPP_IPPARAM' " /var/state/network > "$FILE"
+ mv "$FILE" /var/state/network
+}
[ -d /etc/ppp/ip-down.d ] && {
for SCRIPT in /etc/ppp/ip-down.d/*