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
ad9f488d
Commit
ad9f488d
authored
Apr 29, 2020
by
neil
Browse files
fix
https://github.com/acmesh-official/acme.sh/issues/2888
parent
b19799bc
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_cf.sh
View file @
ad9f488d
...
@@ -115,12 +115,12 @@ dns_cf_rm() {
...
@@ -115,12 +115,12 @@ dns_cf_rm() {
return
1
return
1
fi
fi
count
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
count
\"
:[^,]*"
|
cut
-d
:
-f
2
)
count
=
$(
echo
"
$response
"
| _egrep_o
"
\"
count
\"
:
*
[^,]*"
|
cut
-d
:
-f
2
|
tr
-d
" "
)
_debug count
"
$count
"
_debug count
"
$count
"
if
[
"
$count
"
=
"0"
]
;
then
if
[
"
$count
"
=
"0"
]
;
then
_info
"Don't need to remove."
_info
"Don't need to remove."
else
else
record_id
=
$(
echo
"
$response
"
| _egrep_o
"
\"
id
\"
: *
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
| _head_n 1
)
record_id
=
$(
echo
"
$response
"
| _egrep_o
"
\"
id
\"
: *
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
| _head_n 1
|
tr
-d
" "
)
_debug
"record_id"
"
$record_id
"
_debug
"record_id"
"
$record_id
"
if
[
-z
"
$record_id
"
]
;
then
if
[
-z
"
$record_id
"
]
;
then
_err
"Can not get record id to remove."
_err
"Can not get record id to remove."
...
@@ -152,7 +152,7 @@ _get_root() {
...
@@ -152,7 +152,7 @@ _get_root() {
return
1
return
1
else
else
if
_contains
"
$response
"
'"success":true'
;
then
if
_contains
"
$response
"
'"success":true'
;
then
_domain
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
name
\"
:
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
head
-
n
1
)
_domain
=
$(
echo
"
$response
"
| _egrep_o
"
\"
name
\"
:
*
\"
[^
\"
]*
\"
"
|
cut
-d
:
-f
2 |
tr
-d
\"
|
_
head
_
n 1
|
tr
-d
" "
)
if
[
"
$_domain
"
]
;
then
if
[
"
$_domain
"
]
;
then
_cutlength
=
$((${#
domain
}
-
${#
_domain
}
-
1
))
_cutlength
=
$((${#
domain
}
-
${#
_domain
}
-
1
))
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-c
"1-
$_cutlength
"
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-c
"1-
$_cutlength
"
)
...
@@ -186,7 +186,7 @@ _get_root() {
...
@@ -186,7 +186,7 @@ _get_root() {
fi
fi
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
||
_contains
"
$response
"
'"total_count":1'
;
then
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
||
_contains
"
$response
"
'"total_count":1'
;
then
_domain_id
=
$(
echo
"
$response
"
| _egrep_o
"
\[
.
\"
id
\"
:
\"
[^
\"
]*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
\"
)
_domain_id
=
$(
echo
"
$response
"
| _egrep_o
"
\[
.
\"
id
\"
:
*
\"
[^
\"
]*
\"
"
| _head_n 1 |
cut
-d
:
-f
2 |
tr
-d
\"
|
tr
-d
" "
)
if
[
"
$_domain_id
"
]
;
then
if
[
"
$_domain_id
"
]
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
$h
_domain
=
$h
...
...
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