#/bin/sh
#
# Configure Clam AV 
#
echo "Configuring Anti-Virus scanner..."

# Create amavisd.log
AMAVIS_LOG="/var/log/amavis.log"
if [ ! -e $AMAVIS_LOG ]; then
	touch $AMAVIS_LOG
	chmod 640 $AMAVIS_LOG
	chown clamav:admin $AMAVIS_LOG
fi

# Create clamav.log
CLAMAV_LOG="/var/log/clamav.log"
if [ ! -e $CLAMAV_LOG ]; then
	touch $CLAMAV_LOG
	chmod 640 $CLAMAV_LOG
	chown clamav:admin $CLAMAV_LOG
fi

# Creage freshclam.log
FRESHCLAM_LOG="/var/log/freshclam.log"
if [ ! -e $FRESHCLAM_LOG ]; then
	touch $FRESHCLAM_LOG
	chmod 640 $FRESHCLAM_LOG
	chown clamav:admin $FRESHCLAM_LOG
fi

# Set clamav home to /var/clamav
`/usr/bin/niutil -createprop . /users/clamav home /var/clamav`

echo "done."
