Imported Upstream version 2.5.1p3
[debian/amanda] / server-src / amcleanup.sh.in
index 2590932ca0841ff3a5e242260392da00337c70b7..f301c5c84ed7bdbf46d151c01db383e60ed19e76 100644 (file)
@@ -48,25 +48,26 @@ else
 fi
 
 if test -h /proc/1/exe ; then
-       if test $# -eq 1 ; then
-               KILL_ENABLE=0
-               conf=$1
-               shift;
-       elif test $# -eq 2 && test "$1" == "-k" ; then
+       if test $# -ge 2 && test "$1" == "-k" ; then
                KILL_ENABLE=1
                conf=$2
                shift
                shift
+       elif test $# -ge 1 ; then
+               KILL_ENABLE=0
+               conf=$1
+               shift;
        else
                echo "Usage: amcleanup [-k] conf"
                exit 1
        fi
 else
-       if test $# -ne 1 ; then
+       if test $# -lt 1 ; then
                echo "Usage: amcleanup conf"
                exit 1
        else
                conf=$1
+               shift
                KILL_ENABLE=0
        fi
 fi