From 021080c09493144e36db72dba56f2073c3dd9449 Mon Sep 17 00:00:00 2001 From: "Matthias P. Walther" Date: Tue, 4 Jun 2019 22:59:26 +0200 Subject: [PATCH] Tunneldigger-Watchdog: Refractoring, move import to the top --- .../files/usr/bin/tunneldigger-watchdog | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/package/gluon-mesh-vpn-tunneldigger/files/usr/bin/tunneldigger-watchdog b/package/gluon-mesh-vpn-tunneldigger/files/usr/bin/tunneldigger-watchdog index ccfb121a..23b63833 100755 --- a/package/gluon-mesh-vpn-tunneldigger/files/usr/bin/tunneldigger-watchdog +++ b/package/gluon-mesh-vpn-tunneldigger/files/usr/bin/tunneldigger-watchdog @@ -1,5 +1,7 @@ #!/usr/bin/lua +local uci = require('simple-uci').cursor() + function restart_tunneldigger() io.popen('logger -t tunneldigger-watchdog "Restarting Tunneldigger."') os.execute('/etc/init.d/tunneldigger restart') @@ -30,7 +32,6 @@ function has_mesh_vpn_neighbours() return false end -local uci = require('simple-uci').cursor() if uci:get_bool('tunneldigger', 'mesh_vpn', 'enabled') then if io.popen('pgrep tunneldigger'):read('*l') ~= read_pid_file() then io.popen('logger -t tunneldigger-watchdog "Process-Pid does not match with pid-File."')