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

Should fix retrieve IP for QMI proto

This commit is contained in:
Ycarus 2018-12-10 14:59:01 +01:00
parent b7d380da31
commit 4cfc11147c

View file

@ -754,6 +754,12 @@ function interfaces_status()
connectivity = "ERROR"
end
if ipaddr == "" and ifname ~= nil then
ipaddr = ut.trim(sys.exec("ip -4 -br addr ls dev " .. ifname .. " | awk -F'[ /]+' '{print $3}' | tr -d '\n'"))
end
if ipaddr == "" and ifname ~= nil then
ipaddr = ut.trim(sys.exec("ip -4 addr show dev " .. ifname .. " | grep -m 1 inet | awk '{print $2}' | cut -d'/' -s -f1 | tr -d '\n'"))
end
if ipaddr == "" then
connectivity = "ERROR"
end