use 'test -n "..."' instead of 'test "..."'; when "..." expands to '-v'
[util-vserver.git] / util-vserver / scripts / vserver.stop
index 3b4153b..8530927 100644 (file)
@@ -20,7 +20,7 @@ lock "$LOCKDIR"/vserver."$($_VSERVER_INFO "$VSERVER_DIR" CANONIFY)".startup
 
 if ! isVserverRunning "$VSERVER_DIR" S_CONTEXT; then
     warning $"vserver '$VSERVER_NAME' is not running" >&2
-    test "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null
+    test -n "$OPTION_DEBUG" || exec 2>/dev/null >/dev/null
     umountVserver     "$VSERVER_DIR" || :
     disableInterfaces "$VSERVER_DIR" || :
     unlock
@@ -56,7 +56,7 @@ cd "$VSERVER_DIR"/vdir/
 test -z "$OPTION_DEFAULTTTY" || setDefaultTTY "$VSERVER_DIR"
 
 fail=
-if test "$_IS_FAKEINIT" && \
+if test -n "$_IS_FAKEINIT" && \
    $_VSERVER_INFO - FEATURE vkill && \
    initpid=$($_VSERVER_INFO "$S_CONTEXT" INITPID 2>/dev/null); then
     $_VKILL -s INT -- "$initpid" || fail=1
@@ -75,7 +75,7 @@ else
     "${INITCMD_STOP[@]}" || fail=1
 fi
 
-test "$fail" || waitForSync "$VSERVER_DIR" "$sync_fifo"
+test -n "$fail" || waitForSync "$VSERVER_DIR" "$sync_fifo"
 
 vshelper.doDestroy "$VSERVER_DIR" "$S_CONTEXT"
 sendKillSequence   "$S_CONTEXT" "${INITKILL_SEQ[@]}"