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:
parent
8e5d9b5923
commit
51e22f0b40
2 changed files with 19 additions and 13 deletions
|
@ -1,7 +1,11 @@
|
|||
#!/bin/sh
|
||||
MODEM_INTF=$1
|
||||
[ -z "$MODEM_INTF" ] && return
|
||||
SIGNAL_INFO=$(mmcli -m $MODEM_INTF --output-keyvalue)
|
||||
[ -z "$SIGNAL_INFO" ] && return
|
||||
PERCENT=$(echo $SIGNAL_INFO | grep 'status.signal-quality' | awk -F": " '{print $2}')
|
||||
ALL_MODEMS=$(mmcli -L)
|
||||
for MODEM in $ALL_MODEMS; do
|
||||
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
|
||||
|
|
|
@ -1020,16 +1020,18 @@ function interfaces_status()
|
|||
connectivity = "ERROR"
|
||||
end
|
||||
|
||||
local proto = section['proto']
|
||||
if proto == "qmi" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-qmi " .. device)
|
||||
elseif proto == "3g" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-3g " .. device)
|
||||
elseif proto == "modemmanager" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-modemmanager " .. device)
|
||||
if ifname ~= "" and ifname ~= nil then
|
||||
local proto = section['proto']
|
||||
if proto == "qmi" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-qmi " .. device)
|
||||
elseif proto == "3g" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-3g " .. device)
|
||||
elseif proto == "modemmanager" then
|
||||
local device = section['device']
|
||||
signal = sys.exec("omr-modemmanager " .. ifname)
|
||||
end
|
||||
end
|
||||
|
||||
local latency = ""
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue