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
29 if [ -z "$NTOP_DIR" ]; then
30 nls "NTOP_DIR not set in /etc/sysconfig/ntop"
35 # See how we were called.
38 # Check if ntop is initialized
39 if [ ! -f "$NTOP_DIR/addressQueue.db" ]; then
40 nls "ntop is not initialized. Try \"%s init\" before start." "$0"
42 nls "After setting password please press ^C to stop the daemon."
46 # Check if the service is already running?
47 if [ ! -f /var/lock/subsys/ntop ]; then
49 daemon ntop -d -P $NTOP_DIR @/etc/ntop.conf
51 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntop
53 msg_already_running ntop
58 if [ -f /var/lock/subsys/ntop ]; then
61 rm -f /var/lock/subsys/ntop >/dev/null 2>&1
71 if [ -f /var/lock/subsys/ntop ]; then
76 msg_not_running ntop >&2
81 ntop -P $NTOP_DIR @/etc/ntop.conf
88 msg_usage "$0 {start|stop|restart|reload|force-reload|init|status}"