4 [ -z "$srcdir" ] && srcdir=`dirname $0`
7 . ${srcdir}/functions.inc
15 echo_n " starting server ${id} ..."
17 # remove old logfiles, if this is the first server (ID 1)
18 [ "$id" = "1" ] && rm -rf logs *.log
20 # check weather getpid.sh returns valid PIDs. If not, don't start up the
21 # test-server, because we won't be able to kill it at the end of the test.
22 ./getpid.sh sh > /dev/null 2>&1
24 echo " getpid.sh failed!"
28 # check if there is a test-server already running
29 ./getpid.sh T-ngircd${id} >/dev/null 2>&1
31 echo " failure: test-server ${id} already running!"
35 # generate MOTD for test-server
36 echo "This is an ngIRCd Test Server" > ngircd-test${id}.motd
38 # starting up test-server ...
39 ./T-ngircd${id} -n -f ${srcdir}/ngircd-test${id}.conf $* \
40 >ngircd-test${id}.log 2>&1 &
43 # validate running test-server
44 pid=`./getpid.sh T-ngircd${id}`
45 [ -n "$pid" ] && kill -0 $pid > /dev/null 2>&1; r=$?
47 [ $r -eq 0 ] && echo " ok." || echo " failure!"