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
1ef7fd36
Commit
1ef7fd36
authored
Jun 05, 2019
by
Dominic Jonas
Browse files
support to delete multiple entries
parent
68f66ca1
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_kas.sh
View file @
1ef7fd36
...
@@ -75,21 +75,27 @@ dns_kas_rm() {
...
@@ -75,21 +75,27 @@ dns_kas_rm() {
params
=
"
$params
&kas_auth_type=
$KAS_Authtype
"
params
=
"
$params
&kas_auth_type=
$KAS_Authtype
"
params
=
"
$params
&kas_auth_data=
$KAS_Authdata
"
params
=
"
$params
&kas_auth_data=
$KAS_Authdata
"
params
=
"
$params
&kas_action=delete_dns_settings"
params
=
"
$params
&kas_action=delete_dns_settings"
params
=
"
$params
&var1=record_id"
params
=
"
$params
&wert1=
$_record_id
"
# split it into a seperated list, if there where multiples entries made
records
=(
$_record_id
)
for
i
in
"
${
records
[@]
}
"
do
params2
=
"
$params
&var1=record_id"
params2
=
"
$params2
&wert1=
$i
"
_debug2
"Wait for 10 seconds by default before calling KAS API."
_debug2
"Wait for 10 seconds by default before calling KAS API."
sleep
10
sleep
10
response
=
"
$(
_get
"
$KAS_Api$params
"
)
"
response
=
"
$(
_get
"
$KAS_Api$params
2
"
)
"
_debug2
"response"
"
$response
"
_debug2
"response"
"
$response
"
if
!
_contains
"
$response
"
"TRUE"
;
then
if
!
_contains
"
$response
"
"TRUE"
;
then
_err
"Either the txt record is not found or another error occurred, please check manually."
_err
"Either the txt record is not found or another error occurred, please check manually."
return
1
return
1
fi
fi
done
else
# Cannot delete or unkown error
else
# Cannot delete or unkown error
_err
"No record_id found that can be deleted. Please check manually."
_err
"No record_id found that can be deleted. Please check manually."
return
1
return
1
fi
fi
return
0
return
0
}
}
########################## PRIVATE FUNCTIONS ###########################
########################## PRIVATE FUNCTIONS ###########################
...
...
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