Skip to content

Commit

Permalink
Merge branch 'master' into upstream-master
Browse files Browse the repository at this point in the history
  • Loading branch information
cytopia authored Mar 13, 2022
2 parents 14065f1 + 0456a40 commit 8dfb831
Showing 1 changed file with 9 additions and 9 deletions.
18 changes: 9 additions & 9 deletions data/docker-entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -526,9 +526,9 @@ if printenv WILDCARD_DNS >/dev/null 2>&1; then
# com=1.2.3.4[=com]
# de=2.3.4.5
echo "${WILDCARD_DNS}" | sed 's/,/\n/g' | while read -r line ; do
my_dom="$( echo "${line}" | awk -F '=' '{print $1}' | xargs )" # domain
my_add="$( echo "${line}" | awk -F '=' '{print $2}' | xargs )" # IP address
my_rev="$( echo "${line}" | awk -F '=' '{print $3}' | xargs )" # Reverse DNS record
my_dom="$( echo "${line}" | awk -F '=' '{print $1}' | xargs -0 )" # domain
my_add="$( echo "${line}" | awk -F '=' '{print $2}' | xargs -0 )" # IP address
my_rev="$( echo "${line}" | awk -F '=' '{print $3}' | xargs -0 )" # Reverse DNS record
my_cfg="${NAMED_DIR}/devilbox-wildcard_dns.${my_dom}.conf"

# If a CNAME was provided, try to resolve it to an IP address, otherwhise skip it
Expand Down Expand Up @@ -579,9 +579,9 @@ if printenv EXTRA_HOSTS >/dev/null 2>&1 && [ -n "$( printenv EXTRA_HOSTS )" ]; t
# com=1.2.3.4
# de=2.3.4.5
echo "${EXTRA_HOSTS}" | sed 's/,/\n/g' | while read -r line ; do
my_dom="$( echo "${line}" | awk -F '=' '{print $1}' | xargs )" # domain
my_add="$( echo "${line}" | awk -F '=' '{print $2}' | xargs )" # IP address
my_rev="$( echo "${line}" | awk -F '=' '{print $3}' | xargs )" # Reverse DNS record
my_dom="$( echo "${line}" | awk -F '=' '{print $1}' | xargs -0 )" # domain
my_add="$( echo "${line}" | awk -F '=' '{print $2}' | xargs -0 )" # IP address
my_rev="$( echo "${line}" | awk -F '=' '{print $3}' | xargs -0 )" # Reverse DNS record
my_cfg="${NAMED_DIR}/devilbox-extra_hosts.${my_dom}.conf"

# If a CNAME was provided, try to resolve it to an IP address, otherwhise skip it
Expand Down Expand Up @@ -637,7 +637,7 @@ else
# x.x.x.x\n
# y.y.y.y\n
while read -r ip ; do
ip="$( echo "${ip}" | xargs )"
ip="$( echo "${ip}" | xargs -0 )"

if ! is_ipv4_or_mask "${ip}" && ! is_address_match_list "${ip}"; then
log "err" "ALLOW_QUERY error: not a valid IPv4 address with optional mask: ${ip}" "${DEBUG_ENTRYPOINT}"
Expand Down Expand Up @@ -677,7 +677,7 @@ else
# x.x.x.x\n
# y.y.y.y\n
while read -r ip ; do
ip="$( echo "${ip}" | xargs )"
ip="$( echo "${ip}" | xargs -0 )"

if ! is_ipv4_or_mask "${ip}" && ! is_address_match_list "${ip}"; then
log "err" "ALLOW_RECURSION error: not a valid IPv4 address with optional mask: ${ip}" "${DEBUG_ENTRYPOINT}"
Expand Down Expand Up @@ -744,7 +744,7 @@ else
# x.x.x.x\n
# y.y.y.y\n
while read -r ip ; do
ip="$( echo "${ip}" | xargs )"
ip="$( echo "${ip}" | xargs -0 )"

if ! is_ip4 "${ip}"; then
log "err" "DNS_FORWARDER error: not a valid IP address: ${ip}" "${DEBUG_ENTRYPOINT}"
Expand Down

0 comments on commit 8dfb831

Please sign in to comment.