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
831b95f1
Commit
831b95f1
authored
Jan 03, 2017
by
Paul Koppen
Committed by
GitHub
Jan 03, 2017
Browse files
Merge suggested improvements.
* Use `_head_n`. * Add link to GitHub repo for bug reporting.
parent
331b599a
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_ad.sh
View file @
831b95f1
...
@@ -4,6 +4,9 @@
...
@@ -4,6 +4,9 @@
#AD_API_KEY="sdfsdfsdfljlbjkljlkjsdfoiwje"
#AD_API_KEY="sdfsdfsdfljlbjkljlkjsdfoiwje"
#This is the Alwaysdata api wrapper for acme.sh
#This is the Alwaysdata api wrapper for acme.sh
#
#Author: Paul Koppen
#Report Bugs here: https://github.com/wpk-/acme.sh
AD_API_URL
=
"https://
$AD_API_KEY
:@api.alwaysdata.com/v1"
AD_API_URL
=
"https://
$AD_API_KEY
:@api.alwaysdata.com/v1"
...
@@ -60,7 +63,7 @@ dns_ad_rm() {
...
@@ -60,7 +63,7 @@ dns_ad_rm() {
_ad_rest GET
"record/?domain=
$_domain_id
&name=
$_sub_domain
"
_ad_rest GET
"record/?domain=
$_domain_id
&name=
$_sub_domain
"
if
[
-n
"
$response
"
]
;
then
if
[
-n
"
$response
"
]
;
then
record_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
|
cut
-d
:
-f
2 |
tr
-d
\
|
head
-
n
1
)
record_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
|
cut
-d
:
-f
2 |
tr
-d
\
|
_
head
_
n 1
)
_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."
...
@@ -100,7 +103,7 @@ _get_root() {
...
@@ -100,7 +103,7 @@ _get_root() {
hostedzone
=
"
$(
echo
"
$response
"
| _egrep_o
"{.*
\"
name
\"
:
\s
*
\"
$h
\"
.*}"
)
"
hostedzone
=
"
$(
echo
"
$response
"
| _egrep_o
"{.*
\"
name
\"
:
\s
*
\"
$h
\"
.*}"
)
"
if
[
"
$hostedzone
"
]
;
then
if
[
"
$hostedzone
"
]
;
then
_domain_id
=
$(
printf
"%s
\n
"
"
$hostedzone
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
|
head
-
n
1 |
cut
-d
:
-f
2 |
tr
-d
\
)
_domain_id
=
$(
printf
"%s
\n
"
"
$hostedzone
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
|
_
head
_
n 1 |
cut
-d
:
-f
2 |
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