Tunneldigger-Watchdog: Refractoring, move import to the top
This commit is contained in:
		
							parent
							
								
									31335089a2
								
							
						
					
					
						commit
						021080c094
					
				| @ -1,5 +1,7 @@ | |||||||
| #!/usr/bin/lua | #!/usr/bin/lua | ||||||
| 
 | 
 | ||||||
|  | local uci = require('simple-uci').cursor() | ||||||
|  | 
 | ||||||
| function restart_tunneldigger() | function restart_tunneldigger() | ||||||
| 	io.popen('logger -t tunneldigger-watchdog "Restarting Tunneldigger."') | 	io.popen('logger -t tunneldigger-watchdog "Restarting Tunneldigger."') | ||||||
| 	os.execute('/etc/init.d/tunneldigger restart') | 	os.execute('/etc/init.d/tunneldigger restart') | ||||||
| @ -30,7 +32,6 @@ function has_mesh_vpn_neighbours() | |||||||
| 	return false | 	return false | ||||||
| end | end | ||||||
| 
 | 
 | ||||||
| local uci = require('simple-uci').cursor() |  | ||||||
| if uci:get_bool('tunneldigger', 'mesh_vpn', 'enabled') then | if uci:get_bool('tunneldigger', 'mesh_vpn', 'enabled') then | ||||||
| 	if io.popen('pgrep tunneldigger'):read('*l') ~= read_pid_file() 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."') | 		io.popen('logger -t tunneldigger-watchdog "Process-Pid does not match with pid-File."') | ||||||
|  | |||||||
		Loading…
	
		Reference in New Issue
	
	Block a user