Skip to content

Commit

Permalink
fix: remove trailing whitespace from awk output
Browse files Browse the repository at this point in the history
* trailing whitespaces break configs that use quotation marks around
  vars. See nginxinc/docker-nginx-unprivileged#234
  • Loading branch information
lockejan committed Aug 1, 2024
1 parent a6f7d14 commit aa664ca
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion entrypoint/15-local-resolvers.envsh
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,5 @@ PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin

[ "${NGINX_ENTRYPOINT_LOCAL_RESOLVERS:-}" ] || return 0

NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]"} else {print $2}}' /etc/resolv.conf)
NGINX_LOCAL_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]"} else {print $2}}' /etc/resolv.conf | xargs)
export NGINX_LOCAL_RESOLVERS

0 comments on commit aa664ca

Please sign in to comment.