-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: new NGINX_RESOLVERS, NGINX_RESOLVER_VALID env config (#97)
- Loading branch information
Showing
5 changed files
with
22 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/sh | ||
|
||
# if $NGINX_RESOLVERS set to local, set it to the local resolvers from /etc/resolv.conf and export it | ||
|
||
set -eu | ||
|
||
LC_ALL=C | ||
PATH=/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin | ||
|
||
# if $NGINX_RESOLVERS is not set to local, do nothing | ||
[ "${NGINX_RESOLVERS}" == local ] || return 0 | ||
|
||
NGINX_RESOLVERS=$(awk 'BEGIN{ORS=" "} $1=="nameserver" {if ($2 ~ ":") {print "["$2"]"} else {print $2}}' /etc/resolv.conf) | ||
|
||
# remove trailing space | ||
NGINX_RESOLVERS="${NGINX_RESOLVERS% }" | ||
|
||
export NGINX_RESOLVERS |
File renamed without changes.
File renamed without changes.