ClamAV is an open source (GPLv2) anti-virus toolkit.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
clamav/contrib/init/Solaris10/clamav-milter

29 lines
602 B

#!/bin/sh
CONF_FILE=/usr/local/etc/clamd.conf
RUNDIR=/var/run/clamav
CLAMAV_MILTER_FLAGS="-l --max-children=2 local:$RUNDIR/clmilter.sock"
if [ ! -f $CONF_FILE ]; then
exit 0
fi
if [ ! -d $RUNDIR ]; then
/usr/bin/mkdir -p -m 700 $RUNDIR
USER=`fgrep User ${CONF_FILE} | awk '{ print $2 }'`
if [ x$USER != x ]; then
chown $USER $RUNDIR
fi
fi
case "$1" in
start)
sleep 1 ;# allow time for clamd to start
/usr/local/sbin/clamav-milter $CLAMAV_MILTER_FLAGS
;;
stop)
kill `ps -ef | awk '$NF ~ /clamav-milter/ { print $2 }'` > /dev/null 2>&1
;;
*)
echo "usage: $0 {start|stop}"
esac