1
0
Fork 0
mirror of https://github.com/Ysurac/openmptcprouter-feeds.git synced 2025-03-09 15:40:03 +00:00

Try to fix modemmanager signal

This commit is contained in:
Ycarus (Yannick Chabanois) 2020-02-21 17:09:22 +01:00
parent 8e5d9b5923
commit 51e22f0b40
2 changed files with 19 additions and 13 deletions

View file

@ -1,7 +1,11 @@
#!/bin/sh #!/bin/sh
MODEM_INTF=$1 MODEM_INTF=$1
[ -z "$MODEM_INTF" ] && return [ -z "$MODEM_INTF" ] && return
SIGNAL_INFO=$(mmcli -m $MODEM_INTF --output-keyvalue) ALL_MODEMS=$(mmcli -L)
[ -z "$SIGNAL_INFO" ] && return for MODEM in $ALL_MODEMS; do
PERCENT=$(echo $SIGNAL_INFO | grep 'status.signal-quality' | awk -F": " '{print $2}') MODEM_ID=$(echo $MODEM | awk -F' ' '{print $1}' | awk -F/ '{print $6}')
MODEM_INFO=$(mmcli -m $MODEM_ID --output-keyvalue | grep $MODEM_INTF)
done
[ -z "$MODEM_INFO" ] && return
PERCENT=$(echo $MODEM_INFO | grep 'modem.generic.signal-quality.value' | awk -F": " '{print $2}')
echo $PERCENT echo $PERCENT

View file

@ -1020,16 +1020,18 @@ function interfaces_status()
connectivity = "ERROR" connectivity = "ERROR"
end end
local proto = section['proto'] if ifname ~= "" and ifname ~= nil then
if proto == "qmi" then local proto = section['proto']
local device = section['device'] if proto == "qmi" then
signal = sys.exec("omr-qmi " .. device) local device = section['device']
elseif proto == "3g" then signal = sys.exec("omr-qmi " .. device)
local device = section['device'] elseif proto == "3g" then
signal = sys.exec("omr-3g " .. device) local device = section['device']
elseif proto == "modemmanager" then signal = sys.exec("omr-3g " .. device)
local device = section['device'] elseif proto == "modemmanager" then
signal = sys.exec("omr-modemmanager " .. device) local device = section['device']
signal = sys.exec("omr-modemmanager " .. ifname)
end
end end
local latency = "" local latency = ""