Put ipv6 resolver address in square brackets

master
Alexander Graf 2 years ago
parent 53de7b7d60
commit 822abc9136
No known key found for this signature in database
GPG Key ID: B8A9DC143E075629

@ -12,7 +12,8 @@ log.basicConfig(stream=sys.stderr, level=args.get("LOG_LEVEL", "WARNING"))
# Get the first DNS server
with open("/etc/resolv.conf") as handle:
content = handle.read().split()
args["RESOLVER"] = content[content.index("nameserver") + 1]
resolver = content[content.index("nameserver") + 1]
args["RESOLVER"] = f"[{resolver}]" if ":" in resolver else resolver
args["ADMIN_ADDRESS"] = system.get_host_address_from_environment("ADMIN", "admin")
args["ANTISPAM_WEBUI_ADDRESS"] = system.get_host_address_from_environment("ANTISPAM_WEBUI", "antispam:11334")

Loading…
Cancel
Save