1
0
mirror of https://git.FreeBSD.org/ports.git synced 2025-01-08 06:48:28 +00:00
freebsd-ports/mail/assp/files/510.assp.in
Beech Rintoul 48bd66ae6c - Update to 1.3.3.10
PR:		ports/126363
Submitted by:	J.R. Oldroyd <fbsd@opal.com> (maintainer)
2008-08-16 18:12:15 +00:00

42 lines
948 B
Bash

#!/bin/sh
#
# $FreeBSD$
#
# Update ASSP Spam and ClamAV databases
cd %%ASSP_HOME%%
if [ ! -f %%PREFIX%%/lib/assp/rebuildspamdb.pl ]
then
echo "%%PREFIX%%/lib/assp/rebuildspamdb.pl does not exist"
rc_spamdb=2
else
echo ""
echo "Running ASSP rebuildspamdb.pl:"
%%PERL%% %%PREFIX%%/lib/assp/rebuildspamdb.pl && rc_spamdb=0 || rc_spamdb=3
fi
if [ ! -f %%PREFIX%%/lib/assp/freshclam.sh ]
then
# existence of freshclam.sh is optional, dependent
# on the WITH_CLAMAV setting, so not an error if not there
rc_clamav=0
else
echo ""
echo "Fetching ASSP ClamAV virus database updates:"
export PATH=$PATH:%%LOCALBASE%%/bin
sh %%PREFIX%%/lib/assp/freshclam.sh && rc_clamav=0 || rc_clamav=3
fi
. %%RC_SUBR%%
name=assp
rcvar=`set_rcvar`
load_rc_config $name
: ${assp_logexpire="45"}
echo ""
echo "Removing old ASSP log files:"
find . -name '*.maillog.txt' -mtime +$assp_logexpire -exec ls -l {} \; -exec rm {} \;
exit $(($rc_spamdb|$rc_clamav))