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
29f12dda
Commit
29f12dda
authored
Jul 10, 2022
by
Lorenz Stechauner
Browse files
dns_world4you: Improve error message handling
Signed-off-by:
Lorenz Stechauner
<
lorenz.stechauner@necronda.net
>
parent
ed15ff05
Changes
1
Show whitespace changes
Inline
Side-by-side
dnsapi/dns_world4you.sh
View file @
29f12dda
...
...
@@ -54,7 +54,7 @@ dns_world4you_add() {
if
_contains
"
$res
"
"successfully"
;
then
return
0
else
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>
\|
^\s*//g'
)
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>
//g'
|
sed
's/
^\s*//g'
)
if
[
"
$msg
"
=
''
]
;
then
_err
"Unable to add record: Unknown error"
echo
"
$ret
"
>
'error-01.html'
...
...
@@ -118,7 +118,7 @@ dns_world4you_rm() {
if
_contains
"
$res
"
"successfully"
;
then
return
0
else
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>
\|
^\s*//g'
)
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>
//g'
|
sed
's/
^\s*//g'
)
if
[
"
$msg
"
=
''
]
;
then
_err
"Unable to remove record: Unknown error"
echo
"
$ret
"
>
'error-01.html'
...
...
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