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
9683ffe1
Commit
9683ffe1
authored
Feb 28, 2017
by
neilpang
Browse files
minor fix error message
parent
fab2d9dc
Changes
2
Hide whitespace changes
Inline
Side-by-side
dnsapi/README.md
View file @
9683ffe1
...
@@ -338,7 +338,8 @@ acme.sh --issue --dns dns_do -d example.com -d www.example.com
...
@@ -338,7 +338,8 @@ acme.sh --issue --dns dns_do -d example.com -d www.example.com
## 18. Use Gandi LiveDNS API
## 18. Use Gandi LiveDNS API
You will need your Gandi API key (on your Account preferences, go to Security and generate your API key) and export it before you run
`acme.sh`
:
You must enable the new Gandi LiveDNS API first and the create your api key, See: http://doc.livedns.gandi.net/
```
```
export GANDI_LIVEDNS_KEY="fdmlfsdklmfdkmqsdfk"
export GANDI_LIVEDNS_KEY="fdmlfsdklmfdkmqsdfk"
```
```
...
...
dnsapi/dns_gandi_livedns.sh
View file @
9683ffe1
...
@@ -38,7 +38,6 @@ dns_gandi_livedns_add() {
...
@@ -38,7 +38,6 @@ dns_gandi_livedns_add() {
_gandi_livedns_rest PUT
"domains/
$_domain
/records/
$_sub_domain
/TXT"
"{
\"
rrset_ttl
\"
: 300,
\"
rrset_values
\"
:[
\"
$txtvalue
\"
]}"
_gandi_livedns_rest PUT
"domains/
$_domain
/records/
$_sub_domain
/TXT"
"{
\"
rrset_ttl
\"
: 300,
\"
rrset_values
\"
:[
\"
$txtvalue
\"
]}"
return
$?
}
}
#Usage: fulldomain txtvalue
#Usage: fulldomain txtvalue
...
@@ -59,7 +58,6 @@ dns_gandi_livedns_rm() {
...
@@ -59,7 +58,6 @@ dns_gandi_livedns_rm() {
_gandi_livedns_rest DELETE
"domains/
$_domain
/records/
$_sub_domain
/TXT"
""
_gandi_livedns_rest DELETE
"domains/
$_domain
/records/
$_sub_domain
/TXT"
""
return
$?
}
}
#################### Private functions below ##################################
#################### Private functions below ##################################
...
@@ -82,7 +80,10 @@ _get_root() {
...
@@ -82,7 +80,10 @@ _get_root() {
return
1
return
1
fi
fi
if
_contains
"
$response
"
'"code": 404'
;
then
if
_contains
"
$response
"
'"code": 401'
;
then
_err
"
$response
"
return
1
elif
_contains
"
$response
"
'"code": 404'
;
then
_debug
"
$h
not found"
_debug
"
$h
not found"
else
else
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
...
@@ -104,11 +105,11 @@ _gandi_livedns_rest() {
...
@@ -104,11 +105,11 @@ _gandi_livedns_rest() {
export
_H1
=
"Content-Type: application/json"
export
_H1
=
"Content-Type: application/json"
export
_H2
=
"X-Api-Key:
$GANDI_LIVEDNS_KEY
"
export
_H2
=
"X-Api-Key:
$GANDI_LIVEDNS_KEY
"
if
[
"
$data
"
]
||
[
"
$m
"
=
"DELETE"
]
;
then
if
[
"
$m
"
=
"GET"
]
;
then
response
=
"
$(
_get
"
$GANDI_LIVEDNS_API
/
$ep
"
)
"
else
_debug data
"
$data
"
_debug data
"
$data
"
response
=
"
$(
_post
"
$data
"
"
$GANDI_LIVEDNS_API
/
$ep
"
""
"
$m
"
)
"
response
=
"
$(
_post
"
$data
"
"
$GANDI_LIVEDNS_API
/
$ep
"
""
"
$m
"
)
"
else
response
=
"
$(
_get
"
$GANDI_LIVEDNS_API
/
$ep
"
)
"
fi
fi
if
[
"
$?
"
!=
"0"
]
;
then
if
[
"
$?
"
!=
"0"
]
;
then
...
...
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