~ubuntu-branches/ubuntu/maverick/ntop/maverick

« back to all changes in this revision

Viewing changes to ntop/packages/suse/ntopd

  • Committer: Bazaar Package Importer
  • Author(s): Dennis Schoen
  • Date: 2002-04-12 11:38:47 UTC
  • Revision ID: james.westby@ubuntu.com-20020412113847-4k4yydw0pzybc6g8
Tags: upstream-2.0.0
ImportĀ upstreamĀ versionĀ 2.0.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
# Copyright (c) 1995-2000 S.u.S.E. GmbH Fuerth, Germany.
 
3
#
 
4
# Author: Remo Behn <ray@suse.de>
 
5
#
 
6
# /sbin/init.d/ntop
 
7
#
 
8
### BEGIN INIT INFO
 
9
# Provides: ntop
 
10
# Required-Start: $network
 
11
# Required-Stop: $network
 
12
# Default-Start: 3 5
 
13
# Default-Stop: 0 1 2 6
 
14
# Description: Tool for monitoring the network usage.
 
15
### END INIT INFO
 
16
 
 
17
. /etc/rc.status
 
18
. /etc/rc.config
 
19
 
 
20
# Determine the base and follow a runlevel link name.
 
21
base=${0##*/}
 
22
link=${base#*[SK][0-9][0-9]}
 
23
 
 
24
# Force execution if not called by a runlevel directory.
 
25
test $link = $base && START_NTOPD=yes
 
26
test "$START_NTOPD" = yes || exit 0
 
27
 
 
28
# The echo return value for success (defined in /etc/rc.config).
 
29
return=$rc_done
 
30
case "$1" in
 
31
    start)
 
32
        echo -n "Starting service ntop"
 
33
        ## Start daemon with startproc(8). If this fails
 
34
        ## the echo return value is set appropriate.
 
35
 
 
36
        startproc -q /usr/bin/ntop -i $NTOPD_IFACE -w $NTOPD_PORT -P /var/lib/ntop
 
37
 
 
38
        rc_status -v
 
39
        ;;
 
40
    stop)
 
41
        echo -n "Shutting down service ntop"
 
42
        ## Stop daemon with killproc(8) and if this fails
 
43
        ## set echo the echo return value.
 
44
 
 
45
        killproc -TERM /usr/bin/ntop
 
46
 
 
47
        rc_status -v
 
48
        ;;
 
49
    restart|reload)
 
50
        $0 stop && $0 start
 
51
        rc_status
 
52
        ;;
 
53
    status)
 
54
        echo -n "Checking for service ntop: "
 
55
        ## Check status with checkproc(8), if process is running
 
56
        ## checkproc will return with exit status 0.
 
57
 
 
58
        checkproc /usr/bin/ntop
 
59
        rc_status -v
 
60
        ;;
 
61
    *)
 
62
        echo "Usage: $0 {start|stop|restart|reload|status}"
 
63
        exit 1
 
64
        ;;
 
65
esac
 
66
rc_exit
 
67