From 4cfc11147c7f90187ad019263faa8aa8216af6d7 Mon Sep 17 00:00:00 2001 From: Ycarus Date: Mon, 10 Dec 2018 14:59:01 +0100 Subject: [PATCH] Should fix retrieve IP for QMI proto --- .../luasrc/controller/openmptcprouter.lua | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua index db2ff0922..0424afbdd 100644 --- a/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua +++ b/luci-app-openmptcprouter/luasrc/controller/openmptcprouter.lua @@ -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