#!/bin/sh
#
# $FreeBSD: ports/mail/popular/files/pserv.sh.in,v 1.2 2007/03/27 22:17:11 pav Exp $
#
# PROVIDE: pserv
# REQUIRE: NETWORKING SERVERS
# BEFORE: DAEMON
# KEYWORD: shutdown
# /etc/rc.conf lines:
# pserv_enable="YES" # enable pserv
# pserv_user="pop" # user for pserv
. %%RC_SUBR%%
name="pserv"
rcvar=`set_rcvar`
load_rc_config $name
: ${pserv_enable="NO"}
: ${pserv_user="pop"}
command="%%PREFIX%%/sbin/pserv"
start_precmd="${name}_prestart"
start_postcmd="${name}_configure"
extra_commands="reload"
reload_cmd="${name}_configure"
pproxy_prestart()
{
mkdir -p /var/log/popular
chown ${pserv_user} /var/log/popular
mkdir -p /var/run/popular
chown ${pserv_user} /var/run/popular
}
pproxy_configure()
{
if [ -f %%PREFIX%%/etc/popular/pserv.rc ]; then
sleep 1;
su -m ${pserv_user} -c "%%PREFIX%%/bin/pcontrol --program=pserv %%PREFIX%%/etc/popular/pserv.rc"
fi
}
run_rc_command "$1"
syntax highlighted by Code2HTML, v. 0.9.1