mirror of
https://github.com/acmesh-official/acme.sh.git
synced 2025-05-07 16:34:11 +00:00
Update dns_cpanel.sh
Had to change the zones-list parsing and the record-id parsing to be able to work with our cpanel installation. cPanel Version: 102.0 (build 16) Solved by: https://github.com/acmesh-official/acme.sh/issues/3732#issuecomment-1135114123
This commit is contained in:
parent
e3cd96bf19
commit
7c668d6747
@ -120,7 +120,7 @@ _myget() {
|
|||||||
|
|
||||||
_get_root() {
|
_get_root() {
|
||||||
_myget 'json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzones'
|
_myget 'json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzones'
|
||||||
_domains=$(echo "$_result" | sed 's/.*\(zones.*\[\).*/\1/' | cut -d':' -f2 | sed 's/"//g' | sed 's/{//g')
|
_domains=$(echo "$_result" | grep -oE '"[a-z0-9\.\-]*":\["; cPanel first' | cut -d':' -f1 | sed 's/"//g' | sed 's/{//g')
|
||||||
_debug "_result is: $_result"
|
_debug "_result is: $_result"
|
||||||
_debug "_domains is: $_domains"
|
_debug "_domains is: $_domains"
|
||||||
if [ -z "$_domains" ]; then
|
if [ -z "$_domains" ]; then
|
||||||
@ -146,7 +146,7 @@ _findentry() {
|
|||||||
_debug "In _findentry"
|
_debug "In _findentry"
|
||||||
#returns id of dns entry, if it exists
|
#returns id of dns entry, if it exists
|
||||||
_myget "json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=$_domain"
|
_myget "json-api/cpanel?cpanel_jsonapi_apiversion=2&cpanel_jsonapi_module=ZoneEdit&cpanel_jsonapi_func=fetchzone_records&domain=$_domain"
|
||||||
_id=$(echo "$_result" | sed "s/.*\(line.*$fulldomain.*$txtvalue\).*/\1/" | cut -d ':' -f 2 | cut -d ',' -f 1)
|
_id=$(echo "$_result" | sed -e "s/},{/},\n{/g" | grep "$fulldomain" | grep "$txtvalue" | grep -oE 'line":[0-9]+' | cut -d ':' -f 2)
|
||||||
_debug "_result is: $_result"
|
_debug "_result is: $_result"
|
||||||
_debug "fulldomain. is $fulldomain."
|
_debug "fulldomain. is $fulldomain."
|
||||||
_debug "txtvalue is $txtvalue"
|
_debug "txtvalue is $txtvalue"
|
||||||
|
Loading…
x
Reference in New Issue
Block a user