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
8e64329d
Commit
8e64329d
authored
Nov 18, 2020
by
jakelamotta
Browse files
Fix CI-errors
parent
42847775
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_simply.sh
View file @
8e64329d
...
...
@@ -7,7 +7,7 @@
#
#SIMPLY_Api="https://api.simply.com/1/[ACCOUNTNAME]/[APIKEY]"
SIMPLY_Api
=
"https://api.simply.com/1"
SIMPLY_Api
_Default
=
"https://api.simply.com/1"
######## Public functions #####################
#Usage: add _acme-challenge.www.domain.com "XKrxpRBosdIKFzxW_CT3KLZNf6q0HG9i01zxXp5CPBs"
...
...
@@ -22,6 +22,7 @@ dns_simply_add() {
_simply_save_config
_debug
"First detect the root zone"
if
!
_get_root
"
$fulldomain
"
;
then
_err
"invalid domain"
return
1
...
...
@@ -69,23 +70,28 @@ dns_simply_rm() {
fi
records
=
$(
echo
"
$response
"
|
tr
'{'
"
\n
"
|
grep
'record_id\|type\|data\|\name'
|
sed
's/\"record_id/;\"record_id/'
)
record_array
=(
`
echo
$records
|tr
-d
' '
|
tr
';'
' '
`
)
record_array
=
$(
echo
$records
|tr
-d
' '
|
tr
';'
' '
)
nr_of_deleted_records
=
0
_info
"Fetching txt record"
_info
"Fetching txt record.."
for
record
in
$record_array
;
do
_debug record
"
$record
"
for
((
i
=
0
;
i<
=
${#
record_array
[@]
}
;
i++
))
;
do
record_data
=
$(
echo
$record
|
cut
-d
","
-f
3 |
sed
's/"//g'
|
grep
"data"
|
cut
-d
":"
-f
2
)
record_type
=
$(
echo
$record
|
cut
-d
","
-f
4 |
sed
's/"//g'
|
grep
"type"
|
cut
-d
":"
-f
2
)
record
=
"
$
{
record_
array
[
$i
]
}
"
_debug record
"
$record
"
_debug2
record
_data
"
$record_
data
"
_debug
2
record
_type
"
$record
_type
"
if
[
[
"
$record
"
==
*
"
$txtvalue
"
*
&&
"
$record
"
==
*
"TXT"
*
]
]
;
then
if
[
"
$record
_data
"
=
"
$txtvalue
"
]
&&
[
"
$record
_type
"
=
"TXT"
]
;
then
record_id
=
`
echo
$record
|
cut
-d
","
-f
1 |
grep
"record_id"
|
cut
-d
":"
-f
2
`
record_id
=
$(
echo
$record
|
cut
-d
","
-f
1 |
grep
"record_id"
|
cut
-d
":"
-f
2
)
_info
"Deleting record
$record
"
_debug2 record_id
"
$record_id
"
if
[
[
$record_id
-gt
0
]
]
;
then
if
[
"
$record_id
"
-gt
0
]
;
then
if
!
_simply_delete_record
"
$_domain
"
"
$_sub_domain
"
"
$record_id
"
;
then
_err
"Record with id
$record_id
could not be deleted"
...
...
@@ -102,7 +108,7 @@ dns_simply_rm() {
done
if
[
[
$nr_of_deleted_records
-eq
0
]
]
;
then
if
[
"
$nr_of_deleted_records
"
-eq
0
]
;
then
_err
"No record deleted, the DNS record needs to be removed manually."
else
_info
"Deleted
$nr_of_deleted_records
record"
...
...
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