From f76eb45217abeda0ffdbcd71b771b82afaa3079d Mon Sep 17 00:00:00 2001 From: neil Date: Wed, 16 Mar 2016 22:20:47 +0800 Subject: [PATCH] compatible to GNU netcat --- le.sh | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/le.sh b/le.sh index 677236cb..c028e75f 100755 --- a/le.sh +++ b/le.sh @@ -443,10 +443,14 @@ _startserver() { if echo "$nchelp" | grep "\-q " >/dev/null ; then _NC="nc -q 1 -l" else - _NC="nc -l" + if echo "$nchelp" | grep "GNU netcat" >/dev/null && echo "$nchelp" | grep "\-c, \-\-close" >/dev/null ; then + _NC="nc -c -l" + else + _NC="nc -l" + fi fi - _debug "$_NC $Le_HTTPPort" + _debug "_NC" "$_NC" # while true ; do if [ "$DEBUG" ] ; then if ! echo -e -n "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort -vv ; then