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
e2accaf7
Commit
e2accaf7
authored
Jul 03, 2017
by
neil
Committed by
GitHub
Jul 03, 2017
Browse files
Merge pull request #925 from raidenii/master
Fix for Name.com API
parents
bb4d3787
7b32bbfc
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_namecom.sh
View file @
e2accaf7
...
@@ -168,21 +168,26 @@ _namecom_get_root() {
...
@@ -168,21 +168,26 @@ _namecom_get_root() {
i
=
2
i
=
2
p
=
1
p
=
1
if
_namecom_rest GET
"domain/list"
;
then
if
!
_namecom_rest GET
"domain/list"
;
then
while
true
;
do
return
1
host
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
if
[
-z
"
$host
"
]
;
then
return
1
fi
if
_contains
"
$response
"
"
$host
"
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
"
$host
"
return
0
fi
p
=
$i
i
=
$(
_math
"
$i
"
+ 1
)
done
fi
fi
# Need to exclude the last field (tld)
numfields
=
$(
echo
"
$domain
"
| _egrep_o
"
\.
"
|
wc
-l
)
while
[
$i
-le
"
$numfields
"
]
;
do
host
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
_debug host
"
$host
"
if
[
-z
"
$host
"
]
;
then
return
1
fi
if
_contains
"
$response
"
"
$host
"
;
then
_sub_domain
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
1-
$p
)
_domain
=
"
$host
"
return
0
fi
p
=
$i
i
=
$(
_math
"
$i
"
+ 1
)
done
return
1
return
1
}
}
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