]> arthur.barton.de Git - ngircd-alex.git/blobdiff - src/testsuite/stop-server.sh
- es wird nun getestet, mit welchen Parametern "ps" aufgerufen werden muss.
[ngircd-alex.git] / src / testsuite / stop-server.sh
index b649c9c9d0ec5ff1d2f07af17b3aaec1d93b20c1..af28bae1b567d40ad2073f23824f6b6b8dced88b 100755 (executable)
@@ -1,11 +1,15 @@
 #!/bin/sh
 # ngIRCd Test Suite
-# $Id: stop-server.sh,v 1.3 2002/09/13 06:04:49 alex Exp $
+# $Id: stop-server.sh,v 1.4 2002/09/16 09:53:16 alex Exp $
 
 echo "      stopping server ..."
 
-ps ax > procs.tmp
-pid=`cat procs.tmp | grep ngircd-TEST | awk "{ print \\\$1 }"`
+PS_FLAGS=a; PS_PIDCOL=1
+ps a > /dev/null 2>&1
+if [ $? -ne 0 ]; then PS_FLAGS=-f; PS_PIDCOL=2; fi
+
+ps $PS_FLAGS > procs.tmp
+pid=`cat procs.tmp | grep ngircd-TEST | awk "{ print \\\$$PS_PIDCOL }"`
 kill $pid > /dev/null 2>&1
 
 # -eof-