From 850c1128dfb52786b546354619a8037b8d817617 Mon Sep 17 00:00:00 2001 From: neil Date: Sun, 13 Mar 2016 21:46:58 +0800 Subject: [PATCH] fix nc -q param for centos5 --- le.sh | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/le.sh b/le.sh index 49618e64..ea693a40 100755 --- a/le.sh +++ b/le.sh @@ -354,11 +354,12 @@ _saveaccountconf() { _startserver() { content="$1" - _NC="nc -q 1 -l" - + nchelp="$(nc -h 2>&1)" - #centos - if echo "$nchelp" | grep "nmap.org/ncat" >/dev/null ; then + + if echo "$nchelp" | grep " \-q " >/dev/null ; then + _NC="nc -q 1 -l" + else _NC="nc -l" fi @@ -701,7 +702,7 @@ issue() { elif [ "$code" == '409' ] ; then _info "Already registered" else - _err "Register account Error." + _err "Register account Error: $response" _clearup return 1 fi