mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-10 14:12:43 +00:00
Incorporated changes after code analasys.
This commit is contained in:
parent
fb5b41a4fc
commit
17fb247086
@ -192,7 +192,8 @@ _dns_cpaneldns_http_api_call() {
|
|||||||
data="&$method&$2"
|
data="&$method&$2"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
export _H1="Authorization: Basic $(printf %s "$CPANELDNS_AUTH_ID:$CPANELDNS_AUTH_PASSWORD" | _base64)"
|
basicauth="$(printf %s "$CPANELDNS_AUTH_ID:$CPANELDNS_AUTH_PASSWORD" | _base64)"
|
||||||
|
export _H1="Authorization: Basic $basicauth)"
|
||||||
|
|
||||||
response="$(_get "$CPANELDNS_API/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2$data")"
|
response="$(_get "$CPANELDNS_API/json-api/cpanel?cpanel_jsonapi_user=user&cpanel_jsonapi_apiversion=2$data")"
|
||||||
_debug response "$response"
|
_debug response "$response"
|
||||||
@ -215,8 +216,7 @@ _dns_cpaneldns_get_record() {
|
|||||||
return 1
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if $response;
|
if $response; then
|
||||||
then
|
|
||||||
recordlist="$(echo "$response" | tr '{' "\n" | grep "$record" | _head_n 1 )"
|
recordlist="$(echo "$response" | tr '{' "\n" | grep "$record" | _head_n 1 )"
|
||||||
record_id="$(echo "$recordlist" | tr ',' "\n" | grep -E '^"line"' | sed -re 's/^\"line\"\:\"([0-9]+)\"$/\1/g' | cut -d ":" -f 2)"
|
record_id="$(echo "$recordlist" | tr ',' "\n" | grep -E '^"line"' | sed -re 's/^\"line\"\:\"([0-9]+)\"$/\1/g' | cut -d ":" -f 2)"
|
||||||
echo "$record_id"
|
echo "$record_id"
|
||||||
@ -224,5 +224,5 @@ _dns_cpaneldns_get_record() {
|
|||||||
_debug record_id "$record_id"
|
_debug record_id "$record_id"
|
||||||
|
|
||||||
return 0
|
return 0
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user