freebsd-ports/security/clamav-devel/files/clamav-clamd.in
Renato Botelho a6a0eaab90 - Fix checking of database viruses at startup script that i broke on last
commit
- Bump PORTREVISION again

Submitted by:	George L. Yermulnik <yz@iptcom.net>
Pointyhat to:	me
2008-06-17 11:20:04 +00:00

44 lines
806 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# PROVIDE: clamd
# REQUIRE: LOGIN
# BEFORE: mail
# KEYWORD: shutdown
#
# Add the following lines to /etc/rc.conf to enable clamd:
#
#clamav_clamd_enable="YES"
#
# See clamd(8) for flags
#
. %%RC_SUBR%%
name=clamav_clamd
rcvar=`set_rcvar`
command=%%PREFIX%%/sbin/clamd
pidfile=%%RUNDIR%%/clamd.pid
required_dirs=%%DBDIR%%
required_files=%%PREFIX%%/etc/clamd.conf
# read settings, set default values
load_rc_config "$name"
: ${clamav_clamd_enable="NO"}
: ${clamav_clamd_flags=""}
: ${clamav_clamd_socket="%%CLAMAV_CLAMD_SOCKET%%"}
start_precmd=clamav_clamd_precmd
clamav_clamd_precmd() {
if [ ! -f %%DBDIR%%/main.cvd -a ! -f %%DBDIR%%/main.cld ];then
echo "Missing %%DBDIR%%/clamav/*.cvd or *.cld files. You must run freshclam first"
exit 1
fi
}
run_rc_command "$1"