#!/bin/bash # # Init file for the NTOP network monitor # # # description: NTOP Network Monitor # # processname: ntop # config: /etc/ntop.conf # pidfile: /var/lib/ntop/ntop.pid # # READ FIRST # Before you run this script make sure you run: # `ntop -u ntop -A` to assign a admin password # for the admin wui interfaz. [ -x "/usr/bin/ntop" ] || exit 1 #[ -r "/etc/ntop.conf" ] || exit 1 [ -r "/var/lib/ntop/ntop_pw.db" ] || exit 1 RETVAL=0 prog="ntop" start () { echo -n $"Starting $prog: " $prog -u ntop -d # -L /etc/ntop.conf RETVAL=$? echo [ $RETVAL -eq 0 ] && touch /var/lock/subsys/\$prog return $RETVAL } stop () { echo -n $"Stopping $prog: " killall $prog RETVAL=$? echo [ $RETVAL -eq 0 ] && rm -f /var/lock/subsys/$prog return $RETVAL } restart () { stop sleep 2 start } case "$1" in start) start ;; stop) stop ;; restart|reload) restart ;; condrestart) [ -e /var/lock/subsys/$prog ] && restart RETVAL=$? ;; *) echo $"Usage: $0 {start|stop|restart|condrestart|status}" RETVAL=1 esac exit $RETVAL