aboutsummaryrefslogtreecommitdiff
path: root/mail/antivirus-milter/files
diff options
context:
space:
mode:
authorDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
committerDirk Meyer <dinoex@FreeBSD.org>2020-04-16 14:49:59 +0000
commitae5215e025daae99b3ebfe22cd65310eebbdfc70 (patch)
tree95bc399a7e716d1a06cd630891cabc9b67eedc7b /mail/antivirus-milter/files
parentbc119880610cc9f9b32a3d34644e515755fd6575 (diff)
downloadports-ae5215e025daae99b3ebfe22cd65310eebbdfc70.tar.gz
ports-ae5215e025daae99b3ebfe22cd65310eebbdfc70.zip
- cleanup rc.d script
Notes
Notes: svn path=/head/; revision=531850
Diffstat (limited to 'mail/antivirus-milter/files')
-rw-r--r--mail/antivirus-milter/files/antivirus.in (renamed from mail/antivirus-milter/files/antivirus-milter.in)32
1 files changed, 17 insertions, 15 deletions
diff --git a/mail/antivirus-milter/files/antivirus-milter.in b/mail/antivirus-milter/files/antivirus.in
index 57ace61e9835..485894520c59 100644
--- a/mail/antivirus-milter/files/antivirus-milter.in
+++ b/mail/antivirus-milter/files/antivirus.in
@@ -1,15 +1,15 @@
#!/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
@@ -17,31 +17,33 @@
#
# 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"
+desc="Antivirus Milter Daemon"
rcvar="antivirus_enable"
+
+load_rc_config $name
+
+: ${antivirus_enable:="NO"}
+: ${antivirus_pidfile:="%%ANTIVIRUS%%/run/antivirus.pid"}
+: ${antivirus_socket:="%%ANTIVIRUS%%/antivirus.sock"}
command="%%PREFIX%%/libexec/antivirus"
+command_args="-p local:${antivirus_socket} ${antivirus_flags}"
+pidfile="${antivirus_pidfile}"
required_files="%%PREFIX%%/etc/antivirus.conf"
start_precmd="antivirus_prestart"
stop_postcmd="antivirus_poststop"
-antivirus_prestart() {
+antivirus_prestart()
+{
/bin/rm -f "${pidfile}" "${antivirus_socket}"
}
-antivirus_poststop() {
+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"