Template
1
0
mirror of https://github.com/bol-van/zapret2.git synced 2026-03-14 06:13:09 +00:00

zapret-auto: separate hostkey function

This commit is contained in:
bol-van
2025-12-14 18:14:42 +03:00
parent f1eae764ab
commit de8845b89d
2 changed files with 41 additions and 10 deletions

View File

@@ -1236,12 +1236,16 @@ function genhost(len, template)
end
end
-- return hostname if present or ip address in text form otherwise
-- return ip addr of target host in text form
function host_ip(desync)
return desync.target.ip and ntop(desync.target.ip) or desync.target.ip6 and ntop(desync.target.ip6)
end
-- return hostname of target host if present or ip address in text form otherwise
function host_or_ip(desync)
if desync.track and desync.track.hostname then
return desync.track.hostname
end
return desync.target.ip and ntop(desync.target.ip) or desync.target.ip6 and ntop(desync.target.ip6)
return host_ip(desync)
end
function is_absolute_path(path)