mirror of
https://github.com/plantroon/acme.sh.git
synced 2024-11-14 02:11:45 +00:00
fix for centos ncat and debian default netcat (#330)
This commit is contained in:
parent
caa2e45a8c
commit
c9febbdd87
25
acme.sh
25
acme.sh
@ -1231,14 +1231,29 @@ _startserver() {
|
|||||||
|
|
||||||
_debug "_NC" "$_NC"
|
_debug "_NC" "$_NC"
|
||||||
|
|
||||||
# while true ; do
|
#for centos ncat
|
||||||
|
if _contains "$nchelp" "nmap.org" ; then
|
||||||
|
_debug "Using ncat: nmap.org"
|
||||||
if [ "$DEBUG" ] ; then
|
if [ "$DEBUG" ] ; then
|
||||||
if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort ; then
|
if printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort ; then
|
||||||
printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort ;
|
return
|
||||||
fi
|
fi
|
||||||
else
|
else
|
||||||
if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort > /dev/null 2>&1; then
|
if printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort > /dev/null 2>&1; then
|
||||||
printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort > /dev/null 2>&1
|
return
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
_err "ncat listen error."
|
||||||
|
fi
|
||||||
|
|
||||||
|
# while true ; do
|
||||||
|
if [ "$DEBUG" ] ; then
|
||||||
|
if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort ; then
|
||||||
|
printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort ;
|
||||||
|
fi
|
||||||
|
else
|
||||||
|
if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort > /dev/null 2>&1; then
|
||||||
|
printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort > /dev/null 2>&1
|
||||||
fi
|
fi
|
||||||
fi
|
fi
|
||||||
if [ "$?" != "0" ] ; then
|
if [ "$?" != "0" ] ; then
|
||||||
|
Loading…
Reference in New Issue
Block a user