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
ec1f9841
Commit
ec1f9841
authored
Nov 29, 2019
by
Martin Kammerlander
Browse files
Replace grep -A.
parent
e22c5ea8
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_kas.sh
View file @
ec1f9841
...
...
@@ -69,13 +69,13 @@ dns_kas_rm() {
_get_record_name
"
$_fulldomain
"
_get_record_id
# If there is a record_id, delete the entry
# If there is a record_id, delete the entry
if
[
-n
"
$_record_id
"
]
;
then
params
=
"?kas_login=
$KAS_Login
"
params
=
"
$params
&kas_auth_type=
$KAS_Authtype
"
params
=
"
$params
&kas_auth_data=
$KAS_Authdata
"
params
=
"
$params
&kas_action=delete_dns_settings"
# split it into a seperated list, if there where multiples entries made
records
=(
$_record_id
)
for
i
in
"
${
records
[@]
}
"
...
...
@@ -150,7 +150,7 @@ _get_record_id() {
response
=
"
$(
_get
"
$KAS_Api$params
"
)
"
_debug2
"response"
"
$response
"
_record_id
=
"
$(
echo
"
$response
"
|
grep
-A
4
"
$_record_name
"
|
grep
"
record_id
"
|
cut
-
f2
-d
">"
| xargs
)
"
_record_id
=
"
$(
echo
"
$response
"
|
tr
-d
"
\n\r
"
|
sed
"s/=> Array/
\n
=> Array/g"
|
tr
-d
" "
|
tr
'[]'
'<>'
|
grep
"=>
$_record_name
<
"
|
grep
'>TXT<'
|
tr
'<'
'\n'
|
grep
record_id |
cut
-
d
'>'
-f
3
)
"
_debug2 _record_id
"
$_record_id
"
return
0
}
\ No newline at end of file
}
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