wpj428/files/usr/sbin/promsignal

15 lines
585 B
Text
Raw Normal View History

2021-03-23 12:38:36 +00:00
#!/bin/sh
# Global Configuration
mmcli -m 0 --signal-setup=10 2>&1 1>/dev/null
# Fetch & parse signal from MM
RES=$(mmcli -m 0 --signal-get -K)
RSRQ=$(echo -en "$RES" | grep modem.signal.lte.rsrq | grep -Eo "\-?[0-9]*.[0-9]*$")
RSRP=$(echo -en "$RES" | grep modem.signal.lte.rsrp | grep -Eo "\-?[0-9]*.[0-9]*$")
SNR=$(echo -en "$RES" | grep modem.signal.lte.snr | grep -Eo "\-?[0-9]*.[0-9]*$")
2021-03-23 12:50:07 +00:00
LCID=$(qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-info|grep 'Cell ID: '|grep -o '\d*')
2021-03-23 12:38:36 +00:00
# Display parsed data
echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID"