diff options
author | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-02 16:40:58 +0000 |
---|---|---|
committer | jow <jow@3c298f89-4303-0410-b956-a3cf2f4a3e73> | 2010-05-02 16:40:58 +0000 |
commit | cae51af965122b777e20baccc8779dcaaf022d95 (patch) | |
tree | ee27426a4d6cf7ed9ca7611b8b26e04537054fdb /package/ppp/files/etc | |
parent | 71f6198448a70ba306a061f2f4c6a3ed3698dc33 (diff) |
[package] ppp: add hotplug helper for usb dsl modems to ppp-mod-pppoa package
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@21302 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/ppp/files/etc')
-rw-r--r-- | package/ppp/files/etc/hotplug.d/atm/20-usb-modem | 25 |
1 files changed, 25 insertions, 0 deletions
diff --git a/package/ppp/files/etc/hotplug.d/atm/20-usb-modem b/package/ppp/files/etc/hotplug.d/atm/20-usb-modem new file mode 100644 index 000000000..ab9e3b7f8 --- /dev/null +++ b/package/ppp/files/etc/hotplug.d/atm/20-usb-modem @@ -0,0 +1,25 @@ +#!/bin/sh
+
+if [ "$ACTION" = "add" ]; then
+ include /lib/network
+ scan_interfaces
+
+ local found=0
+ local ifc
+ for ifc in $interfaces; do
+ local up
+ config_get_bool up "$ifc" up 0
+
+ local proto
+ config_get proto "$ifc" proto
+
+ if [ "$proto" = "pppoa" ] && [ "$up" != 1 ]; then
+ found=1
+ ( sleep 1; ifup "$ifc" ) &
+ fi
+ done
+
+ if [ "$found" != 1 ]; then
+ logger "Found no matching interface for DSL device $DEVICENAME"
+ fi
+fi
|