Added "%" as a field separator

Added "%" as a field separator in the conversion from resolv.conf to resolvers.conf.
This will remove the zone index of link-local addresses, which used to cause an error from nginx (#1015).
This will fix the issue #1015
This commit is contained in:
JonasVgt 2021-04-26 20:19:43 +02:00 committed by GitHub
parent 1a64d44857
commit 75062bcf84
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -24,7 +24,7 @@ chown root /tmp/nginx
# Dynamically generate resolvers file, if resolver is IPv6, enclose in `[]`
# thanks @tfmm
echo resolver "$(awk 'BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf
echo resolver "$(awk -F'[ %]''BEGIN{ORS=" "} $1=="nameserver" {print ($2 ~ ":")? "["$2"]": $2}' /etc/resolv.conf);" > /etc/nginx/conf.d/include/resolvers.conf
# Generate dummy self-signed certificate.
if [ ! -f /data/nginx/dummycert.pem ] || [ ! -f /data/nginx/dummykey.pem ]