comgt: add support of using device symlinks.
authorNickolay Ledovskikh <nledovskikh@gmail.com>
Fri, 16 Dec 2016 11:14:05 +0000 (14:14 +0300)
committerJohn Crispin <john@phrozen.org>
Tue, 20 Dec 2016 08:35:35 +0000 (09:35 +0100)
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 <nledovskikh@gmail.com>
package/network/utils/comgt/files/3g.sh
package/network/utils/comgt/files/directip.sh
package/network/utils/comgt/files/ncm.sh

index b0cdae234db8ed99d1de1842d956f096c1e54ab0..d438cb7a6d2390294919b6e80e5a21b1d7c69f71 100644 (file)
@@ -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
index 79b8c32c83c699d621507ddf632c8003758f754e..381bfb000075d4fdfe1d2024d3af6a1e80ee9b47 100644 (file)
@@ -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
index 09c2c18b401c1b779386999e59550be813a4eefe..cf3cef615455035f7c7f6d8fc9e3e9d480e1dce6 100644 (file)
@@ -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