File: init.d_ntop

package info (click to toggle)
ntop 3%3A5.0.1%2Bdfsg1-2.1
  • links: PTS, VCS
  • area: main
  • in suites: jessie, jessie-kfreebsd
  • size: 15,720 kB
  • ctags: 11,480
  • sloc: ansic: 79,804; sh: 21,658; python: 1,948; awk: 1,504; perl: 971; makefile: 745; php: 123; xml: 71; sql: 13; sed: 11
file content (54 lines) | stat: -rw-r--r-- 1,026 bytes parent folder | download | duplicates (5)
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