#!/bin/sh # # chkconfig: 2345 93 83 # # description: This shell script takes care of starting and stopping ntop. # Source function library. . /etc/rc.d/init.d/functions # Source networking configuration. . /etc/sysconfig/network prog="/usr/sbin/ntop" name=ntop # Check that networking is up. [ ${NETWORKING} = "no" ] && exit 0 ! [ -x $prog ] && echo $prog not found, aborting && exit 1 start () { # start daemon gprintf "Starting %s: " "$name" #NOTE: You most likely will have to fix this up to reflect your network. # Do not run ntop until you have read the docs/1STRUN.txt file to set # the admin password! daemon $prog -d -P /var/lib/ntop -u ntop -E RETVAL=$? echo [ $RETVAL = 0 ] && touch /var/lock/subsys/ntop return $RETVAL } stop () { # stop daemon gprintf "Stopping %s: " "$name" killproc ntop RETVAL=$? echo [ $RETVAL = 0 ] && rm -f /var/lock/subsys/ntop return $RETVAL } restart () { stop start } case "$1" in start) start ;; stop) stop ;; restart) restart ;; condrestart) [ -f /var/lock/subsys/ntop ] && restart || : ;; status) status ntop ;; *) gprintf "Usage: %s {start|stop|restart|condrestart|status}\n" "$0" exit 1 esac exit $RETVAL