diff --git a/start-socat.sh b/start-socat.sh index 5912976..9cd8b17 100644 --- a/start-socat.sh +++ b/start-socat.sh @@ -8,11 +8,11 @@ This is free software, and you are welcome to redistribute it under certain cond ' . $DIR/config.sh -#if [ "$SUUSER" = "" ]; then SUUSER="$USER"; fi +if [ "$SUUSER" != "" ]; then SUPARM='su="'"$SUUSER"'",'; fi echo "Listening at Port $PORT" if [ "$1" = "-d" -o "$1" = "--daemon" ]; then - setsid socat TCP-LISTEN:$PORT,reuseaddr,su="$SUUSER",fork SYSTEM:"./main.sh" > /dev/null 2>&1 & + setsid socat TCP-LISTEN:$PORT,reuseaddr,"$SUPARM"fork SYSTEM:"./main.sh" > /dev/null 2>&1 & else - socat TCP-LISTEN:$PORT,reuseaddr,su="$SUUSER",fork SYSTEM:"./main.sh" + socat TCP-LISTEN:$PORT,reuseaddr,"$SUPARM",fork SYSTEM:"./main.sh" fi