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
8d3ad3a8
Commit
8d3ad3a8
authored
Sep 23, 2021
by
Tom Cocca
Browse files
Rackspace changed their API response, fixed the sed matching
parent
35e22703
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_rackspace.sh
View file @
8d3ad3a8
...
...
@@ -7,6 +7,7 @@
RACKSPACE_Endpoint
=
"https://dns.api.rackspacecloud.com/v1.0"
# 20210923 - RS changed the fields in the API response; fix sed
# 20190213 - The name & id fields swapped in the API response; fix sed
# 20190101 - Duplicating file for new pull request to dev branch
# Original - tcocca:rackspace_dnsapi https://github.com/acmesh-official/acme.sh/pull/1297
...
...
@@ -79,8 +80,8 @@ _get_root_zone() {
_debug2 response
"
$response
"
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
>
/dev/null
;
then
# Response looks like:
# {"
ttl":300
,"accountId":
12345,"id":
1111111,"name":"example.com","emailAddress": ...<and so on>
_domain_id
=
$(
echo
"
$response
"
|
sed
-n
"s/^.*
\"
id
\"
:
\(
[^,]*
\)
,
\"
name
\"
:
\"
$h
\"
,.*/
\1
/p"
)
# {"
id": "12345"
,"accountId":
"
1111111
"
,"name":
"example.com","
ttl": 3600,"
emailAddress": ...<and so on>
_domain_id
=
$(
echo
"
$response
"
|
sed
-n
"s/^.*
\"
id
\"
:
\
"\
(
[^,]*
\)
\"
,
\"
accountId
\"
:
\"
[0-9]*
\"
,
\"
name
\"
:
\"
$h
\"
,.*/
\1
/p"
)
_debug2 domain_id
"
$_domain_id
"
if
[
-n
"
$_domain_id
"
]
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
...
...
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