~ubuntu-branches/ubuntu/quantal/flow-tools/quantal

« back to all changes in this revision

Viewing changes to debian/flow-tools.flow-capture.init

  • Committer: Bazaar Package Importer
  • Author(s): Radu Spineanu
  • Date: 2005-03-12 12:16:25 UTC
  • mfrom: (2.1.1 hoary)
  • Revision ID: james.westby@ubuntu.com-20050312121625-pie3by46jk459zzv
Tags: 1:0.67-8
Changed build-depends to libmysqlclient12-dev (closes: #299177)

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#!/bin/sh -e
 
2
#
 
3
# flow-capture  Captures flow PDU's from a Cisco router.
 
4
#
 
5
#               Written by Miquel van Smoorenburg <miquels@cistron.nl>.
 
6
#               Modified for Debian GNU/Linux by
 
7
#               Ian Murdock <imurdock@gnu.ai.mit.edu> and
 
8
#               Anibal Monsalve Salazar <A.Monsalve.Salazar@IEEE.org>
 
9
 
 
10
PATH=/usr/local/sbin:/usr/local/bin:/sbin:/bin:/usr/sbin:/usr/bin
 
11
DAEMON=/usr/bin/flow-capture
 
12
CONFIG=/etc/flow-tools/flow-capture.conf
 
13
NAME=flow-capture
 
14
DESC=flow-capture
 
15
 
 
16
test -f $DAEMON || exit 0
 
17
test -f $CONFIG || exit 0
 
18
 
 
19
pid=`pidof $DAEMON` || true
 
20
 
 
21
case "$1" in
 
22
  start)
 
23
        if [ "$pid" ]; then
 
24
                echo "Sorry, flow-capture is already running."
 
25
                exit 0
 
26
        fi
 
27
        IFS=$'\n'
 
28
        lines=`grep -E " |\t" /etc/flow-tools/flow-capture.conf | grep -v "^#"`
 
29
        echo -n "Starting $DESC: "
 
30
        for args in $lines; do
 
31
                IFS=$' '
 
32
                $DAEMON ${args}
 
33
        done
 
34
        echo "$NAME."
 
35
        ;;
 
36
  stop)
 
37
        echo -n "Stopping $DESC: "
 
38
        pid=`pidof $DAEMON` || true
 
39
        if [ "$pid" ]; then
 
40
                kill -TERM $pid >/dev/null 2>&1
 
41
        fi
 
42
        echo "$NAME."
 
43
        ;;
 
44
  restart|force-reload)
 
45
        $0 stop
 
46
        $0 start
 
47
        ;;
 
48
  *)
 
49
        N=/etc/init.d/$NAME
 
50
        echo "Usage: $N {start|stop|restart|force-reload}" >&2
 
51
        exit 1
 
52
        ;;
 
53
esac
 
54
 
 
55
exit 0