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 <nledovskikh@gmail.com>
This commit is contained in:
Nickolay Ledovskikh 2016-12-16 14:14:05 +03:00 committed by John Crispin
parent cf62a17710
commit 13ab314b0b
3 changed files with 5 additions and 0 deletions

View 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

View 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

View 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