X-Git-Url: https://arthur.barton.de/cgi-bin/gitweb.cgi?p=ngircd-alex.git;a=blobdiff_plain;f=src%2Ftestsuite%2Fstop-server.sh;h=0064baf2bf3662b0903f8356452347d327f009c4;hp=af28bae1b567d40ad2073f23824f6b6b8dced88b;hb=90ab7c7c48da57bcd7890b5809e99aa4b685c72a;hpb=508fa48aa6342beb50e510285b683abe54e0fe92 diff --git a/src/testsuite/stop-server.sh b/src/testsuite/stop-server.sh index af28bae1..0064baf2 100755 --- a/src/testsuite/stop-server.sh +++ b/src/testsuite/stop-server.sh @@ -1,15 +1,15 @@ #!/bin/sh # ngIRCd Test Suite -# $Id: stop-server.sh,v 1.4 2002/09/16 09:53:16 alex Exp $ +# $Id: stop-server.sh,v 1.6 2002/09/20 13:57:01 alex Exp $ echo " stopping server ..." -PS_FLAGS=a; PS_PIDCOL=1 -ps a > /dev/null 2>&1 -if [ $? -ne 0 ]; then PS_FLAGS=-f; PS_PIDCOL=2; fi +PS_FLAGS=-f; PS_PIDCOL=2 +ps $PS_FLAGS > /dev/null 2>&1 +if [ $? -ne 0 ]; then PS_FLAGS=a; PS_PIDCOL=1; fi ps $PS_FLAGS > procs.tmp pid=`cat procs.tmp | grep ngircd-TEST | awk "{ print \\\$$PS_PIDCOL }"` -kill $pid > /dev/null 2>&1 +[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1 # -eof-