fix compatible for dash

This commit is contained in:
neil 2016-04-17 20:58:56 +08:00
parent fc33dbb54e
commit a1048c48e4

View File

@ -720,12 +720,12 @@ _startserver() {
_debug "_NC" "$_NC" _debug "_NC" "$_NC"
# while true ; do # while true ; do
if [ "$DEBUG" ] ; then if [ "$DEBUG" ] ; then
if ! echo -n "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort -vv ; then if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort -vv ; then
echo -n "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort -vv ; printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort -vv ;
fi fi
else else
if ! echo -n "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort > /dev/null 2>&1; then if ! printf "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC -p $Le_HTTPPort > /dev/null 2>&1; then
echo -n "HTTP/1.1 200 OK\r\n\r\n$content" | $_NC $Le_HTTPPort > /dev/null 2>&1 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