X-Git-Url: https://git.gag.com/?a=blobdiff_plain;f=server-src%2Famcleanup.sh.in;h=cd60001ff165eb6c96526577bbda7eec227763d0;hb=433ed330db63d8c4e06e046d2e3e820ceb7947a2;hp=f301c5c84ed7bdbf46d151c01db383e60ed19e76;hpb=0917718534086d5a50bf1297e6e394c8291c0fad;p=debian%2Famanda diff --git a/server-src/amcleanup.sh.in b/server-src/amcleanup.sh.in index f301c5c..cd60001 100644 --- a/server-src/amcleanup.sh.in +++ b/server-src/amcleanup.sh.in @@ -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