#!/bin/sh
#
# snake-server:	Start/stop snake tree hosting service
#
# Copyright 2007 Red Hat, Inc.
#
# This software may be freely redistributed under the terms of the GNU
# general public license.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
#
# chkconfig:	- 97 01
# description:	Smart Network Automated Kickstart Environment Server
#

# Source function library.
. /etc/rc.d/init.d/functions

start()
{
	echo -n $"Starting snake-server:"
	daemon /usr/sbin/snake-server
	touch /var/lock/subsys/snake-server
	echo ""
}

stop()
{
	echo -n "Stopping snake-server:"
	killproc snake-server
	rm -f /var/lock/subsys/snake-server
	echo ""
}

case "$1" in
  start)
	start
	;;
  stop)
	stop
	;;
  restart|reload)
    stop
    start
    ;;
  condrestart)
    [ -e /var/lock/subsys/snake-server ] && (stop; start)
    ;;
  status)
    status snake-server
    ;;
  *)
    echo $"Usage: $0 {start|stop|status|restart|reload|condrestart}"
    exit 1
	;;
esac

exit 0
