Author: nbd
Date: 2014-09-26 15:44:21 +0200 (Fri, 26 Sep 2014)
New Revision: 42669

Modified:
   trunk/package/network/utils/comgt/files/directip.sh
Log:
comgt: in directip, derive the wwan ifname automatically instead of specifying 
it in the config

Signed-off-by: Felix Fietkau <[email protected]>

Modified: trunk/package/network/utils/comgt/files/directip.sh
===================================================================
--- trunk/package/network/utils/comgt/files/directip.sh 2014-09-26 08:57:36 UTC 
(rev 42668)
+++ trunk/package/network/utils/comgt/files/directip.sh 2014-09-26 13:44:21 UTC 
(rev 42669)
@@ -8,7 +8,6 @@
        available=1
        no_device=1
        proto_config_add_string "device:device"
-       proto_config_add_string "ifname"
        proto_config_add_string "apn"
        proto_config_add_string "pincode"
        proto_config_add_string "auth"
@@ -18,10 +17,10 @@
 
 proto_directip_setup() {
        local interface="$1"
-       local chat
+       local chat devpath devname
 
        local device apn pincode ifname auth username password
-       json_get_vars device apn pincode ifname auth username password
+       json_get_vars device apn pincode auth username password
 
        [ -e "$device" ] || {
                proto_notify_error "$interface" NO_DEVICE
@@ -29,6 +28,10 @@
                return 1
        }
 
+       devname="$(basename "$device")"
+       devpath="$(readlink -f /sys/class/tty/$devname/device)"
+       ifname="$( ls "$devpath"/../../*/net )"
+
        [ -n "$ifname" ] || {
                proto_notify_error "$interface" NO_IFNAME
                proto_set_available "$interface" 0
_______________________________________________
openwrt-commits mailing list
[email protected]
https://lists.openwrt.org/cgi-bin/mailman/listinfo/openwrt-commits

Reply via email to