If address ping fails, also try an arping in case local device blocks pings

This commit is contained in:
Tim Wilkinson 2022-07-26 11:39:45 -07:00 committed by Joe AE6XE
parent e591ffa801
commit d16e9e4f90
1 changed files with 3 additions and 0 deletions

View File

@ -152,6 +152,7 @@ end
-- validation
if validate then
local laniface = aredn.hardware.get_iface_name("lan")
local valid_hosts = {}
-- Add in local names so services checks pass
for _, name in ipairs(names)
@ -163,6 +164,8 @@ if validate then
do
if os.execute("/bin/ping -q -c 1 -W 1 " .. host.ip .. " > /dev/null 2>&1") == 0 then
valid_hosts[host.host:lower()] = host
elseif os.execute("/usr/sbin/arping -q -f -c 1 -w 1 -I " .. laniface .. " " .. host.ip .. " > /dev/null 2>&1") == 0 then
valid_hosts[host.host:lower()] = host
end
end
-- Check all the services have a valid host