aboutsummaryrefslogtreecommitdiffstats
path: root/package/network/utils/comgt/files/directip.sh
diff options
context:
space:
mode:
authorJohn Crispin <blogic@openwrt.org>2014-10-08 08:01:20 +0000
committerJohn Crispin <blogic@openwrt.org>2014-10-08 08:01:20 +0000
commit98e716884d9421af03c89637613498b87c69617a (patch)
tree8675dcb267039fb6b1351ffc59ef910f444a3ca3 /package/network/utils/comgt/files/directip.sh
parentf93a2e4c7ed6c1e4f755ce47d68997022ea0010b (diff)
downloadmaster-187ad058-98e716884d9421af03c89637613498b87c69617a.tar.gz
master-187ad058-98e716884d9421af03c89637613498b87c69617a.tar.bz2
master-187ad058-98e716884d9421af03c89637613498b87c69617a.zip
wwan: add a generic 3g/4g proto
this proto handler will detect which of 3g, qmi, mbim, ncm or directip you need for a stick and setup uci automagically Signed-off-by: John Crispin <blogic@openwrt.org> git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42837 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network/utils/comgt/files/directip.sh')
-rw-r--r--package/network/utils/comgt/files/directip.sh16
1 files changed, 12 insertions, 4 deletions
diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh
index b860f1ef27..a633fa2e15 100644
--- a/package/network/utils/comgt/files/directip.sh
+++ b/package/network/utils/comgt/files/directip.sh
@@ -1,8 +1,10 @@
#!/bin/sh
-. /lib/functions.sh
-. ../netifd-proto.sh
-init_proto "$@"
+[ -n "$INCLUDE_ONLY" ] || {
+ . /lib/functions.sh
+ . ../netifd-proto.sh
+ init_proto "$@"
+}
proto_directip_init_config() {
available=1
@@ -22,6 +24,8 @@ proto_directip_setup() {
local device apn pincode ifname auth username password
json_get_vars device apn pincode auth username password
+ [ -n "$ctl_device" ] && device=$ctl_device
+
[ -e "$device" ] || {
proto_notify_error "$interface" NO_DEVICE
proto_set_available "$interface" 0
@@ -93,10 +97,14 @@ proto_directip_teardown() {
local device
json_get_vars device
+ [ -n "$ctl_device" ] && device=$ctl_device
+
gcom -d "$device" -s /etc/gcom/directip-stop.gcom || proto_notify_error "$interface" CONNECT_FAILED
proto_init_update "*" 0
proto_send_update "$interface"
}
-add_protocol directip
+[ -n "$INCLUDE_ONLY" ] || {
+ add_protocol directip
+}