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 }