From fbbbd7fe0ed26b00b937eef43386af28630095aa Mon Sep 17 00:00:00 2001 From: fujr Date: Sun, 20 Oct 2024 14:26:06 +0800 Subject: [PATCH] qmodem: fix modem led --- .../root/usr/share/qmodem/modem_dial.sh | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh index bd26eb8..f06c634 100755 --- a/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh +++ b/luci/luci-app-qmodem/root/usr/share/qmodem/modem_dial.sh @@ -49,9 +49,17 @@ set_led() ;; net) [ -z "$net_led" ] && return - cfg_name=$(echo $net_led |tr ":" ".") - uci set system.led_n${net_led}.dev=$value - uci commit system + cfg_name=$(echo $net_led |tr ":" "_") + uci batch << EOF +set system.n${cfg_name}=led +set system.n${cfg_name}.name=${modem_slot}_net_indicator +set system.n${cfg_name}.sysfs=${net_led} +set system.n${cfg_name}.trigger=netdev +set system.n${cfg_name}.dev=${modem_netcard} +set system.n${cfg_name}.mode="tx rx" +commit system +EOF + /etc/init.d/led restart ;; esac