Browse Source

nsupdate scripts: add support for custom nameserver and zone

pull/513/head
sergio 6 years ago
parent
commit
b869824b49
2 changed files with 12 additions and 8 deletions
  1. +6
    -4
      dns_scripts/dns_add_nsupdate
  2. +6
    -4
      dns_scripts/dns_del_nsupdate

+ 6
- 4
dns_scripts/dns_add_nsupdate View File

@ -21,12 +21,14 @@ if [ -n "${DNS_NSUPDATE_KEYFILE}" ]; then
options="-k ${DNS_NSUPDATE_KEYFILE}"
fi
# Note that blank line is a "send" command to nsupdate
if [ -n "${DNS_SERVER}" ]; then
cmd+="server ${DNS_SERVER}\n"
fi
nsupdate ${options} -v <<EOF
update add _acme-challenge.${fulldomain}. 300 in TXT "${token}"
cmd+="update add ${DNS_ZONE:-"_acme-challenge.${fulldomain}."} 300 in TXT \"${token}\"\n"
cmd+="\n" # blank line is a "send" command to nsupdate
EOF
printf "$cmd" | nsupdate ${options} -v
sts=$?


+ 6
- 4
dns_scripts/dns_del_nsupdate View File

@ -21,12 +21,14 @@ if [ -n "${DNS_NSUPDATE_KEYFILE}" ]; then
options="-k ${DNS_NSUPDATE_KEYFILE}"
fi
# Note that blank line is a "send" command to nsupdate
if [ -n "${DNS_SERVER}" ]; then
cmd+="server ${DNS_SERVER}\n"
fi
nsupdate ${options} -v <<EOF
update delete "_acme-challenge.${fulldomain}." 300 in TXT "${token}"
cmd+="update delete ${DNS_ZONE:-"_acme-challenge.${fulldomain}."} 300 in TXT \"${token}\"\n"
cmd+="\n" # blank line is a "send" command to nsupdate
EOF
printf "$cmd" | nsupdate ${options} -v
sts=$?


Loading…
Cancel
Save