Annotation of ircnowd/src/testsuite/stop-server.sh, Revision 1.1
1.1 ! tomglok 1: #!/bin/sh
! 2: # ngIRCd Test Suite
! 3:
! 4: [ -z "$srcdir" ] && srcdir=`dirname $0`
! 5:
! 6: # read in functions
! 7: . ${srcdir}/functions.inc
! 8:
! 9: if [ -n "$1" ]; then
! 10: id="$1"; shift
! 11: else
! 12: id="1"
! 13: fi
! 14:
! 15: echo_n "stopping server ${id} ..."
! 16:
! 17: # stop test-server ...
! 18: pid=`./getpid.sh T-ngircd${id}`
! 19: if [ -z "$pid" ]; then
! 20: echo " failure: no running server found!?"
! 21: exit 1
! 22: fi
! 23: kill $pid > /dev/null 2>&1 || exit 1
! 24:
! 25: # waiting ...
! 26: for i in 1 2 3 4 5; do
! 27: kill -0 $pid > /dev/null 2>&1; r=$?
! 28: if [ $r -ne 0 ]; then
! 29: echo " ok".
! 30: exit 0
! 31: fi
! 32: sleep 1
! 33: done
! 34: echo " failure: server ${id} still running!?"
! 35: exit 1
! 36:
! 37: # -eof-
CVSweb