2002-09-09 12:16:24 +02:00
|
|
|
#!/bin/sh
|
|
|
|
# ngIRCd Test Suite
|
2003-08-22 13:31:18 +02:00
|
|
|
# $Id: start-server.sh,v 1.11 2003/08/22 11:31:18 alex Exp $
|
2002-09-24 00:07:42 +02:00
|
|
|
|
|
|
|
[ -z "$srcdir" ] && srcdir=`dirname $0`
|
2002-09-09 12:16:24 +02:00
|
|
|
|
|
|
|
echo " starting server ..."
|
|
|
|
|
2003-08-22 13:31:18 +02:00
|
|
|
# remove old logfiles
|
2002-09-20 16:46:55 +02:00
|
|
|
rm -rf logs *.log
|
2002-09-12 04:27:30 +02:00
|
|
|
|
2003-08-22 13:31:18 +02:00
|
|
|
# check weather getpid.sh returns valid PIDs. If not, don't start up the
|
|
|
|
# test-server, because we won't be able to kill it at the end of the test.
|
2002-11-10 15:28:06 +01:00
|
|
|
./getpid.sh sh > /dev/null 2>&1
|
2002-09-20 16:46:55 +02:00
|
|
|
if [ $? -ne 0 ]; then
|
|
|
|
echo " error: getpid.sh FAILED!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2003-08-22 13:31:18 +02:00
|
|
|
# check if there is a test-server already running
|
|
|
|
./getpid.sh T-ngircd > /dev/null 2>&1
|
|
|
|
if [ $? -eq 0 ]; then
|
|
|
|
echo " error: test-server already running!"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
|
|
|
# generate MOTD for test-server
|
2002-09-09 12:16:24 +02:00
|
|
|
echo "This is an ngIRCd Test Server" > ngircd-test.motd
|
|
|
|
|
2003-08-22 13:31:18 +02:00
|
|
|
# starting up test-server ...
|
2002-11-10 15:28:06 +01:00
|
|
|
./T-ngircd -np -f ${srcdir}/ngircd-test.conf > ngircd-test.log 2>&1 &
|
2002-09-09 12:16:24 +02:00
|
|
|
sleep 1
|
|
|
|
|
2003-08-22 13:31:18 +02:00
|
|
|
# validate running test-server
|
2002-11-10 15:28:06 +01:00
|
|
|
pid=`./getpid.sh T-ngircd`
|
2002-09-20 15:57:01 +02:00
|
|
|
[ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1 || exit 1
|
2002-09-09 12:16:24 +02:00
|
|
|
|
|
|
|
# -eof-
|