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
bc396e7a
Commit
bc396e7a
authored
Oct 06, 2019
by
Vadim Kalinnikov
Browse files
Small fix in dns_vultr.sh
parent
54143ae6
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_vultr.sh
View file @
bc396e7a
#!/
usr/bin/env
sh
#!/
bin/ba
sh
#
#
#VULTR_API_KEY=000011112222333344445555666677778888
#VULTR_API_KEY=000011112222333344445555666677778888
...
@@ -106,9 +106,9 @@ _get_root() {
...
@@ -106,9 +106,9 @@ _get_root() {
domain
=
$1
domain
=
$1
i
=
1
i
=
1
while
true
;
do
while
true
;
do
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
_debug h
"
$
h
"
_debug h
"
$
_domain
"
if
[
-z
"
$
h
"
]
;
then
if
[
-z
"
$
_domain
"
]
;
then
return
1
return
1
fi
fi
...
@@ -119,11 +119,9 @@ _get_root() {
...
@@ -119,11 +119,9 @@ _get_root() {
if
printf
"%s
\n
"
"
$response
"
|
grep
'^\[.*\]'
>
/dev/null
;
then
if
printf
"%s
\n
"
"
$response
"
|
grep
'^\[.*\]'
>
/dev/null
;
then
if
_contains
"
$response
"
"
\"
domain
\"
:
\"
$_domain
\"
"
;
then
if
_contains
"
$response
"
"
\"
domain
\"
:
\"
$_domain
\"
"
;
then
_sub_domain
=
"
$(
echo
"
$fulldomain
"
|
sed
"s/
\\
.
$_domain
\$
//"
)
"
_sub_domain
=
"
$(
echo
"
$fulldomain
"
|
sed
"s/
\\
.
$_domain
\$
//"
)
"
_domain
=
$_domain
return
0
return
0
else
else
_err
'Invalid domain'
_debug
"Go to next level of
$_domain
"
return
1
fi
fi
else
else
_err
"
$response
"
_err
"
$response
"
...
...
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