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
d1d2f6f4
Commit
d1d2f6f4
authored
Dec 05, 2016
by
Stefan Seidel
Browse files
avoid temp file for domain list
parent
743f821f
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_do.sh
View file @
d1d2f6f4
...
...
@@ -115,9 +115,11 @@ _get_root() {
domain
=
$1
i
=
1
_all_domains
=
"
$(
_mktemp
)
"
_dns_do_soap getDomainList
echo
"
${
response
}
"
|
tr
-d
"
\n\r\t
"
| _egrep_o
'domain</key><value[^>]+>[^<]+'
|
sed
-e
's/^domain<\/key><value[^>]+>//g'
>
"
${
_all_domains
}
"
_all_domains
=
"/
$(
echo
"
${
response
}
"
\
|
tr
-d
"
\n\r\t
"
\
| _egrep_o
'domain</key><value[^>]+>[^<]+'
\
|
sed
-e
's/^domain<\/key><value[^>]*>//g'
)
"
while
true
;
do
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
...
...
@@ -125,7 +127,7 @@ _get_root() {
return
1
fi
if
grep
-q
"
$(
_regexcape
"
$h
"
)
"
"
${
_all_domains
}
"
;
then
if
_contains
"
${
_all_domains
}
"
"
^
$(
_regexcape
"
$h
"
)
\$
"
;
then
_domain
=
"
$h
"
return
0
fi
...
...
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