1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-07 06:40:06 +00:00
freebsd-ports/mail/spampd/files/spampd.in
Pav Lucistnik e372d60153 - Switch to rc_subr startup script. The app will now run under spamd user by
default

PR:		ports/99794
Submitted by:	Marshal Newrock <marshal@idealso.com>
Approved by:	maintainer timeout (3 months)
2006-10-07 11:47:19 +00:00

48 lines
904 B
Bash

#!/bin/sh
#
# PROVIDE: spampd
#
# Add the fellowing line to /etc/rc.conf to enable spampd:
#
# spampd_enable (bool): Set it to "YES" to enable spampd
# Default is "NO"
# spampd_flags
. %%RC_SUBR%%
name="spampd"
rcvar=`set_rcvar`
: ${spampd_enable="NO"}
: ${spampd_pidfile="/var/run/spamd/spampd.pid"}
: ${spampd_flags="--user=spamd --group=spamd --host 127.0.0.1:10024 --relayhost=127.0.0.1:10025 --dose --tagall --auto-whitelist"}
load_rc_config $name
command="%%PREFIX%%/sbin/$name"
command_args="${spampd_flags} --pid=${spampd_pidfile}"
pidfile="${spampd_pidfile}"
sig_stop="-KILL"
stop_cmd="stop_cmd"
status_cmd="status_cmd"
stop_cmd()
{
if [ -f "$pidfile" ]; then
kill `cat $pidfile`
rm -f $pidfile
echo -n " spampd"
fi
}
status_cmd()
{
if [ -f "$pidfile" ]; then
echo "${name} is running as pid `cat $pidfile`."
else
echo "${name} is not running."
fi
}
run_rc_command $1