mirror of
https://github.com/Ysurac/openmptcprouter-feeds.git
synced 2025-03-09 15:40:03 +00:00
New way to get gw
This commit is contained in:
parent
e15e1da8b5
commit
15a992e3b3
1 changed files with 3 additions and 0 deletions
|
@ -711,6 +711,9 @@ function interfaces_status()
|
|||
if connectivity ~= "ERROR" and gateway == "" and ifname ~= nil then
|
||||
if fs.access("/sys/class/net/" .. ifname) then
|
||||
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep kernel | awk '/proto kernel/ {print $1}' | grep -v / | tr -d '\n'"))
|
||||
if gateway == "" then
|
||||
gateway = ut.trim(sys.exec("ip -4 r list dev " .. ifname .. " | grep default | awk '{print $3}' | tr -d '\n'"))
|
||||
end
|
||||
end
|
||||
end
|
||||
if connectivity ~= "ERROR" and gateway ~= "" then
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue