1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-14 07:43:06 +00:00
freebsd-ports/mail/noattach/files/noattach.in
Doug Barton 9aac569eaa Move the rc.d scripts of the form *.sh.in to *.in
Where necessary add $FreeBSD$ to the file

No PORTREVISION bump necessary because this is a no-op
2012-08-05 23:19:36 +00:00

54 lines
1.1 KiB
Bash

#!/bin/sh
# $FreeBSD$
# Start or stop noattach
# PROVIDE: noattach
# REQUIRE: DAEMON
# BEFORE: mail
# KEYWORD: shutdown
#
# Define these noattach_* variables in one of these files:
# /etc/rc.conf
# /etc/rc.conf.local
# /etc/rc.conf.d/noattach
#
# DO NOT CHANGE THESE DEFAULT VALUES HERE
#
# noattach_flags Flags to noattach
noattach_enable=${noattach_enable:-"NO"} # Enable noattach
noattach_pidfile=${noattach_pidfile:-"/var/run/noattach.pid"} # Path to pidfile
noattach_socket=${noattach_socket:-"/var/run/noattach"} # Path to socket
. /etc/rc.subr
name="noattach"
rcvar="noattach_enable"
command="%%PREFIX%%/libexec/${name}"
required_files="%%PREFIX%%/etc/noattach.patterns"
start_precmd="noattach_prestart"
stop_postcmd="noattach_poststop"
reload_cmd="noattach_reload"
extra_commands="reload"
noattach_prestart() {
/bin/rm -f "${pidfile}" "${noattach_socket}"
}
noattach_poststop() {
/bin/rm -f "${pidfile}" "${noattach_socket}"
}
noattach_reload() {
kill -USR1 `head -1 "${pidfile}"`
}
load_rc_config $name
pidfile="${noattach_pidfile}"
command_args="-p local:${noattach_socket} ${noattach_flags}"
run_rc_command "$1"