From 3b921694c6a1cf123cad3f3a626a707763798f50 Mon Sep 17 00:00:00 2001 From: dr-dolomite Date: Sat, 16 Mar 2024 11:13:02 +0800 Subject: [PATCH] fixed MCCMNC sometimes not showing --- simpleadmin/scripts/modemstatus_parse.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/simpleadmin/scripts/modemstatus_parse.sh b/simpleadmin/scripts/modemstatus_parse.sh index 461f72c..e1c9678 100644 --- a/simpleadmin/scripts/modemstatus_parse.sh +++ b/simpleadmin/scripts/modemstatus_parse.sh @@ -95,9 +95,9 @@ COPS_MNC="-" CID="" CID5="" RAT="" -# get MCCMNC and then remove the quotes -MCCMNC=$(echo $OX | grep -o "+QSPN: \"[^\"]*\",\"[^\"]*\",\"[^\"]*\",[0-9]\+,\"[0-9]\+\"" | cut -d, -f5) | tr -d '"' QSPN=$(echo $OX | grep -o '+QSPN: "[^"]*","[^"]*","[^"]*",[^"]*,"[^"]*"' | cut -c 8-) +# GET MCCMNC from the last field of QSPN +MCCMNC=$(echo $QSPN | cut -d, -f5 | tr -d '"') PROVIDER=$(echo $QSPN | cut -d, -f1 | tr -d '"') PROVIDER_ID=$(echo $QSPN | cut -d, -f5 | tr -d '"') CSQ=$(echo $OX | grep -o "+CSQ: [0-9]\{1,2\}" | grep -o "[0-9]\{1,2\}")