Fix travis errors

This commit is contained in:
Nils Sandmann 2018-03-22 11:13:46 +01:00
parent af5ff2bb93
commit 893917a25d
No known key found for this signature in database
GPG Key ID: 605B8EC396A1D3B9

View File

@ -91,14 +91,12 @@ set_record() {
new_challenge=$3 new_challenge=$3
_pdns_rest "GET" "/api/v1/servers/$PDNS_ServerId/zones/$root" _pdns_rest "GET" "/api/v1/servers/$PDNS_ServerId/zones/$root"
_existing_challenges=($(echo "$response" | _normalizeJson | grep -Po "\"name\":\"$fulldomain\K.*?}]" | grep -Po 'content\":\"\\"\K[^\\]*'))
_record_string="" _record_string=""
_build_record_string $new_challenge _build_record_string "$new_challenge"
_existing_challenges=$(echo "$response" | _normalizeJson | grep -Po "\"name\":\"$fulldomain\\K.*?}]" | grep -Po 'content\":\"\\"\K[^\\]*')
for i in "${_existing_challenges[@]}" for oldchallenge in $_existing_challenges; do
do _record_string="${_record_string}, "
_record_string+=", " _build_record_string "$oldchallenge"
_build_record_string $i
done done
if ! _pdns_rest "PATCH" "/api/v1/servers/$PDNS_ServerId/zones/$root" "{\"rrsets\": [{\"changetype\": \"REPLACE\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $PDNS_Ttl, \"records\": [$_record_string]}]}"; then if ! _pdns_rest "PATCH" "/api/v1/servers/$PDNS_ServerId/zones/$root" "{\"rrsets\": [{\"changetype\": \"REPLACE\", \"name\": \"$full.\", \"type\": \"TXT\", \"ttl\": $PDNS_Ttl, \"records\": [$_record_string]}]}"; then
@ -106,10 +104,6 @@ set_record() {
return 1 return 1
fi fi
if ! notify_slaves "$root"; then
return 1
fi
return 0 return 0
} }
@ -198,5 +192,5 @@ _pdns_rest() {
} }
_build_record_string() { _build_record_string() {
_record_string+="{\"content\": \"\\\"$1\\\"\", \"disabled\": false}" _record_string="${_record_string}{\"content\": \"\\\"$1\\\"\", \"disabled\": false}"
} }