Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
bda454fe
Unverified
Commit
bda454fe
authored
Jan 11, 2022
by
I Komang Suryadana
Committed by
GitHub
Jan 11, 2022
Browse files
Remove cloud domain record with cloud master zone. (#3507)
parent
856e7705
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_cloudns.sh
View file @
bda454fe
...
...
@@ -2,11 +2,14 @@
# Author: Boyan Peychev <boyan at cloudns dot net>
# Repository: https://github.com/ClouDNS/acme.sh/
# Editor: I Komang Suryadana
#CLOUDNS_AUTH_ID=XXXXX
#CLOUDNS_SUB_AUTH_ID=XXXXX
#CLOUDNS_AUTH_PASSWORD="YYYYYYYYY"
CLOUDNS_API
=
"https://api.cloudns.net"
DOMAIN_TYPE
=
DOMAIN_MASTER
=
######## Public functions #####################
...
...
@@ -61,6 +64,15 @@ dns_cloudns_rm() {
host
=
"
$(
echo
"
$1
"
|
sed
"s/
\.
$zone
\$
//"
)
"
record
=
$2
_dns_cloudns_get_zone_info
"
$zone
"
_debug
"Type"
"
$DOMAIN_TYPE
"
_debug
"Cloud Master"
"
$DOMAIN_MASTER
"
if
_contains
"
$DOMAIN_TYPE
"
"cloud"
;
then
zone
=
$DOMAIN_MASTER
fi
_debug
"ZONE"
"
$zone
"
_dns_cloudns_http_api_call
"dns/records.json"
"domain-name=
$zone
&host=
$host
&type=TXT"
if
!
_contains
"
$response
"
"
\"
id
\"
:"
;
then
return
1
...
...
@@ -134,6 +146,18 @@ _dns_cloudns_init_check() {
return
0
}
_dns_cloudns_get_zone_info
()
{
zone
=
$1
_dns_cloudns_http_api_call
"dns/get-zone-info.json"
"domain-name=
$zone
"
if
!
_contains
"
$response
"
"
\"
status
\"
:
\"
Failed
\"
"
;
then
DOMAIN_TYPE
=
$(
echo
"
$response
"
| _egrep_o
'"type":"[^"]*"'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
if
_contains
"
$DOMAIN_TYPE
"
"cloud"
;
then
DOMAIN_MASTER
=
$(
echo
"
$response
"
| _egrep_o
'"cloud-master":"[^"]*"'
|
cut
-d
:
-f
2 |
tr
-d
'"'
)
fi
fi
return
0
}
_dns_cloudns_get_zone_name
()
{
i
=
2
while
true
;
do
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment