summaryrefslogtreecommitdiff
path: root/package/ppp
diff options
context:
space:
mode:
authorJo-Philipp Wich <jow@openwrt.org>2010-05-02 16:40:58 +0000
committerJo-Philipp Wich <jow@openwrt.org>2010-05-02 16:40:58 +0000
commitb46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef (patch)
treeb6fee0664763c826c4858dbeba8376488409de6a /package/ppp
parenta09235eca6c3c16fcafbd64765d8ec3047388ee0 (diff)
downloadmtk-20170518-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.zip
mtk-20170518-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.tar.gz
mtk-20170518-b46d822e9bbb9e8c0c3e134d2eee09dfcf8b2cef.tar.bz2
ppp: add hotplug helper for usb dsl modems to ppp-mod-pppoa package
SVN-Revision: 21302
Diffstat (limited to 'package/ppp')
-rw-r--r--package/ppp/Makefile2
-rw-r--r--package/ppp/files/etc/hotplug.d/atm/20-usb-modem25
2 files changed, 27 insertions, 0 deletions
diff --git a/package/ppp/Makefile b/package/ppp/Makefile
index 90e4590..222c85d 100644
--- a/package/ppp/Makefile
+++ b/package/ppp/Makefile
@@ -149,6 +149,8 @@ define Package/ppp-mod-pppoa/install
$(1)/usr/lib/pppd/$(PKG_VERSION)/
$(INSTALL_DIR) $(1)/lib/network
$(INSTALL_BIN) ./files/pppoa.sh $(1)/lib/network/
+ $(INSTALL_DIR) $(1)/etc/hotplug.d/atm
+ $(INSTALL_DATA) ./files/etc/hotplug.d/atm/20-usb-modem $(1)/etc/hotplug.d/atm/
endef
define Package/ppp-mod-pppoe/install
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 0000000..45ef542
--- /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