From f83342e9a20d870d2b6a4b928c2d8e23c5b29c95 Mon Sep 17 00:00:00 2001 From: Jo-Philipp Wich Date: Sun, 2 May 2010 16:40:58 +0000 Subject: [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 --- package/ppp/Makefile | 2 ++ package/ppp/files/etc/hotplug.d/atm/20-usb-modem | 25 ++++++++++++++++++++++++ 2 files changed, 27 insertions(+) create mode 100644 package/ppp/files/etc/hotplug.d/atm/20-usb-modem (limited to 'package/ppp') diff --git a/package/ppp/Makefile b/package/ppp/Makefile index 90e4590efe..222c85deae 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 0000000000..ab9e3b7f8e --- /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 -- cgit v1.2.3