Skip to content

Commit

Permalink
Merge pull request #2981 from freifunk-gluon/tunneldigger-watchdog
Browse files Browse the repository at this point in the history
gluon-mesh-vpn-tunneldigger: tunneldigger-watchdog: remove broken restart check
  • Loading branch information
neocturne authored Sep 17, 2023
2 parents 9577d2f + 7a43dab commit ae11a56
Showing 1 changed file with 0 additions and 15 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -7,16 +7,6 @@ local function restart_tunneldigger()
os.execute('/etc/init.d/tunneldigger restart')
end

local function read_pid_file()
local pid_file = io.open('/var/run/tunneldigger.mesh-vpn.pid', 'r')
if not pid_file then
return nil
end
local pid = pid_file:read('*l')
pid_file:close()
return pid
end

local function has_mesh_vpn_neighbours()
local handle = io.popen('batctl o', 'r')
if not handle then
Expand All @@ -33,11 +23,6 @@ local function has_mesh_vpn_neighbours()
end

if uci:get_bool('tunneldigger', 'mesh_vpn', 'enabled') then
if io.popen('pgrep -x /usr/bin/tunneldigger'):read('*l') ~= read_pid_file() then
os.execute('logger -t tunneldigger-watchdog "Process-Pid does not match with pid-File."')
restart_tunneldigger()
return
end
if not has_mesh_vpn_neighbours() then
os.execute('logger -t tunneldigger-watchdog "No vpn-mesh neighbours found."')
restart_tunneldigger()
Expand Down

0 comments on commit ae11a56

Please sign in to comment.