4 [ -z "$srcdir" ] && srcdir=`dirname "$0"`
8 . "${srcdir}/functions.inc"
16 echo_n "starting server ${id} ..."
18 # remove old logfiles, if this is the first server (ID 1)
19 [ "$id" = "1" ] && rm -rf logs *.log
21 # check weather getpid.sh returns valid PIDs. If not, don't start up the
22 # test-server, because we won't be able to kill it at the end of the test.
23 ./getpid.sh sh >/dev/null
25 echo " getpid.sh failed!"
29 # check if there is a test-server already running
30 ./getpid.sh T-ngircd${id} >/dev/null 2>&1
32 echo " failure: test-server ${id} already running!"
36 # generate MOTD for test-server
37 echo "This is an ngIRCd Test Server" >ngircd-test${id}.motd
39 # glibc memory checking, see malloc(3)
43 # starting up test-server ...
44 ./T-ngircd${id} -n -f "${srcdir}/ngircd-test${id}.conf" "$@" \
45 >ngircd-test${id}.log 2>&1 &
48 # validate running test-server
50 pid=`./getpid.sh T-ngircd${id}`
51 [ -n "$pid" ] && kill -0 $pid >/dev/null 2>&1; r=$?
52 [ $r -eq 0 ] && echo " ok." || echo " failure!"