NTOP - init script
#
# Init file for the NTOP network monitor
#
# chkconfig: - 93 83
#
# description: NTOP Network Monitor
#
# processname: ntop
# config: /etc/ntop.conf
# pidfile: /var/run/ntop
# Source function library.
. /etc/rc.d/init.d/functions
# Source networking configuration.
. /etc/sysconfig/network
# Check that networking is up.
[ "${NETWORKING}" == "no" ] && exit 0
[ -x "/usr/bin/ntop" ] || exit 1
[ -r "/etc/ntop.conf" ] || exit 1
[ -r "/var/ntop/ntop_pw.db" ] || exit 1
RETVAL=0
prog="ntop"
start () {
echo -n $"Starting $prog: "
daemon $prog @/etc/ntop.conf
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog
return $RETVAL
}
stop () {
echo -n $"Stopping $prog: "
killproc $prog
RETVAL=$?
echo
[ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog
return $RETVAL
}
restart () {
stop
start
}
case "$1" in
start)
start
;;
stop)
stop
;;
restart|reload)
restart
;;
condrestart)
[ -e /var/lock/subsys/$prog ] && restart
RETVAL=$?
;;
status)
status $prog
RETVAL=$?
;;
*)
echo $"Usage: $0 {start|stop|restart|condrestart|status}"
RETVAL=1
esac
exit $RETVAL