~ubuntu-branches/ubuntu/trusty/ntop/trusty

« back to all changes in this revision

Viewing changes to packages/debian/etc/init.d/ntop

  • Committer: Bazaar Package Importer
  • Author(s): Ola Lundqvist
  • Date: 2008-06-15 14:38:28 UTC
  • mfrom: (2.1.11 intrepid)
  • Revision ID: james.westby@ubuntu.com-20080615143828-oalh84nda2hje4do
Tags: 3:3.3-11
Correction of Polish translation encoding, closes: #479490. Thanks
to Christian Perrier <bubulle@debian.org> for the help.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#! /bin/sh
 
2
#
 
3
# ntop script
 
4
#
 
5
# NOTE: Copy this script in /etc/init.d/ntop
 
6
#
 
7
# Author:
 
8
# Paul Mansfield <paul.mansfield@uk.worldpay.com>
 
9
# Worldpay - 20020218
 
10
#
 
11
# Fixed by L.Deri - May 2007
 
12
#
 
13
 
 
14
set -e
 
15
 
 
16
NAME=ntop
 
17
DAEMON=/usr/local/bin/ntop
 
18
test -x $DAEMON || exit 0
 
19
 
 
20
start_ntop() {
 
21
    echo -n "Starting ntop "
 
22
    $DAEMON -u nobody > /var/log/ntop.out &
 
23
    echo " ...done"
 
24
}
 
25
 
 
26
stop_ntop() {
 
27
    echo -n "Stopping ntop "
 
28
    if test -f /var/run/ntop.pid ; then
 
29
        kill `cat /var/run/ntop.pid`
 
30
        echo -n " killed pid `cat /var/run/ntop.pid`"
 
31
        rm /var/run/ntop.pid
 
32
    fi
 
33
    echo " ...done"
 
34
}
 
35
 
 
36
case "$1" in
 
37
  start)
 
38
    start_ntop
 
39
    ;;
 
40
 
 
41
  stop)
 
42
    stop_ntop
 
43
    ;;
 
44
 
 
45
  restart)
 
46
    stop_ntop
 
47
    start_ntop
 
48
    ;;
 
49
 
 
50
  defaults)
 
51
    $DAEMON -u nobody --set-admin-password=admin
 
52
    ;;
 
53
 
 
54
  *)
 
55
    echo "Usage: /etc/init.d/$NAME {start|stop|restart|install}"
 
56
    exit 1
 
57
    ;;
 
58
esac
 
59
 
 
60
exit 0
 
 
b'\\ No newline at end of file'