Updated.
[ZOOM-Perl-moved-to-github.git] / archive / test-server / test-server.init
1 #! /bin/sh
2
3 # $Id: test-server.init,v 1.3 2005-12-14 10:22:08 mike Exp $
4 #
5 # This is a startup/shutdown script for the ZOOM-Perl test-server,
6 # suitable for use in a SysV-style init directory such as /etc/init.d
7 # (on Debian systems) and /etc/rc.d/init.d (on Red Hat systems).  This
8 # is configured to run on test.indexdata.com -- if you want to run it
9 # somewhere else, you'll probably need to tweak it to suit your
10 # system's paths.
11
12 PATH=/bin:/usr/bin
13 logfile=/var/log/zoom-perl-test-server
14 pidfile=/var/run/zoom-perl-test-server.pid
15
16 case "$1" in
17   start)
18         if [ -f $pidfile ]; then
19                 echo "ZOOM-Perl test server seems to be already running"
20                 exit 1
21         fi
22         echo "Starting ZOOM-Perl test server"
23         test -f $logfile && mv $logfile $logfile.old
24         ( cd /home/mike/universe/src/ZOOM-Perl/archive
25           ../../../bin/zebrasrv -c test-server.cfg @:2118 \
26                 > $logfile 2>&1 < /dev/null &
27           echo $! > $pidfile
28         )
29         ;;
30   stop)
31         if [ ! -f $pidfile ]; then
32                 echo "ZOOM-Perl test server does not seem to be running"
33                 exit 1
34         fi
35         echo "Stopping ZOOM-Perl test server"
36         kill `cat $pidfile`
37         rm $pidfile
38         ;;
39   restart)
40         $0 stop && $0 start
41         ;;
42   *)
43         echo "Usage: $0 start|stop|restart" >&2
44         ;;
45 esac