#!/bin/sh
#
# Start/Stop script for l7directord
#
# chkconfig: 2345 96 36
# description: Start and stop l7directord on non-heartbeat systems
#              Using the config file /etc/ha.d/conf/l7directord.cf
#              
# processname: l7directord
# config: /etc/ha.d/conf/l7directord.cf
#
# Author: NTT COMWARE
# Released: August 2005
# Licence: GNU General Public Licence

# Source function library.
if
  [ -f /etc/rc.d/init.d/functions ]
then
  . /etc/rc.d/init.d/functions
else
  function action {
    echo "$1"
    shift
    $@
  }
fi

[ -x /usr/sbin/l7directord ] || exit 0


######################################################################
# Read arument and take action as appropriate
######################################################################

case "$1" in
  start)
        action "Starting l7directord" /usr/sbin/l7directord start
	;;
  stop)
        action "Stopping l7directord" /usr/sbin/l7directord stop
	;;
  restart)
	$0 stop
	sleep 1; # It may take a moment for the original l7directord to exit
	$0 start
	;;
  status)
	/usr/sbin/l7directord status
	;;
  reload|force-reload)
  	/usr/sbin/l7directord reload
	;;
  *)
	echo "Usage: l7directord
	{start|stop|restart|status|reload|force-reload}"
	exit 1
esac

exit 0
