diff options
author | Felix Fietkau <nbd@openwrt.org> | 2014-09-26 13:44:21 +0000 |
---|---|---|
committer | Felix Fietkau <nbd@openwrt.org> | 2014-09-26 13:44:21 +0000 |
commit | 83e01b374fcad7ef19d924422efacaf46309a0f6 (patch) | |
tree | 634a0a9e3fb4efffc6b8e9d4afd56be7d814e383 /package/network | |
parent | 992d1bbd8b1dfc01eeaf909b5219b105c840b678 (diff) | |
download | upstream-83e01b374fcad7ef19d924422efacaf46309a0f6.tar.gz upstream-83e01b374fcad7ef19d924422efacaf46309a0f6.tar.bz2 upstream-83e01b374fcad7ef19d924422efacaf46309a0f6.zip |
comgt: in directip, derive the wwan ifname automatically instead of specifying it in the config
Signed-off-by: Felix Fietkau <nbd@openwrt.org>
git-svn-id: svn://svn.openwrt.org/openwrt/trunk@42669 3c298f89-4303-0410-b956-a3cf2f4a3e73
Diffstat (limited to 'package/network')
-rw-r--r-- | package/network/utils/comgt/files/directip.sh | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh index f09d938b09..6b9326ddc9 100644 --- a/package/network/utils/comgt/files/directip.sh +++ b/package/network/utils/comgt/files/directip.sh @@ -8,7 +8,6 @@ proto_directip_init_config() { 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_init_config() { 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 @@ proto_directip_setup() { 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 |