X-Git-Url: http://git.indexdata.com/?p=irspy-moved-to-github.git;a=blobdiff_plain;f=zebra%2Finit-script;h=db71a91f90fc7a84bbad16df6488fd86ca0eed14;hp=b9d18f74ed0546cdce949ee4c869991ddef63a98;hb=03d16c0b00bb55023f86255219fc2b1469352359;hpb=8d28be721903fbb6cf8882c4293c290f4407e066 diff --git a/zebra/init-script b/zebra/init-script index b9d18f7..db71a91 100755 --- a/zebra/init-script +++ b/zebra/init-script @@ -1,13 +1,12 @@ #! /bin/sh -# $Id: init-script,v 1.1 2006-12-08 13:50:13 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 +# cd /etc/init.d +# 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. @@ -18,6 +17,18 @@ PATH=/bin:/usr/bin:/usr/local/bin/ logfile=/var/log/irspy-zebra pidfile=/var/run/irspy-zebra.pid +case "`hostname`" in + nigiri | xeno | rafa | test) IRSPYDIR=/usr/local/src/cvs/irspy/;; + shawarma|kafta) IRSPYDIR=/home/mike/cvs/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 @@ -25,9 +36,10 @@ case "$1" in exit 1 fi echo "Starting IRSpy's Zebra" - test -f $logfile && mv $logfile $logfile.old - ( cd /usr/local/src/cvs/irspy/zebra - zebrasrv-2.0 -f yazserver.xml < /dev/null > $logfile 2>&1 & + # Let log rotation take care of backups + #test -f $logfile && mv -f $logfile $logfile.old + ( cd $IRSPYDIR/zebra + zebrasrv-2.0 -f yazserver.xml < /dev/null >> $logfile 2>&1 & echo $! > $pidfile ) ;; @@ -47,3 +59,4 @@ case "$1" in echo "Usage: $0 start|stop|restart" >&2 ;; esac +