Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
28b09295
Unverified
Commit
28b09295
authored
Feb 19, 2018
by
neil
Committed by
GitHub
Feb 19, 2018
Browse files
Merge pull request #1283 from justmwa/master
Fixes
parents
d4339262
55787ff7
Changes
2
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_lua.sh
View file @
28b09295
...
@@ -8,7 +8,6 @@
...
@@ -8,7 +8,6 @@
#LUA_Email="user@luadns.net"
#LUA_Email="user@luadns.net"
LUA_Api
=
"https://api.luadns.com/v1"
LUA_Api
=
"https://api.luadns.com/v1"
LUA_auth
=
$(
printf
"%s"
"
$LUA_Email
:
$LUA_Key
"
| _base64
)
######## Public functions #####################
######## Public functions #####################
...
@@ -19,6 +18,8 @@ dns_lua_add() {
...
@@ -19,6 +18,8 @@ dns_lua_add() {
LUA_Key
=
"
${
LUA_Key
:-
$(
_readaccountconf_mutable LUA_Key
)
}
"
LUA_Key
=
"
${
LUA_Key
:-
$(
_readaccountconf_mutable LUA_Key
)
}
"
LUA_Email
=
"
${
LUA_Email
:-
$(
_readaccountconf_mutable LUA_Email
)
}
"
LUA_Email
=
"
${
LUA_Email
:-
$(
_readaccountconf_mutable LUA_Email
)
}
"
LUA_auth
=
$(
printf
"%s"
"
$LUA_Email
:
$LUA_Key
"
| _base64
)
if
[
-z
"
$LUA_Key
"
]
||
[
-z
"
$LUA_Email
"
]
;
then
if
[
-z
"
$LUA_Key
"
]
||
[
-z
"
$LUA_Email
"
]
;
then
LUA_Key
=
""
LUA_Key
=
""
LUA_Email
=
""
LUA_Email
=
""
...
@@ -60,6 +61,7 @@ dns_lua_rm() {
...
@@ -60,6 +61,7 @@ dns_lua_rm() {
LUA_Key
=
"
${
LUA_Key
:-
$(
_readaccountconf_mutable LUA_Key
)
}
"
LUA_Key
=
"
${
LUA_Key
:-
$(
_readaccountconf_mutable LUA_Key
)
}
"
LUA_Email
=
"
${
LUA_Email
:-
$(
_readaccountconf_mutable LUA_Email
)
}
"
LUA_Email
=
"
${
LUA_Email
:-
$(
_readaccountconf_mutable LUA_Email
)
}
"
LUA_auth
=
$(
printf
"%s"
"
$LUA_Email
:
$LUA_Key
"
| _base64
)
_debug
"First detect the root zone"
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
_err
"invalid domain"
...
...
dnsapi/dns_nsone.sh
View file @
28b09295
...
@@ -59,10 +59,10 @@ dns_nsone_add() {
...
@@ -59,10 +59,10 @@ dns_nsone_add() {
_err
"Add txt record error."
_err
"Add txt record error."
else
else
_info
"Updating record"
_info
"Updating record"
re
cord_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
domain
\"
:
\"
$fulldomain
.
\"
,
[^{]*
\"
type
\"
:
\"
TXT
\"
,
\"
id
\"
:
\"
[^,]*
\
"
"
| _head_n 1 |
cut
-d
:
-f
7
|
cut
-d
,
-f1
)
p
re
v_txt
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
domain
\"
:
\"
$fulldomain
\"
,
\"
short_answers
\"
:
\[
\"
[^,]*
\
]
"
| _head_n 1 |
cut
-d
:
-f
3
|
cut
-d
,
-f1
)
_debug
"re
cord_id
"
"
$re
cord_id
"
_debug
"
p
re
v_txt
"
"
$
p
re
v_txt
"
_nsone_rest POST
"zones/
$_domain
/
$fulldomain
/TXT"
"{
\"
answers
\"
: [{
\"
answer
\"
: [
\"
$txtvalue
\"
]}],
\"
type
\"
:
\"
TXT
\"
,
\"
domain
\"
:
\"
$fulldomain
\"
,
\"
zone
\"
:
\"
$_domain
\"
}"
_nsone_rest POST
"zones/
$_domain
/
$fulldomain
/TXT"
"{
\"
answers
\"
: [{
\"
answer
\"
: [
\"
$txtvalue
\"
]}
,{
\"
answer
\"
:
$prev_txt
}
],
\"
type
\"
:
\"
TXT
\"
,
\"
domain
\"
:
\"
$fulldomain
\"
,
\"
zone
\"
:
\"
$_domain
\"
}"
if
[
"
$?
"
=
"0"
]
&&
_contains
"
$response
"
"
$fulldomain
"
;
then
if
[
"
$?
"
=
"0"
]
&&
_contains
"
$response
"
"
$fulldomain
"
;
then
_info
"Updated!"
_info
"Updated!"
#todo: check if the record takes effect
#todo: check if the record takes effect
...
...
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