Tunneldigger-Watchdog: Refractoring function has_mesh_vpn_neighbours()

This commit is contained in:
Matthias P. Walther 2019-06-04 12:34:10 +02:00
parent f206b7c79f
commit 31335089a2
No known key found for this signature in database
GPG Key ID: 16BA5AB30324A4AE

View File

@ -17,12 +17,13 @@ end
function has_mesh_vpn_neighbours() function has_mesh_vpn_neighbours()
local handle = io.popen('batctl o', 'r') local handle = io.popen('batctl o', 'r')
if handle then if not handle then
for line in handle:lines() do return false
if line:find('mesh%-vpn') then end
handle:close() for line in handle:lines() do
return true if line:find('mesh%-vpn') then
end handle:close()
return true
end end
end end
handle:close() handle:close()