#! /bin/sh
+### BEGIN INIT INFO
+# Provides: irspy-zebra
+# Required-Start: $local_fs $remote_fs $network $named $time
+# Required-Stop: $local_fs $remote_fs
+# Default-Start: 2 3 4 5
+# Default-Stop: 0 1 6
+# Short-Description: Controls the irspy-zebra daemon
+# Description: Controls the ID IRSpy Zebra server daemon
+# /usr/bin/zebrasrv-2.0 .
+### END INIT INFO
-# $Id: init-script,v 1.4 2007-02-28 17:50:22 mike Exp $
#
# This is a startup/shutdown script for IRSpy's Zebra server, suitable
# for use in a SysV-style init directory such as /etc/init.d (on
# Debian systems) and /etc/rc.d/init.d (on Red Hat systems), like this:
#
# cd /etc/init.d
-# sudo ln -s /usr/local/src/cvs/irspy/zebra/init-script irspy-zebra
+# sudo ln -s .../irspy/zebra/init-script irspy-zebra
# sudo /etc/init.d/irspy-zebra start
#
# You may need to tweak it to suit your system's paths.
# zebrasrv-2.0 may be in /usr/local/bin, hence this slight security hole
PATH=/bin:/usr/bin:/usr/local/bin/
-logfile=/var/log/irspy-zebra
+logfile=/var/log/irspy-zebra.log
pidfile=/var/run/irspy-zebra.pid
+case "`hostname`" in
+ nigiri | xeno | rafa | test) IRSPYDIR=/usr/local/src/git/irspy/;;
+ shawarma|kafta) IRSPYDIR=/home/mike/cvs/irspy/;;
+ berwick ) IRSPYDIR=/home/indexdata/irspy/ ;;
+
+ your-development-machine )
+ IRSPYDIR=/home/foobar/indexdata/irspy/
+ logfile=$IRSPYDIR/irspy-zebra
+ pidfile=$IRSPYDIR/irspy-zebra.pid
+ ;;
+ *) echo "$0: unsupported host `hostname`" >&2
+ exit 1;;
+esac
+
case "$1" in
start)
if [ -f $pidfile ]; then
echo "Starting IRSpy's Zebra"
# Let log rotation take care of backups
#test -f $logfile && mv -f $logfile $logfile.old
- ( cd /usr/local/src/cvs/irspy/zebra
- zebrasrv-2.0 -f yazserver.xml < /dev/null >> $logfile 2>&1 &
+ ( cd $IRSPYDIR/zebra
+ zebrasrv-2.0 -f $(pwd)/yazserver.xml < /dev/null >> $logfile 2>&1 &
echo $! > $pidfile
)
;;
echo "Usage: $0 start|stop|restart" >&2
;;
esac
+