From: Nickolay Ledovskikh Date: Fri, 16 Dec 2016 11:14:05 +0000 (+0300) Subject: comgt: add support of using device symlinks. X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=13ab314b0b4a8106c8325f5bdf1232b6896f637f;p=openwrt%2Fstaging%2Fblogic.git comgt: add support of using device symlinks. It's useful when using multiple usb devices that should be bound to certain usb ports. Symlinks are created by hotplug handlers. Signed-off-by: Nickolay Ledovskikh --- diff --git a/package/network/utils/comgt/files/3g.sh b/package/network/utils/comgt/files/3g.sh index b0cdae234db8..d438cb7a6d23 100644 --- a/package/network/utils/comgt/files/3g.sh +++ b/package/network/utils/comgt/files/3g.sh @@ -31,6 +31,8 @@ proto_3g_setup() { json_get_var dialnumber dialnumber [ -n "$dat_device" ] && device=$dat_device + + device="$(readlink -f $device)" [ -e "$device" ] || { proto_set_available "$interface" 0 return 1 diff --git a/package/network/utils/comgt/files/directip.sh b/package/network/utils/comgt/files/directip.sh index 79b8c32c83c6..381bfb000075 100644 --- a/package/network/utils/comgt/files/directip.sh +++ b/package/network/utils/comgt/files/directip.sh @@ -27,6 +27,7 @@ proto_directip_setup() { [ -n "$ctl_device" ] && device=$ctl_device + device="$(readlink -f $device)" [ -e "$device" ] || { proto_notify_error "$interface" NO_DEVICE proto_set_available "$interface" 0 diff --git a/package/network/utils/comgt/files/ncm.sh b/package/network/utils/comgt/files/ncm.sh index 09c2c18b401c..cf3cef615455 100644 --- a/package/network/utils/comgt/files/ncm.sh +++ b/package/network/utils/comgt/files/ncm.sh @@ -45,6 +45,8 @@ proto_ncm_setup() { proto_set_available "$interface" 0 return 1 } + + device="$(readlink -f $device)" [ -e "$device" ] || { echo "Control device not valid" proto_set_available "$interface" 0