Sophie

Sophie

distrib > Mandriva > 2009.1 > x86_64 > media > contrib-release-src > by-pkgid > 13d6c9f190ea885fe63b7f8bd1cdddfb > files > 2

flow-tools-0.68-5mdv2009.0.src.rpm

#!/bin/sh
#
# flow-capture	Captures flow PDU's from a Cisco router.
#
#		Written by Miquel van Smoorenburg <miquels@cistron.nl>.
#		Modified for Debian GNU/Linux by
#		Ian Murdock <imurdock@gnu.ai.mit.edu> and
#		Anibal Monsalve Salazar <A.Monsalve.Salazar@IEEE.org>
#		Adapted for Mandrakelinux by
#		Oden Eriksson <oeriksson@mandrakesoft.com>
#
# chkconfig: 345 55 45
# description: flow-capture captures flow PDU's from a Cisco router.
# probe: false
# processname: flow-capture
# pidfile: /var/run/flow-capture.pid
# config: /etc/flow-capture.conf

# Source function library.
. /etc/rc.d/init.d/functions

# Source networking configuration.
. /etc/sysconfig/network

# Check that networking is up.
[ "${NETWORKING}" = "no" ] && exit 0

[ -f /etc/flow-capture.conf ] || exit 0

[ -f /usr/sbin/flow-capture ] || exit 0

# See how we were called.
case "$1" in
start)
  	IFS=$'\n'
	lines=`grep -E " |\t" /etc/flow-capture.conf | grep -v "^#"`
	echo -n "Starting flow-capture: "
	for args in $lines; do
	    IFS=$' '
	    daemon flow-capture ${args}
	done
	echo
	touch /var/lock/subsys/flow-capture
	;;
stop)
	echo -n "Stopping flow-capture: "
	killproc flow-capture
	echo
	rm -f /var/lock/subsys/flow-capture
	;;
status)
	status flow-capture
	;;
restart|reload)
	$0 stop
	$0 start
	;;
condrestart)
	[ -f /var/lock/subsys/flow-capture ] && restart
	;;
  *)
	echo "Usage: flow-capture {start|stop|status|restart|condrestart|reload}"
	exit 1
esac

exit 0