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
14089f8c
Unverified
Commit
14089f8c
authored
Jul 16, 2020
by
Viktor Szépe
Committed by
GitHub
Jul 16, 2020
Browse files
Fix SC2236
parent
49094120
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_dgon.sh
View file @
14089f8c
...
@@ -122,12 +122,12 @@ dns_dgon_rm() {
...
@@ -122,12 +122,12 @@ dns_dgon_rm() {
## check for what we are looking for: "type":"A","name":"$_sub_domain"
## check for what we are looking for: "type":"A","name":"$_sub_domain"
record
=
"
$(
echo
"
$domain_list
"
| _egrep_o
"
\"
id
\"\s
*
\:\s
*
\"
*[0-9]+
\"
*[^}]*
\"
name
\"\s
*
\:\s
*
\"
$_sub_domain
\"
[^}]*
\"
data
\"\s
*
\:\s
*
\"
$txtvalue
\"
"
)
"
record
=
"
$(
echo
"
$domain_list
"
| _egrep_o
"
\"
id
\"\s
*
\:\s
*
\"
*[0-9]+
\"
*[^}]*
\"
name
\"\s
*
\:\s
*
\"
$_sub_domain
\"
[^}]*
\"
data
\"\s
*
\:\s
*
\"
$txtvalue
\"
"
)
"
if
[
!
-z
"
$record
"
]
;
then
if
[
-n
"
$record
"
]
;
then
## we found records
## we found records
rec_ids
=
"
$(
echo
"
$record
"
| _egrep_o
"id
\"\s
*
\:\s
*
\"
*[0-9]+"
| _egrep_o
"[0-9]+"
)
"
rec_ids
=
"
$(
echo
"
$record
"
| _egrep_o
"id
\"\s
*
\:\s
*
\"
*[0-9]+"
| _egrep_o
"[0-9]+"
)
"
_debug rec_ids
"
$rec_ids
"
_debug rec_ids
"
$rec_ids
"
if
[
!
-z
"
$rec_ids
"
]
;
then
if
[
-n
"
$rec_ids
"
]
;
then
echo
"
$rec_ids
"
|
while
IFS
=
read
-r
rec_id
;
do
echo
"
$rec_ids
"
|
while
IFS
=
read
-r
rec_id
;
do
## delete the record
## delete the record
## delete URL for removing the one we dont want
## delete URL for removing the one we dont want
...
@@ -218,7 +218,7 @@ _get_base_domain() {
...
@@ -218,7 +218,7 @@ _get_base_domain() {
## we got part of a domain back - grep it out
## we got part of a domain back - grep it out
found
=
"
$(
echo
"
$domain_list
"
| _egrep_o
"
\"
name
\"\s
*
\:\s
*
\"
$_domain
\"
"
)
"
found
=
"
$(
echo
"
$domain_list
"
| _egrep_o
"
\"
name
\"\s
*
\:\s
*
\"
$_domain
\"
"
)
"
## check if it exists
## check if it exists
if
[
!
-z
"
$found
"
]
;
then
if
[
-n
"
$found
"
]
;
then
## exists - exit loop returning the parts
## exists - exit loop returning the parts
sub_point
=
$(
_math
$i
- 1
)
sub_point
=
$(
_math
$i
- 1
)
_sub_domain
=
$(
printf
"%s"
"
$fulldomain
"
|
cut
-d
.
-f
1-
"
$sub_point
"
)
_sub_domain
=
$(
printf
"%s"
"
$fulldomain
"
|
cut
-d
.
-f
1-
"
$sub_point
"
)
...
...
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