9aac569eaa
Where necessary add $FreeBSD$ to the file No PORTREVISION bump necessary because this is a no-op
47 lines
1.1 KiB
Bash
47 lines
1.1 KiB
Bash
#!/bin/sh
|
|
|
|
# $FreeBSD$
|
|
|
|
# Start or stop antivirus
|
|
|
|
# PROVIDE: antivirus
|
|
# REQUIRE: DAEMON
|
|
# BEFORE: mail
|
|
# KEYWORD: shutdown
|
|
#
|
|
|
|
# Define these antivirus_* variables in one of these files:
|
|
# /etc/rc.conf
|
|
# /etc/rc.conf.local
|
|
# /etc/rc.conf.d/antivirus
|
|
#
|
|
# DO NOT CHANGE THESE DEFAULT VALUES HERE
|
|
#
|
|
antivirus_enable=${antivirus_enable:-"NO"} # Enable antivirus-milter
|
|
antivirus_pidfile=${antivirus_pidfile:-"%%ANTIVIRUS%%/run/antivirus.pid"} # Path to pidfile
|
|
antivirus_socket=${antivirus_socket:-"%%ANTIVIRUS%%/antivirus.sock"} # Path to socket
|
|
#antivirus_flags=${antivirus_flags:-""} # Flags to antivirus
|
|
|
|
. /etc/rc.subr
|
|
|
|
name="antivirus"
|
|
rcvar="antivirus_enable"
|
|
command="%%PREFIX%%/libexec/antivirus"
|
|
required_files="%%PREFIX%%/etc/antivirus.conf"
|
|
start_precmd="antivirus_prestart"
|
|
stop_postcmd="antivirus_poststop"
|
|
|
|
antivirus_prestart() {
|
|
/bin/rm -f "${pidfile}" "${antivirus_socket}"
|
|
}
|
|
|
|
antivirus_poststop() {
|
|
/bin/rm -f "${pidfile}" "${antivirus_socket}"
|
|
}
|
|
|
|
load_rc_config $name
|
|
|
|
pidfile="${antivirus_pidfile}"
|
|
command_args="-p local:${antivirus_socket} ${antivirus_flags}"
|
|
|
|
run_rc_command "$1"
|