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
8e6cf669
Commit
8e6cf669
authored
Jul 27, 2017
by
Jeremy Knope
Browse files
Try awk instead for \n replacements
parent
d39649f3
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_linode.sh
View file @
8e6cf669
...
@@ -68,8 +68,7 @@ dns_linode_rm() {
...
@@ -68,8 +68,7 @@ dns_linode_rm() {
_parameters
=
"&DomainID=
$_domain_id
"
_parameters
=
"&DomainID=
$_domain_id
"
if
_rest GET
"domain.resource.list"
"
$_parameters
"
&&
[
-n
"
$response
"
]
;
then
if
_rest GET
"domain.resource.list"
"
$_parameters
"
&&
[
-n
"
$response
"
]
;
then
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
|
sed
's/{/\
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
|
awk
'{ gsub("{","\n{",$1); print $1 }'
)
"
&/g'
)
"
resource
=
"
$(
echo
"
$response
"
| _egrep_o
"{.*
\"
NAME
\"
:
\s
*
\"
$_sub_domain
\"
.*}"
)
"
resource
=
"
$(
echo
"
$response
"
| _egrep_o
"{.*
\"
NAME
\"
:
\s
*
\"
$_sub_domain
\"
.*}"
)
"
if
[
"
$resource
"
]
;
then
if
[
"
$resource
"
]
;
then
...
@@ -129,8 +128,7 @@ _get_root() {
...
@@ -129,8 +128,7 @@ _get_root() {
p
=
1
p
=
1
if
_rest GET
"domain.list"
;
then
if
_rest GET
"domain.list"
;
then
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
|
sed
's/{/\
response
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n
"
|
awk
'{ gsub("{","\n{",$1); print $1 }'
)
"
&/g'
)
"
while
true
;
do
while
true
;
do
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
h
=
$(
printf
"%s"
"
$domain
"
|
cut
-d
.
-f
$i
-100
)
_debug h
"
$h
"
_debug h
"
$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