
# rc script for cflowd 2.x
# D Plonka, May  3 1999

bindir=/usr/local/arts/sbin
logfile=/dev/null
conf=/usr/local/etc/cflowd.conf
user=net

su=/bin/su
nohup=/usr/bin/nohup
kill=/bin/kill
ps=/bin/ps
grep=/bin/grep
awk=/usr/bin/awk
nice=/usr/bin/nice
niceness=0

case "$1" in
'start')
	echo "starting cflowdmux"
	${nice} --${niceness} ${su} - ${user} -c "${bindir}/cflowdmux ${conf}"
	echo "starting cflowd"
	${nice} --${niceness} ${su} - ${user} -c "${bindir}/cflowd -s 300 -O 0 -m ${conf}"
	;;
 
'stop')
	echo "killing cflowd"
        pid=`${ps} ax |${grep} "${bindir}/[c]flowd " |${awk} '{print $1}'`
	if [ -n "$pid" ]
	then
	   ${kill} $pid
	fi

	echo "killing cflowdmux"
        pid=`${ps} ax |${grep} "${bindir}/[c]flowdmux " |${awk} '{print $1}'`
	if [ -n "$pid" ]
	then
	   ${kill} $pid
	fi
	;;
esac
