Skip to content

Instantly share code, notes, and snippets.

@icleversoft
Created April 29, 2013 09:35
Show Gist options
  • Save icleversoft/5480642 to your computer and use it in GitHub Desktop.
Save icleversoft/5480642 to your computer and use it in GitHub Desktop.
Zebra Start/Stop Utility
#! /bin/sh
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
NAME=zebra_au
DESC="Zebra Authority Server"
DAEMON=/usr/local/bin/zebrasrv
HOME=/data/zebra_au
PIDFILE=$HOME/zebra.pid
CONFFILE=$HOME/zebra.cfg
SRVFILE=$HOME/idxinfo/srv.xml
LOGFILE=$HOME/zebra_au.log
test -x $DAEMON || exit 0
case "$1" in
start)
echo -n "Starting $DESC: "
$DAEMON -f $SRVFILE -p $PIDFILE -l $LOGFILE -D
echo "$NAME."
;;
stop)
echo -n "Stopping $DESC: "
kill -QUIT `cat $PIDFILE`
echo "$NAME."
;;
restart)
echo -n "Restarting $DESC: "
kill -QUIT `cat $PIDFILE`
sleep 1
$DAEMON -f $SRVFILE -p $PIDFILE -$LOGFILE -D
echo "$NAME."
;;
reload)
echo -n "Reloading $DESC configuration: "
kill -HUP `cat $PIDFILE`
echo "$NAME."
;;
*)
echo "Usage $NAME {start|stop|restart|reload}" >&2
exit 1
;;
esac
exit 0
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment