1
0
mirror of https://github.com/osmarks/ngircd.git synced 2025-10-04 01:42:24 +00:00
Files
ngircd/src/testsuite/stop-server.sh
Alexander Barton 9cb9cca536 Fixed echo without newline for systems not understanding "echo -n"; added
new file "functions.inc" for functions usable by all test scripts. [From HEAD].
2004-09-06 22:07:26 +00:00

33 lines
589 B
Bash
Executable File

#!/bin/sh
# ngIRCd Test Suite
# $Id: stop-server.sh,v 1.10.2.3 2004/09/06 22:07:26 alex Exp $
[ -z "$srcdir" ] && srcdir=`dirname $0`
# read in functions
. ${srcdir}/functions.inc
echo_n " stopping server ..."
# stop test-server ...
pid=`./getpid.sh T-ngircd`
if [ -z "$pid" ]; then
echo " failure: no running server found!?"
exit 1
fi
kill $pid > /dev/null 2>&1 || exit 1
# waiting ...
for i in 1 2 3 4 5; do
kill -0 $pid > /dev/null 2>&1; r=$?
if [ $r -ne 0 ]; then
echo " ok".
exit 0
fi
sleep 1
done
echo " failure: server still running!?"
exit 1
# -eof-