about summary refs log tree commit diff
path: root/src/testsuite/reload-server.sh
blob: b17d672119e19f172da22e9f778a092c1775409c (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
#!/bin/sh
# ngIRCd Test Suite

[ -z "$srcdir" ] && srcdir=`dirname $0`

# read in functions
. ${srcdir}/functions.inc

if [ -n "$1" ]; then
	id="$1"; shift
else
	id="1"
fi

echo_n "reloading server ${id} ..."

# reload (sighup) test-server ...
pid=`./getpid.sh T-ngircd${id}`
if [ -z "$pid" ]; then
  echo " failure: no running server found!?"
  exit 1
fi
kill -HUP $pid > /dev/null 2>&1; r=$?
if [ $r -eq 0 ]; then
  echo " ok".
  exit 0
fi
echo " failure: server ${id} could not be restarted"
exit 1

# -eof-