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
a32b9554
Unverified
Commit
a32b9554
authored
Oct 30, 2019
by
stilez
Committed by
GitHub
Oct 30, 2019
Browse files
[[:space:]] -> " "
parent
2422e0b4
Changes
1
Hide whitespace changes
Inline
Side-by-side
dnsapi/dns_pleskxml.sh
View file @
a32b9554
...
@@ -215,7 +215,7 @@ _countdots() {
...
@@ -215,7 +215,7 @@ _countdots() {
# $3 - regex to recognise useful return lines
# $3 - regex to recognise useful return lines
_api_response_split
()
{
_api_response_split
()
{
printf
'%s'
"
$1
"
\
printf
'%s'
"
$1
"
\
|
sed
-r
's/(^
[[:space:]]+|[[:space:]]
+$)//g'
\
|
sed
-r
's/(^
+|
+$)//g'
\
|
tr
-d
'\n\r'
\
|
tr
-d
'\n\r'
\
|
sed
-r
"s/<
\/
?
$2
>/
${
NEWLINE
}
/g"
\
|
sed
-r
"s/<
\/
?
$2
>/
${
NEWLINE
}
/g"
\
| egrep
"
$3
"
| egrep
"
$3
"
...
@@ -241,15 +241,15 @@ _call_api() {
...
@@ -241,15 +241,15 @@ _call_api() {
# Detect any <status> that isn't "ok". None of the used calls should fail if the API is working correctly.
# Detect any <status> that isn't "ok". None of the used calls should fail if the API is working correctly.
# Also detect if there simply aren't any status lines (null result?) and report that, as well.
# Also detect if there simply aren't any status lines (null result?) and report that, as well.
statuslines
=
"
$(
echo
"
$pleskxml_prettyprint_result
"
| egrep
'^
[[:space:]]
*<status>[^<]*</status>
[[:space:]]
*$'
)
"
statuslines
=
"
$(
echo
"
$pleskxml_prettyprint_result
"
| egrep
'^
*<status>[^<]*</status>
*$'
)
"
if
_value
"
$statuslines
"
|
grep
-qv
'<status>ok</status>'
;
then
if
_value
"
$statuslines
"
|
grep
-qv
'<status>ok</status>'
;
then
# We have some status lines that aren't "ok". Get the details
# We have some status lines that aren't "ok". Get the details
errtext
=
"
$(
_value
"
$pleskxml_prettyprint_result
"
\
errtext
=
"
$(
_value
"
$pleskxml_prettyprint_result
"
\
| egrep
"(<status>|<errcode>|<errtext>)"
\
| egrep
"(<status>|<errcode>|<errtext>)"
\
|
sed
-r
's/^<(status|errcode|errtext)>/\1: /'
\
|
sed
-r
's/^
*
<(status|errcode|errtext)>/\1: /'
\
|
sed
-r
's/
(^[[:space:]]+|
<\/(status|errcode|errtext)>$
)
//g'
|
sed
-r
's/<\/(status|errcode|errtext)>$//g'
)
"
)
"
elif
!
_value
"
$statuslines
"
|
grep
-q
'<status>ok</status>'
;
then
elif
!
_value
"
$statuslines
"
|
grep
-q
'<status>ok</status>'
;
then
...
...
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