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
e04093ef
Commit
e04093ef
authored
Feb 04, 2024
by
neil
Browse files
remove socket err temp file
parent
bd6bbba9
Changes
1
Hide whitespace changes
Inline
Side-by-side
acme.sh
View file @
e04093ef
...
@@ -2519,19 +2519,19 @@ _startserver() {
...
@@ -2519,19 +2519,19 @@ _startserver() {
_content_len
=
"
$(
printf
"%s"
"
$content
"
|
wc
-c
)
"
_content_len
=
"
$(
printf
"%s"
"
$content
"
|
wc
-c
)
"
_debug _content_len
"
$_content_len
"
_debug _content_len
"
$_content_len
"
_debug
"_NC"
"
$_NC
$SOCAT_OPTIONS
"
_debug
"_NC"
"
$_NC
$SOCAT_OPTIONS
"
_socaterr
=
"
$(
_mktemp
)
"
export
_SOCAT_ERR
=
"
$(
_mktemp
)
"
$_NC
$SOCAT_OPTIONS
SYSTEM:
"sleep 1;
\
$_NC
$SOCAT_OPTIONS
SYSTEM:
"sleep 1;
\
echo 'HTTP/1.0 200 OK';
\
echo 'HTTP/1.0 200 OK';
\
echo 'Content-Length
\:
$_content_len
';
\
echo 'Content-Length
\:
$_content_len
';
\
echo '';
\
echo '';
\
printf '%s' '
$content
';"
2>
"
$_
socaterr
"
&
printf '%s' '
$content
';"
2>
"
$_
SOCAT_ERR
"
&
serverproc
=
"
$!
"
serverproc
=
"
$!
"
if
[
-f
"
$_
socaterr
"
]
;
then
if
[
-f
"
$_
SOCAT_ERR
"
]
;
then
if
grep
"Permission denied"
"
$_
socaterr
"
>
/dev/null
;
then
if
grep
"Permission denied"
"
$_
SOCAT_ERR
"
>
/dev/null
;
then
_err
"socat:
$(
cat
$_
socaterr
)
"
_err
"socat:
$(
cat
$_
SOCAT_ERR
)
"
_err
"Can not listen for user:
$(
whoami
)
"
_err
"Can not listen for user:
$(
whoami
)
"
_err
"Maybe try with root again?"
_err
"Maybe try with root again?"
rm
-f
"
$_
socaterr
"
rm
-f
"
$_
SOCAT_ERR
"
return
1
return
1
fi
fi
fi
fi
...
@@ -2541,10 +2541,12 @@ _stopserver() {
...
@@ -2541,10 +2541,12 @@ _stopserver() {
pid
=
"
$1
"
pid
=
"
$1
"
_debug
"pid"
"
$pid
"
_debug
"pid"
"
$pid
"
if
[
-z
"
$pid
"
]
;
then
if
[
-z
"
$pid
"
]
;
then
rm
-f
"
$_SOCAT_ERR
"
return
return
fi
fi
kill
$pid
kill
$pid
rm
-f
"
$_SOCAT_ERR
"
}
}
...
...
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