Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
ruanhaishen
Acme.Sh
Commits
8ba7d02f
Unverified
Commit
8ba7d02f
authored
Apr 29, 2022
by
neil
Committed by
GitHub
Apr 29, 2022
Browse files
Merge pull request #4059 from NerLOR/master
dns_world4you: fix _parse_paket_nr
parents
ef8a199a
db83643c
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_world4you.sh
View file @
8ba7d02f
...
...
@@ -54,15 +54,14 @@ dns_world4you_add() {
if
_contains
"
$res
"
"successfully"
;
then
return
0
else
msg
=
$(
echo
"
$res
"
|
tr
'\n'
'\t'
|
sed
's/.*<h3 class="mb-5">[^\t]*\t *\([^\t]*\)\t.*/\1/'
)
if
_contains
"
$msg
"
'^<\!DOCTYPE html>'
;
then
msg
=
'Unknown error'
fi
_err
"Unable to add record:
$msg
"
if
_contains
"
$msg
"
'^<\!DOCTYPE html>'
;
then
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>\|^\s*//g'
)
if
[
"
$msg
"
=
''
]
;
then
_err
"Unable to add record: Unknown error"
echo
"
$ret
"
>
'error-01.html'
echo
"
$res
"
>
'error-02.html'
_err
"View error-01.html and error-02.html for debugging"
else
_err
"Unable to add record: my.world4you.com:
$msg
"
fi
return
1
fi
...
...
@@ -119,15 +118,14 @@ dns_world4you_rm() {
if
_contains
"
$res
"
"successfully"
;
then
return
0
else
msg
=
$(
echo
"
$res
"
|
tr
'\n'
'\t'
|
sed
's/.*<h3 class="mb-5">[^\t]*\t *\([^\t]*\)\t.*/\1/'
)
if
_contains
"
$msg
"
'^<\!DOCTYPE html>'
;
then
msg
=
'Unknown error'
fi
_err
"Unable to remove record:
$msg
"
if
_contains
"
$msg
"
'^<\!DOCTYPE html>'
;
then
msg
=
$(
echo
"
$res
"
|
grep
-A
15
'data-type="danger"'
|
grep
"<h3[^>]*>[^<]"
|
sed
's/<[^>]*>\|^\s*//g'
)
if
[
"
$msg
"
=
''
]
;
then
_err
"Unable to remove record: Unknown error"
echo
"
$ret
"
>
'error-01.html'
echo
"
$res
"
>
'error-02.html'
_err
"View error-01.html and error-02.html for debugging"
else
_err
"Unable to remove record: my.world4you.com:
$msg
"
fi
return
1
fi
...
...
@@ -199,6 +197,6 @@ _get_paketnr() {
TLD
=
"
$domain
"
_debug domain
"
$domain
"
RECORD
=
$(
echo
"
$fqdn
"
|
cut
-c
"1-
$((${#
fqdn
}
-
${#
TLD
}
-
1
))
"
)
PAKETNR
=
$(
echo
"
$form
"
|
grep
"data-textfilter=
\"
.*
$domain
"
| _
head
_n 1 |
sed
's/^.* \([0-9]*\) .*$/\1/'
)
PAKETNR
=
$(
echo
"
$form
"
|
grep
"data-textfilter=
\"
.*
$domain
"
| _
tail
_n 1 |
sed
"s|.*
$WORLD4YOU_API
/
\\
([0-9]*
\\
)/.*|
\\
1|"
)
return
0
}
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