fix issues

This commit is contained in:
Frank Laszlo 2019-01-24 16:23:28 -05:00
parent f7c933a088
commit 9ac2615acd
4 changed files with 21 additions and 23 deletions

View File

@ -1013,8 +1013,6 @@ acme.sh --issue --dns dns_netcup -d example.com -d www.example.com
The `NC_Apikey`,`NC_Apipw` and `NC_CID` will be saved in `~/.acme.sh/account.conf` and will be reused when needed. The `NC_Apikey`,`NC_Apipw` and `NC_CID` will be saved in `~/.acme.sh/account.conf` and will be reused when needed.
## 52. Use GratisDNS.dk ## 52. Use GratisDNS.dk
GratisDNS.dk (https://gratisdns.dk/) does not provide an API to update DNS records (other than IPv4 and IPv6 GratisDNS.dk (https://gratisdns.dk/) does not provide an API to update DNS records (other than IPv4 and IPv6
dynamic DNS addresses). The acme.sh plugin therefore retrieves and updates domain TXT records by logging dynamic DNS addresses). The acme.sh plugin therefore retrieves and updates domain TXT records by logging
into the GratisDNS website to read the HTML and posting updates as HTTP. The plugin needs to know your into the GratisDNS website to read the HTML and posting updates as HTTP. The plugin needs to know your

View File

@ -41,7 +41,7 @@ dns_fh_add() {
_post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}" _post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}"
if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then
_record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\":\s*[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1) _record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\": *[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1)
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
if [ -z "$_record_id" ]; then if [ -z "$_record_id" ]; then
@ -87,11 +87,11 @@ dns_fh_rm() {
response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")" response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")"
_debug response "${response}" _debug response "${response}"
record="$(echo "${response}" | _egrep_o "{.*\"host\":\s*\"${_sub_domain}\",\s*\"target\":\s*\"${txtvalue}\".*}")" record="$(echo "${response}" | _egrep_o "{.*\"host\": *\"${_sub_domain}\", *\"target\": *\"${txtvalue}\".*}")"
_debug record "${record}" _debug record "${record}"
if [ "${record}" ]; then if [ "${record}" ]; then
_record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_record_id}" ]; then if [ "${_record_id}" ]; then
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
@ -112,7 +112,7 @@ dns_fh_rm() {
_check_fh_api_token() { _check_fh_api_token() {
if [ -z "${FH_API_TOKEN}" ]; then if [ -z "${FH_API_TOKEN}" ]; then
FH_API_TOKEN="${FH_API_TOKEN:-$(_readaccountconf FH_API_TOKEN)}" FH_API_TOKEN="${FH_API_TOKEN:-$(_readaccountconf_mutable FH_API_TOKEN)}"
_err "You have not defined your FH_API_TOKEN." _err "You have not defined your FH_API_TOKEN."
_err "Please create your token and try again." _err "Please create your token and try again."
@ -122,7 +122,7 @@ _check_fh_api_token() {
return 1 return 1
fi fi
_saveaccountconf FH_API_TOKEN "${FH_API_TOKEN}" _saveaccountconf_mutable FH_API_TOKEN "${FH_API_TOKEN}"
} }
_get_root() { _get_root() {
@ -142,9 +142,9 @@ _get_root() {
return 1 return 1
fi fi
hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\":\s*\"${h}\".*}")" hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\": *\"${h}\".*}")"
if [ "${hostedzone}" ]; then if [ "${hostedzone}" ]; then
_zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_zone_id}" ]; then if [ "${_zone_id}" ]; then
_sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p}) _sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p})
_domain="${h}" _domain="${h}"

View File

