|
@ -88,25 +88,19 @@ dns_curanet_rm() { |
|
|
response="$(_post "" "$CURANET_REST_URL/${_domain}/Records/$recordid" "" "DELETE")" |
|
|
response="$(_post "" "$CURANET_REST_URL/${_domain}/Records/$recordid" "" "DELETE")" |
|
|
|
|
|
|
|
|
return 0; |
|
|
return 0; |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
#################### Private functions below ################################## |
|
|
#################### Private functions below ################################## |
|
|
|
|
|
|
|
|
gettoken() { |
|
|
gettoken() { |
|
|
|
|
|
|
|
|
response="$(_post "grant_type=client_credentials&client_id=$CURANET_AUTHCLIENTID&client_secret=$CURANET_AUTHSECRET&scope=dns" "$CURANET_AUTH_URL" "" "")" |
|
|
response="$(_post "grant_type=client_credentials&client_id=$CURANET_AUTHCLIENTID&client_secret=$CURANET_AUTHSECRET&scope=dns" "$CURANET_AUTH_URL" "" "")" |
|
|
|
|
|
|
|
|
if ! _contains "$response" "access_token"; then |
|
|
if ! _contains "$response" "access_token"; then |
|
|
_err "Unable get access token" |
|
|
_err "Unable get access token" |
|
|
return 1 |
|
|
return 1 |
|
|
fi |
|
|
fi |
|
|
|
|
|
|
|
|
CURANET_ACCESS_TOKEN=$(echo "$response" | _egrep_o "\"access_token\":\"[^\"]+" | cut -c 17-) |
|
|
CURANET_ACCESS_TOKEN=$(echo "$response" | _egrep_o "\"access_token\":\"[^\"]+" | cut -c 17-) |
|
|
|
|
|
|
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
#_acme-challenge.www.domain.com |
|
|
#_acme-challenge.www.domain.com |
|
|
#returns |
|
|
#returns |
|
|
# _domain=domain.com |
|
|
# _domain=domain.com |
|
@ -137,4 +131,3 @@ _get_root() { |
|
|
done |
|
|
done |
|
|
return 1 |
|
|
return 1 |
|
|
} |
|
|
} |
|
|
|
|
|
|