#!/bin/sh
#
# chkconfig: 345 86 16
# description: bandwidth monitoring daemon to listen for 
#              usage reports from various applications
# Copyright (c) Ensim Corporation 2000, 2001   All Rights Reserved.
#
# This software is furnished under a license and may be used and copied
# only  in  accordance  with  the  terms  of such  license and with the
# inclusion of the above copyright notice. This software or any other
# copies thereof may not be provided or otherwise made available to any
# other person. No title to and ownership of the software is hereby
# transferred.
#
# The information in this software is subject to change without notice
# and  should  not be  construed  as  a commitment by Ensim Corporation.
# Ensim assumes no responsibility for the use or  reliability  of its
# software on equipment which is not supplied by Ensim.
#
#

. /etc/rc.d/init.d/functions

start() {
    echo -n "Starting bandwidth_manager: "
    /usr/sbin/bandwidth_manager # daemonizes
    RETVAL=$?
    [ $RETVAL -eq 0 ] && echo_success && touch /var/lock/subsys/bandwidth_manager
    [ $RETVAL -ne 0 ] && echo_failure
    echo
    exit $RETVAL
}

stop() {
    killproc bandwidth_manager
    sleep 3
    RETVAL=$?
    [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/bandwidth_manager
}
 
case "$1" in
        start)
		start
                ;;
        stop)
		stop
                ;;
        reload)
                kill -HUP `/sbin/pidof bandwidth_manager`
		exit 0
                ;;
	restart)
		stop
		start
		;;	
        *)
                echo "Usage: $0 {start|stop|reload|restart}"
                exit 1
esac
 