@ -41,7 +41,7 @@ dns_nexcess_add() {
_post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}" _post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}"
if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then
_record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\":\s*[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1) _record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\": *[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1)
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
if [ -z "$_record_id" ]; then if [ -z "$_record_id" ]; then
@ -87,11 +87,11 @@ dns_nexcess_rm() {
response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")" response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")"
_debug response "${response}" _debug response "${response}"
record="$(echo "${response}" | _egrep_o "{.*\"host\":\s*\"${_sub_domain}\",\s*\"target\":\s*\"${txtvalue}\".*}")" record="$(echo "${response}" | _egrep_o "{.*\"host\": *\"${_sub_domain}\", *\"target\": *\"${txtvalue}\".*}")"
_debug record "${record}" _debug record "${record}"
if [ "${record}" ]; then if [ "${record}" ]; then
_record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_record_id}" ]; then if [ "${_record_id}" ]; then
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
@ -112,7 +112,7 @@ dns_nexcess_rm() {
_check_nexcess_api_token() { _check_nexcess_api_token() {
if [ -z "${NEXCESS_API_TOKEN}" ]; then if [ -z "${NEXCESS_API_TOKEN}" ]; then
NEXCESS_API_TOKEN="${NEXCESS_API_TOKEN:-$(_readaccountconf NEXCESS_API_TOKEN)}" NEXCESS_API_TOKEN="${NEXCESS_API_TOKEN:-$(_readaccountconf_mutable NEXCESS_API_TOKEN)}"
_err "You have not defined your NEXCESS_API_TOKEN." _err "You have not defined your NEXCESS_API_TOKEN."
_err "Please create your token and try again." _err "Please create your token and try again."
@ -122,7 +122,7 @@ _check_nexcess_api_token() {
return 1 return 1
fi fi
_saveaccountconf NEXCESS_API_TOKEN "${NEXCESS_API_TOKEN}" _saveaccountconf_mutable NEXCESS_API_TOKEN "${NEXCESS_API_TOKEN}"
} }
_get_root() { _get_root() {
@ -142,9 +142,9 @@ _get_root() {
return 1 return 1
fi fi
hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\":\s*\"${h}\".*}")" hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\": *\"${h}\".*}")"
if [ "${hostedzone}" ]; then if [ "${hostedzone}" ]; then
_zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_zone_id}" ]; then if [ "${_zone_id}" ]; then
_sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p}) _sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p})
_domain="${h}" _domain="${h}"

View File

@ -41,7 +41,7 @@ dns_thermo_add() {
_post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}" _post_data="{\"zone_id\": \"${_zone_id}\", \"type\": \"TXT\", \"host\": \"${host}\", \"target\": \"${txtvalue}\", \"ttl\": \"300\"}"
if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then if _rest POST "dns-record" "${_post_data}" && [ -n "${response}" ]; then
_record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\":\s*[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1) _record_id=$(printf "%s\n" "${response}" | _egrep_o "\"record_id\": *[0-9]+" | cut -d : -f 2 | tr -d " " | _head_n 1)
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
if [ -z "$_record_id" ]; then if [ -z "$_record_id" ]; then
@ -87,11 +87,11 @@ dns_thermo_rm() {
response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")" response="$(echo "${response}" | tr -d "\n" | sed 's/^\[\(.*\)\]$/\1/' | sed -e 's/{"record_id":/|"record_id":/g' | sed 's/|/&{/g' | tr "|" "\n")"
_debug response "${response}" _debug response "${response}"
record="$(echo "${response}" | _egrep_o "{.*\"host\":\s*\"${_sub_domain}\",\s*\"target\":\s*\"${txtvalue}\".*}")" record="$(echo "${response}" | _egrep_o "{.*\"host\": *\"${_sub_domain}\", *\"target\": *\"${txtvalue}\".*}")"
_debug record "${record}" _debug record "${record}"
if [ "${record}" ]; then if [ "${record}" ]; then
_record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _record_id=$(printf "%s\n" "${record}" | _egrep_o "\"record_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_record_id}" ]; then if [ "${_record_id}" ]; then
_debug _record_id "${_record_id}" _debug _record_id "${_record_id}"
@ -112,7 +112,7 @@ dns_thermo_rm() {
_check_thermo_api_token() { _check_thermo_api_token() {
if [ -z "${THERMO_API_TOKEN}" ]; then if [ -z "${THERMO_API_TOKEN}" ]; then
THERMO_API_TOKEN="${THERMO_API_TOKEN:-$(_readaccountconf THERMO_API_TOKEN)}" THERMO_API_TOKEN="${THERMO_API_TOKEN:-$(_readaccountconf_mutable THERMO_API_TOKEN)}"
_err "You have not defined your THERMO_API_TOKEN." _err "You have not defined your THERMO_API_TOKEN."
_err "Please create your token and try again." _err "Please create your token and try again."
@ -122,7 +122,7 @@ _check_thermo_api_token() {
return 1 return 1
fi fi
_saveaccountconf THERMO_API_TOKEN "${THERMO_API_TOKEN}" _saveaccountconf_mutable THERMO_API_TOKEN "${THERMO_API_TOKEN}"
} }
_get_root() { _get_root() {
@ -142,9 +142,9 @@ _get_root() {
return 1 return 1
fi fi
hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\":\s*\"${h}\".*}")" hostedzone="$(echo "${response}" | _egrep_o "{.*\"domain\": *\"${h}\".*}")"
if [ "${hostedzone}" ]; then if [ "${hostedzone}" ]; then
_zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\":\s*[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ ) _zone_id=$(printf "%s\n" "${hostedzone}" | _egrep_o "\"zone_id\": *[0-9]+" | _head_n 1 | cut -d : -f 2 | tr -d \ )
if [ "${_zone_id}" ]; then if [ "${_zone_id}" ]; then
_sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p}) _sub_domain=$(printf "%s" "${domain}" | cut -d . -f 1-${p})
_domain="${h}" _domain="${h}"