#!/bin/sh
#
# $FreeBSD: ports/mail/prayer/files/prayer.sh,v 1.1 2004/01/06 10:01:22 dinoex Exp $
# 
if ! test -x %%PREFIX%%/prayer/sbin/prayer
then
	exit 0
fi
#
case "$1" in
start)
        %%PREFIX%%/prayer/sbin/prayer &&
        echo -n ' prayer'
	;;
stop)
	for i in \
		/var/spool/prayer/pid/prayer-session \
		/var/spool/prayer/pid/prayer
	do
		if test -e ${i}
		then
			kill `head -1 ${i}`
			rm -f "${i}"
		fi
	done
	killall prayer-session
	killall prayer
        echo -n ' prayer'
	;;
restart)
	$0 stop
	$0 start
	;;
*)
	echo "Usage: ${0##*/}: { start | stop | restart }" >&2
	exit 64
	;;
esac


syntax highlighted by Code2HTML, v. 0.9.1