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

2.1.1 by Anibal Monsalve Salazar
FTBFS with gcc-3.4: label at end of compound statement (Closes: #258842).
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
3 by Radu Spineanu
Changed build-depends to libmysqlclient12-dev (closes: #299177)
40
		kill -TERM $pid >/dev/null 2>&1
2.1.1 by Anibal Monsalve Salazar
FTBFS with gcc-3.4: label at end of compound statement (Closes: #258842).
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