#!/bin/sh
# $Owl: Owl/packages/popa3d/popa3d.init,v 1.6 2005/11/16 13:28:58 solar Exp $
#
# chkconfig: - 50 50
# description: \
#	popa3d is a small POP3 server with security as its primary \
#	design goal.
# processname: popa3d

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

OWL_STARTUP_ENABLE=1

case "$1" in
start)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		daemon --expect-user root -- popa3d -D
	else
# Red Hat's implementation of daemon() would get confused by multiple
# popa3d processes.
		/usr/sbin/popa3d -D
	fi
	;;
stop)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		killproc --expect-user root popa3d
	else
		killproc popa3d
	fi
	;;
restart)
	$0 stop
	$0 start
	;;
status)
	if [ "0$OWL_STARTUP_VERSION" -ge 3 ]; then
		status --expect-user root popa3d
	else
		status popa3d
	fi
	;;
*)
	echo "Usage: popa3d {start|stop|restart|status}"
	exit 1
esac

exit $?
