mirror of
https://github.com/openwrt/luci
synced 2025-01-08 12:08:04 +08:00
Merge pull request #1761 from pmelange/ff_olsr_watchdog_del_tnl
ff_olsr_watchdog: delete stale tunnels
This commit is contained in:
commit
5c07c6fff3
@ -23,6 +23,15 @@ if fs.access("/var/run/olsrd.pid") or fs.access("/var/run/olsrd4.pid") then
|
||||
|
||||
if not wdgtime or ( systime - wdgtime ) > ( intv * 2 ) then
|
||||
os.execute("logger -t 'OLSR watchdog' 'Process died - restarting!'")
|
||||
local tnls = io.popen("ip tunnel show | cut -d : -f 1")
|
||||
while true do
|
||||
tnl = tnls:read("*line")
|
||||
if tnl == nil then break end
|
||||
if string.find(tnl, "tnl_") == 1 then
|
||||
os.execute(string.format("logger -t 'OLSR watchdog' 'Deleting stale tunnel %s'", tnl))
|
||||
os.execute(string.format("ip link del %s", tnl))
|
||||
end
|
||||
end
|
||||
os.execute("/etc/init.d/olsrd restart")
|
||||
end
|
||||
end
|
||||
|
Loading…
Reference in New Issue
Block a user