3 # ntop This shell script takes care of starting and stopping ntop
6 # description: Network monitoring tool.
9 # Source function library
10 . /etc/rc.d/init.d/functions
13 . /etc/sysconfig/network
16 # Get service config - may override defaults
17 [ -f /etc/sysconfig/ntop ] && . /etc/sysconfig/ntop
19 # Check that networking is up.
20 if is_yes "${NETWORKING}"; then
21 if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
30 # See how we were called.
33 # Check if ntop is initialized
34 if [ ! -f "$NTOP_DIR/addressQueue.db" ]; then
35 nls "ntop is not initialized. Try \"%s init\" before start." "$0"
37 nls "after setting password please ^C, to stop the daemon"
41 # Check if the service is already running?
42 if [ ! -f /var/lock/subsys/ntop ]; then
44 ntop -d -P $NTOP_DIR -i $NTOP_IFACE > /dev/null 2>&1
46 [ $RETVAL -eq 0 ] && ok || fail
47 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntop
49 msg_already_running ntop
54 if [ -f /var/lock/subsys/ntop ]; then
57 rm -f /var/lock/subsys/ntop >/dev/null 2>&1
67 if [ -f /var/lock/subsys/ntop ]; then
72 msg_not_running ntop >&2
77 ntop -P $NTOP_DIR -i $NTOP_IFACE
84 msg_usage "$0 {start|stop|restart|reload|force-reload|init|status}"