From b945cee62d49487a437b114d0b8555080e6ce932 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rafa=C5=82=20Wabik?= <4rafal@gmail.com> Date: Sat, 5 Mar 2022 08:23:04 -0800 Subject: [PATCH] Update.. --- modemband/files/usr/bin/modemband.sh | 5 +++++ modemband/files/usr/share/modemband/12d11506 | 6 +++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/modemband/files/usr/bin/modemband.sh b/modemband/files/usr/bin/modemband.sh index 3935fee6..91771996 100644 --- a/modemband/files/usr/bin/modemband.sh +++ b/modemband/files/usr/bin/modemband.sh @@ -184,6 +184,11 @@ if [ -z "$_DEVICE" ]; then echo "No supported modem was found, quitting..." fi exit 0 +else + _DEVICE1=$(uci -q get modemband.@modemband[0].set_port) + if [ -n "$_DEVICE1" ]; then + _DEVICE=$_DEVICE1 + fi fi if [ ! -e "$_DEVICE" ]; then if [ "x$1" = "xjson" ]; then diff --git a/modemband/files/usr/share/modemband/12d11506 b/modemband/files/usr/share/modemband/12d11506 index 0a129b49..9f0f2086 100644 --- a/modemband/files/usr/share/modemband/12d11506 +++ b/modemband/files/usr/share/modemband/12d11506 @@ -23,5 +23,9 @@ setbands() { else HEX=$(bandstohex "$BANDS") fi - [ "$HEX" != "0" ] && sms_tool -d $_DEVICE at "at^syscfgex=\"030201\",3FFFFFFF,2,4,$HEX,," + if [ "$HEX" != "0" ]; then + O=$(sms_tool -d $_DEVICE at "at^syscfgex?") + MODE=$(echo "$O" | awk -F[:,] '{print $2}' | xargs) + sms_tool -d $_DEVICE at "at^syscfgex=\"${MODE:-030201}\",3FFFFFFF,2,4,$HEX,," + fi }