wpj428/files/usr/sbin/promsignal

14 lines
585 B
Bash
Executable file

#!/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]*$")
LCID=$(qmicli --device=/dev/cdc-wdm0 --device-open-proxy --nas-get-system-info|grep 'Cell ID: '|grep -o '\d*')
# Display parsed data
echo "rsrq=$RSRQ, rsrp=$RSRP, snr=$SNR, lcid=$LCID"