1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54
|
#! /bin/sh
#
# ntop script
#
# NOTE: Copy this script in /etc/init.d/ntop
#
# Author:
# Paul Mansfield <paul.mansfield@uk.worldpay.com>
# Worldpay - 20020218
#
set -e
NAME=ntop
DIR=/usr/local/bin
DAEMON=/usr/local/bin/ntop
test -x $DAEMON || exit 0
case "$1" in
start)
update-inetd --disable smtp
echo -n "Starting NTOP, note this will create a listener on UDP:6343 "
cd $DIR
$DAEMON -u nobody -E -w 0 -W 8080 -S 2 > /var/log/ntop.out &
echo " ...done"
;;
stop)
PIDS=`ps -ef | grep $DAEMON | grep -v grep | awk '{print $2 }'`
if [ "$PIDS" = "" ] ; then
echo "ntop is not running"
else
echo "ntop processes are $PIDS"
kill $PIDS
fi
;;
kill9)
PIDS=`ps -ef | grep $DAEMON | grep -v grep | awk '{print $2 }'`
if [ "$PIDS" = "" ] ; then
echo "ntop is not running"
else
echo "killing -9 ntop processes $PIDS"
kill -9 $PIDS
fi
;;
*)
echo "Usage: /etc/init.d/$NAME {start}"
exit 1
;;
esac
exit 0
|