AdGuardHome/docker/web-bind.awk
Ainar Garipov f553eee842 Pull request 1804: newline-lint
Merge in DNS/adguard-home from newline-lint to master

Squashed commit of the following:

commit 2fc0b662b9ac9d954275c5ebe8c140be4cd365be
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 6 14:16:14 2023 +0300

    client: rm line

commit 10246727179a84094edd17fad5cd6f0a5c38b821
Author: Ainar Garipov <A.Garipov@AdGuard.COM>
Date:   Thu Apr 6 13:51:06 2023 +0300

    all: add newline lint
2023-04-06 14:21:46 +03:00

14 lines
338 B
Awk

# Don't consider the HTTPS hostname since the enforced HTTPS redirection should
# work if the SSL check skipped. See file docker/healthcheck.sh.
/^bind_host:/ { host = $2 }
/^bind_port:/ { port = $2 }
END {
if (match(host, ":")) {
print "http://[" host "]:" port
} else {
print "http://" host ":" port
}
}