Browse Source

Update dns_hostup.sh

pull/6655/head
hostup 1 week ago
committed by GitHub
parent
commit
d97b4477b2
No known key found for this signature in database GPG Key ID: B5690EEEBB952194
  1. 6
      dnsapi/dns_hostup.sh

6
dnsapi/dns_hostup.sh

@ -171,7 +171,7 @@ _hostup_detect_zone() {
return 1
fi
_domain_candidate="$(printf "%s" "$fulldomain" | tr 'A-Z' 'a-z')"
_domain_candidate="$(printf "%s" "$fulldomain" | tr '[:upper:]' '[:lower:]')"
_debug "hostup_initial_candidate" "$_domain_candidate"
while [ -n "$_domain_candidate" ]; do
@ -210,7 +210,7 @@ _hostup_record_name() {
suffix=".$zonedomain"
case "$fulldomain" in
*"$suffix")
printf "%s" "${fulldomain%$suffix}"
printf "%s" "${fulldomain%"$suffix"}"
;;
*)
# Domain not within zone, fall back to full host
@ -371,7 +371,7 @@ _hostup_record_key() {
zone_id="$1"
domain="$2"
safe_zone="$(printf "%s" "$zone_id" | sed 's/[^A-Za-z0-9]/_/g')"
safe_domain="$(printf "%s" "$domain" | tr 'A-Z' 'a-z' | sed 's/[^a-z0-9]/_/g')"
safe_domain="$(printf "%s" "$domain" | tr '[:upper:]' '[:lower:]' | sed 's/[^a-z0-9]/_/g')"
printf "%s_%s" "$safe_zone" "$safe_domain"
}

Loading…
Cancel
Save