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
f4ad42bb
Commit
f4ad42bb
authored
Dec 04, 2018
by
Adrian Almenar
Browse files
Changes requested on commit review
parent
fb08b53f
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_neodigit.sh
View file @
f4ad42bb
...
@@ -17,7 +17,7 @@ dns_neodigit_add() {
...
@@ -17,7 +17,7 @@ dns_neodigit_add() {
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
NEODIGIT_API_TOKEN
=
"
$
{
NEODIGIT_API_TOKEN
:-
$
(
_readaccountconf_mutable NEODIGIT_API_TOKEN
)
}
"
NEODIGIT_API_TOKEN
=
"
$(
_readaccountconf_mutable NEODIGIT_API_TOKEN
)
}"
if
[
-z
"
$NEODIGIT_API_TOKEN
"
]
;
then
if
[
-z
"
$NEODIGIT_API_TOKEN
"
]
;
then
NEODIGIT_API_TOKEN
=
""
NEODIGIT_API_TOKEN
=
""
_err
"You haven't specified a Token api key."
_err
"You haven't specified a Token api key."
...
@@ -73,7 +73,7 @@ dns_neodigit_rm() {
...
@@ -73,7 +73,7 @@ dns_neodigit_rm() {
fulldomain
=
$1
fulldomain
=
$1
txtvalue
=
$2
txtvalue
=
$2
NEODIGIT_API_TOKEN
=
"
$
{
NEODIGIT_API_TOKEN
:-
$
(
_readaccountconf_mutable NEODIGIT_API_TOKEN
)
}
"
NEODIGIT_API_TOKEN
=
"
$(
_readaccountconf_mutable NEODIGIT_API_TOKEN
)
}"
if
[
-z
"
$NEODIGIT_API_TOKEN
"
]
;
then
if
[
-z
"
$NEODIGIT_API_TOKEN
"
]
;
then
NEODIGIT_API_TOKEN
=
""
NEODIGIT_API_TOKEN
=
""
_err
"You haven't specified a Token api key."
_err
"You haven't specified a Token api key."
...
@@ -102,7 +102,7 @@ dns_neodigit_rm() {
...
@@ -102,7 +102,7 @@ dns_neodigit_rm() {
return
1
return
1
fi
fi
record_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
| _head_n 1 |
cut
-d
:
-f2
|
cut
-d
,
-f1
)
record_id
=
$(
echo
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
| _head_n 1 |
cut
-d
:
-f2
|
cut
-d
,
-f1
)
_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."
...
@@ -140,7 +140,7 @@ _get_root() {
...
@@ -140,7 +140,7 @@ _get_root() {
_debug p
"
$p
"
_debug p
"
$p
"
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
>
/dev/null
;
then
if
_contains
"
$response
"
"
\"
name
\"
:
\"
$h
\"
"
>
/dev/null
;
then
_domain_id
=
$(
printf
"%s
\n
"
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
| _head_n 1 |
cut
-d
:
-f2
|
cut
-d
,
-f1
)
_domain_id
=
$(
echo
"
$response
"
| _egrep_o
"
\"
id
\"
:
\s
*[0-9]+"
| _head_n 1 |
cut
-d
:
-f2
|
cut
-d
,
-f1
)
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