clamav/init

22 lines
477 B
Plaintext
Raw Normal View History

2017-06-02 13:48:48 +00:00
#!/bin/bash
set -e
NAME="CLAMAV"
function stop {
echo "Stopping ${NAME}"
kill $(cat /var/run/clamd.pid)
kill $(cat /var/run/clamav-milter.pid)
}
trap 'stop' SIGTERM
if [ "$1" == "start" ]; then
[ -x /usr/sbin/clamd -a -x /usr/bin/freshclam ] && /usr/bin/freshclam --config-file=/etc/clamav/freshclam.conf && /usr/sbin/clamd -c /etc/clamav/clamd.conf
[ -x /usr/sbin/clamav-milter ] && /usr/sbin/clamav-milter -c /etc/clamav/clamav-milter.conf &
wait
else
exec $@
fi