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
374af996
Unverified
Commit
374af996
authored
Sep 08, 2022
by
neil
Committed by
GitHub
Sep 08, 2022
Browse files
Merge pull request #4297 from nosilver4u/dgon_found
add domain alias support for Digital Ocean API
parents
3fc3c02a
dcc9624c
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_dgon.sh
View file @
374af996
...
@@ -192,6 +192,7 @@ _get_base_domain() {
...
@@ -192,6 +192,7 @@ _get_base_domain() {
## get URL for the list of domains
## get URL for the list of domains
## may get: "links":{"pages":{"last":".../v2/domains/DOM/records?page=2","next":".../v2/domains/DOM/records?page=2"}}
## may get: "links":{"pages":{"last":".../v2/domains/DOM/records?page=2","next":".../v2/domains/DOM/records?page=2"}}
DOMURL
=
"https://api.digitalocean.com/v2/domains"
DOMURL
=
"https://api.digitalocean.com/v2/domains"
found
=
""
## while we dont have a matching domain we keep going
## while we dont have a matching domain we keep going
while
[
-z
"
$found
"
]
;
do
while
[
-z
"
$found
"
]
;
do
...
@@ -205,9 +206,7 @@ _get_base_domain() {
...
@@ -205,9 +206,7 @@ _get_base_domain() {
fi
fi
_debug2 domain_list
"
$domain_list
"
_debug2 domain_list
"
$domain_list
"
## for each shortening of our $fulldomain, check if it exists in the $domain_list
i
=
1
## can never start on 1 (aka whole $fulldomain) as $fulldomain starts with "_acme-challenge"
i
=
2
while
[
$i
-gt
0
]
;
do
while
[
$i
-gt
0
]
;
do
## get next longest domain
## get next longest domain
_domain
=
$(
printf
"%s"
"
$fulldomain
"
|
cut
-d
.
-f
"
$i
"
-
"
$MAX_DOM
"
)
_domain
=
$(
printf
"%s"
"
$fulldomain
"
|
cut
-d
.
-f
"
$i
"
-
"
$MAX_DOM
"
)
...
...
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