#!/bin/bash

# chkconfig: 2345 86 14
# description: Spong network checks program.

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

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ ${NETWORKING} = "no" ] && exit 0

# See how we were called.
case "$1" in
  start)
        # Start daemons.
        echo -n "Starting spong-network: "
        /usr/local/spong/bin/spong-network 
        echo
        touch /var/lock/subsys/spong-network
        ;;
  stop)
        # Stop daemons.
        echo -n "Shutting down spong-network: "
	killproc spong-network
        killall spong-network
        echo
        rm -f /var/lock/subsys/spong-network
        ;;
  status)
	status spong-network
	;;
  restart|reload)
	$0 stop
	$0 start
	;;
  *)
        echo "Usage: spong-network {start|stop|restart|reload|status}"
        exit 1
esac

exit 0
