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