fixed formating issues
This commit is contained in:
parent
171fb13d21
commit
c9e42c4d0f
@ -21,7 +21,6 @@ dns_rcode0_add() {
|
|||||||
fulldomain=$1
|
fulldomain=$1
|
||||||
txtvalue=$2
|
txtvalue=$2
|
||||||
|
|
||||||
|
|
||||||
RCODE0_API_TOKEN="${RCODE0_API_TOKEN:-$(_readaccountconf_mutable RCODE0_API_TOKEN)}"
|
RCODE0_API_TOKEN="${RCODE0_API_TOKEN:-$(_readaccountconf_mutable RCODE0_API_TOKEN)}"
|
||||||
RCODE0_URL="${RCODE0_URL:-$(_readaccountconf_mutable RCODE0_URL)}"
|
RCODE0_URL="${RCODE0_URL:-$(_readaccountconf_mutable RCODE0_URL)}"
|
||||||
RCODE0_TTL="${RCODE0_TTL:-$(_readaccountconf_mutable RCODE0_TTL)}"
|
RCODE0_TTL="${RCODE0_TTL:-$(_readaccountconf_mutable RCODE0_TTL)}"
|
||||||
@ -30,7 +29,6 @@ dns_rcode0_add() {
|
|||||||
RCODE0_URL="$DEFAULT_RCODE0_URL"
|
RCODE0_URL="$DEFAULT_RCODE0_URL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$RCODE0_API_TOKEN" ]; then
|
if [ -z "$RCODE0_API_TOKEN" ]; then
|
||||||
RCODE0_API_TOKEN=""
|
RCODE0_API_TOKEN=""
|
||||||
_err "Missing Rcode0 ACME API Token."
|
_err "Missing Rcode0 ACME API Token."
|
||||||
@ -77,7 +75,6 @@ dns_rcode0_rm() {
|
|||||||
RCODE0_URL="$DEFAULT_RCODE0_URL"
|
RCODE0_URL="$DEFAULT_RCODE0_URL"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
if [ -z "$RCODE0_API_TOKEN" ]; then
|
if [ -z "$RCODE0_API_TOKEN" ]; then
|
||||||
RCODE0_API_TOKEN=""
|
RCODE0_API_TOKEN=""
|
||||||
_err "Missing Rcode0 API Token."
|
_err "Missing Rcode0 API Token."
|
||||||
@ -130,14 +127,14 @@ set_record() {
|
|||||||
if [ -z "$_existing_challenges" ]; then
|
if [ -z "$_existing_challenges" ]; then
|
||||||
if ! _rcode0_rest "PATCH" "/api/v1/acme/zones/$root/rrsets" "[{\"changetype\": \"add\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $RCODE0_TTL, \"records\": [$_record_string]}]"; then
|
if ! _rcode0_rest "PATCH" "/api/v1/acme/zones/$root/rrsets" "[{\"changetype\": \"add\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $RCODE0_TTL, \"records\": [$_record_string]}]"; then
|
||||||
_err "Set txt record error."
|
_err "Set txt record error."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
# try update in case a records exists (need for wildcard certs)
|
# try update in case a records exists (need for wildcard certs)
|
||||||
if ! _rcode0_rest "PATCH" "/api/v1/acme/zones/$root/rrsets" "[{\"changetype\": \"update\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $RCODE0_TTL, \"records\": [$_record_string]}]"; then
|
if ! _rcode0_rest "PATCH" "/api/v1/acme/zones/$root/rrsets" "[{\"changetype\": \"update\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $RCODE0_TTL, \"records\": [$_record_string]}]"; then
|
||||||
_err "Set txt record error."
|
_err "Set txt record error."
|
||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if ! notify_slaves "$root"; then
|
if ! notify_slaves "$root"; then
|
||||||
@ -198,11 +195,6 @@ _get_root() {
|
|||||||
domain=$1
|
domain=$1
|
||||||
i=1
|
i=1
|
||||||
|
|
||||||
# if _rcode0_rest "GET" "/api/v1/acme/zones"; then
|
|
||||||
# _zones_response="$response"
|
|
||||||
# fi
|
|
||||||
#
|
|
||||||
# _debug2 "$response"
|
|
||||||
while true; do
|
while true; do
|
||||||
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
h=$(printf "%s" "$domain" | cut -d . -f $i-100)
|
||||||
|
|
||||||
@ -211,7 +203,7 @@ _get_root() {
|
|||||||
if [ "$response" = "[\"found\"]" ]; then
|
if [ "$response" = "[\"found\"]" ]; then
|
||||||
_domain="$h"
|
_domain="$h"
|
||||||
if [ -z "$h" ]; then
|
if [ -z "$h" ]; then
|
||||||
_domain="=2E"
|
_domain="=2E"
|
||||||
fi
|
fi
|
||||||
return 0
|
return 0
|
||||||
elif [ "$response" = "[\"not a master domain\"]" ]; then
|
elif [ "$response" = "[\"not a master domain\"]" ]; then
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user