Imported Debian patch 2.5.2p1-3
[debian/amanda] / server-src / amcleanup.sh.in
index f301c5c84ed7bdbf46d151c01db383e60ed19e76..cd60001ff165eb6c96526577bbda7eec227763d0 100644 (file)
@@ -48,7 +48,7 @@ else
 fi
 
 if test -h /proc/1/exe ; then
-       if test $# -ge 2 && test "$1" == "-k" ; then
+       if test $# -ge 2 && test "$1" = "-k" ; then
                KILL_ENABLE=1
                conf=$2
                shift
@@ -183,9 +183,9 @@ if test ${KILL_ENABLE} -eq 1 ; then
                while test ${KEEP_CHECKING} -ne 0 ; do
                        PIDS_THIS_PASS=0
                        for search_user in ${dumpuser} root ; do
-                               if test "${search_user}" == "${dumpuser}" ; then
+                               if test "${search_user}" = "${dumpuser}" ; then
                                        PROCESS_NAMES=${USER_PROCESS_NAMES}
-                               elif test "${search_user}" == "root" ; then
+                               elif test "${search_user}" = "root" ; then
                                        PROCESS_NAMES=${ROOT_PROCESS_NAMES}
                                fi
                                for search_pid in [0-9]* ; do
@@ -193,7 +193,7 @@ if test ${KILL_ENABLE} -eq 1 ; then
                                                ls -l /proc/${search_pid}/exe 2>/dev/null | grep ${search_name} >/dev/null
                                                match_name=$?
                                                pid_uid="`cat /proc/${search_pid}/status 2>/dev/null | grep Uid | awk '//{split($_,i); print i[2]}'`"
-                                               if test ${match_name} -eq 0  && test "${pid_uid}" == "${search_user}" ; then
+                                               if test ${match_name} -eq 0  && test "${pid_uid}" = "${search_user}" ; then
                                                        echo "amcleanup: Process ${search_name} found running at pid #${search_pid}."
                                                        kill_pid=${search_pid}
                                                        kill_name=${search_name}
@@ -208,11 +208,11 @@ if test ${KILL_ENABLE} -eq 1 ; then
                                        if test ! -z "${kill_pid}" ; then
                                                if test -d /proc/${kill_pid} ; then
                                                        echo "amcleanup: Sending process ${kill_pid} the TERM signal."
-                                                       kill -15 -- ${kill_pid}
+                                                       kill TERM -- ${kill_pid}
                                                        sleep 5
                                                        if test -d /proc/${kill_pid} ; then
                                                                echo "amcleanup: Sending process  ${kill_pid} the KILL signal."
-                                                               kill -9 -- ${kill_pid}
+                                                               kill KILL -- ${kill_pid}
                                                        fi
                                                        sleep 5
                                                        if test -d /proc/${kill_pid} ; then