diff --git a/luci/luci-app-qmodem/Makefile b/luci/luci-app-qmodem/Makefile index 6a1e482..01b8cb0 100644 --- a/luci/luci-app-qmodem/Makefile +++ b/luci/luci-app-qmodem/Makefile @@ -6,7 +6,7 @@ include $(TOPDIR)/rules.mk PKG_NAME:=luci-app-qmodem LUCI_TITLE:=LuCI support for QWRT Modem LUCI_PKGARCH:=all -PKG_VERSION:=2.3 +PKG_VERSION:=2.3.1 PKG_LICENSE:=GPLv3 PKG_LINCESE_FILES:=LICENSE PKG_MAINTAINER:=Tom diff --git a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua index 29f944d..c657f5d 100644 --- a/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua +++ b/luci/luci-app-qmodem/luasrc/model/cbi/qmodem/dial_config.lua @@ -35,6 +35,7 @@ if avalible_ports == nil then avalible_ports = {} end for i1,v1 in ipairs(avalible_ports) do + valid=false for i2,v2 in ipairs(valid_at_ports) do if v1 == v2 then valid=true diff --git a/luci/luci-app-qmodem/root/etc/init.d/qmodem_init b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init index 817c2df..a1125da 100755 --- a/luci/luci-app-qmodem/root/etc/init.d/qmodem_init +++ b/luci/luci-app-qmodem/root/etc/init.d/qmodem_init @@ -49,13 +49,13 @@ _try_vendor_preset_pcie() _try_pcie_slot() { config_get type "$1" type - [ "$1" == "pcie" ] && _try_slot + [ "$type" == "pcie" ] && _try_slot $1 } _try_usb_slot() { config_get type "$1" type - [ "$1" == "usb" ] && _try_slot + [ "$type" == "usb" ] && _try_slot $1 } _try_usb_device() @@ -74,7 +74,7 @@ _scan_usb() { procd_open_instance "scan_usb" #delay 15 second ,scan all usb device - procd_set_param command "ash" "/usr/share/modem/modem_scan.sh" "scan" "15" "usb" + procd_set_param command "ash" "/usr/share/qmodem/modem_scan.sh" "scan" "15" "usb" procd_close_instance } @@ -82,7 +82,7 @@ _scan_pcie() { procd_open_instance "scan_pcie" #delay 3 second ,scan all pcie device - procd_set_param command "ash" "/usr/share/modem/modem_scan.sh" "scan" "3" "pcie" + procd_set_param command "ash" "/usr/share/qmodem/modem_scan.sh" "scan" "3" "pcie" procd_close_instance } @@ -111,7 +111,7 @@ _try_slot() procd_set_param command "ash" "/usr/share/modem/modem_scan.sh" "add" "$slot" "$type" procd_close_instance else - /usr/share/modem/modem_scan.sh disable "$slot" + /usr/share/qmodem/modem_scan.sh disable "$slot" fi } diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh index 7aa2a19..9794d08 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_scan.sh @@ -259,7 +259,7 @@ add() { local slot=$1 lock -n /tmp/lock/modem_add_$slot - [ $? -eq 1 ] && return + [ $? -eq 0 ] || return #slot_type is usb or pcie #section name is replace slot .:- with _ section_name=$(echo $slot | sed 's/[\.:-]/_/g') @@ -275,7 +275,7 @@ add() modem_path="/sys/bus/pci/devices/$slot/" ;; esac - [ -z "$net_devices" ] && return + [ -z "$net_devices" ] && lock -u /tmp/lock/modem_add_$slot && return for at_port in $valid_at_ports; do get_modem_model "/dev/$at_port" echo "modem_name:$modem_name" @@ -330,7 +330,7 @@ EOF uci add_list qmodem.$section_name.valid_at_ports="/dev/$at_port" uci set qmodem.$section_name.at_port="/dev/$at_port" done - for at_port in $tty_devices; do + for at_port in $at_ports; do uci add_list qmodem.$section_name.ports="/dev/$at_port" done uci commit qmodem @@ -380,7 +380,7 @@ disable() case $action in "add") debug_subject="modem_scan_add" - add $config + add $config $slot_type ;; "remove") debug_subject="modem_scan_remove"