diff options
author | Jo-Philipp Wich <jow@openwrt.org> | 2010-05-02 16:40:58 +0000 |
---|---|---|
committer | Jo-Philipp Wich <jow@openwrt.org> | 2010-05-02 16:40:58 +0000 |
commit | b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef (patch) | |
tree | b6fee0664763c826c4858dbeba8376488409de6a /package/ppp/files/etc | |
parent | a09235eca6c3c16fcafbd64765d8ec3047388ee0 (diff) | |
download | upstream-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.tar.gz upstream-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.tar.bz2 upstream-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.zip |
ppp: add hotplug helper for usb dsl modems to ppp-mod-pppoa package
SVN-Revision: 21302
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 0000000000..45ef54239c --- /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 |