Created
November 19, 2015 14:57
-
-
Save kaworu/d2d29b4d00746f4ec370 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# PROVIDE: rmilter | |
# REQUIRE: LOGIN | |
# BEFORE: mail | |
# KEYWORD: shutdown | |
# | |
# Add the following line to /etc/rc.conf to enable rmilter: | |
# rmilter (bool): Set to "NO" by default. | |
# Set it to "YES" to enable rmilter. | |
. /etc/rc.subr | |
name="rmilter" | |
rcvar=rmilter_enable | |
command="/usr/local/sbin/rmilter" | |
load_rc_config $name | |
: ${rmilter_enable="NO"} | |
: ${rmilter_pidfile="/var/run/rmilter/rmilter.pid"} | |
: ${rmilter_socket="/var/run/rmilter/rmilter.sock"} | |
: ${rmilter_user="_rmilter"} | |
: ${rmilter_group="mail"} | |
rmilter_cleanup() { | |
rm -f $rmilter_pidfile || true | |
if [ -n $rmilter_socket ] && [ -S $rmilter_socket ] ; then | |
rm -f $rmilter_socket || true | |
fi | |
} | |
rmilter_fixupbloodylibmilter() { | |
if [ -n $rmilter_socket ] && [ -S $rmilter_socket ] ; then | |
chown ${rmilter_user}:${rmilter_group} $rmilter_socket | |
chmod 774 $rmilter_socket | |
fi | |
} | |
start_precmd=rmilter_cleanup | |
start_postcmd=rmilter_fixupbloodylibmilter | |
stop_postcmd=rmilter_cleanup | |
extra_commands="reload" | |
sig_reload="USR1" | |
command_args="$procname -n -c /usr/local/etc/rmilter.conf" | |
run_rc_command "$1" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment