Fix nameserver substitution for IPv6 resolvers (#516)

pull/520/head
Colin Schlueter 2023-02-20 17:49:53 +01:00 zatwierdzone przez GitHub
rodzic 42d6eb6000
commit 6fb9a5ea96
Nie znaleziono w bazie danych klucza dla tego podpisu
ID klucza GPG: 4AEE18F83AFDEB23
1 zmienionych plików z 2 dodań i 1 usunięć

Wyświetl plik

@ -1,8 +1,9 @@
#!/bin/bash
# Set up cache size and nameserver subs
# Nameservers are taken from /etc/resolv.conf - if the IP contains ":", it's IPv6 and must be enclosed in [] for nginx
CACHE_SIZE="${TAKAHE_NGINX_CACHE_SIZE:-1g}"
NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print $2}' | tr '\n' ' '`
NAMESERVER=`cat /etc/resolv.conf | grep "nameserver" | awk '{print ($2 ~ ":") ? "["$2"]" : $2}' | tr '\n' ' '`
if [ -z "$NAMESERVER" ]; then
NAMESERVER="9.9.9.9 149.112.112.112"
fi