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/ntop_pw.db" ]; then
40 nls "ntop is not initialized. Try '%s init' before start." /etc/rc.d/init.d/ntop
44 # Check if the service is already running?
45 if [ ! -f /var/lock/subsys/ntop ]; then
47 daemon ntop @/etc/ntop.conf -d -P $NTOP_DIR
49 [ $RETVAL -eq 0 ] && touch /var/lock/subsys/ntop
51 msg_already_running ntop
56 if [ -f /var/lock/subsys/ntop ]; then
59 rm -f /var/lock/subsys/ntop >/dev/null 2>&1
69 if [ -f /var/lock/subsys/ntop ]; then
74 msg_not_running ntop >&2
79 ntop -P $NTOP_DIR @/etc/ntop.conf -A
86 msg_usage "$0 {start|stop|restart|reload|force-reload|init|status}"