27 lines
385 B
Plaintext
Raw Normal View History

2017-06-02 23:48:48 +10:00
#!/bin/bash
set -e
NAME="CLAMAV"
function stop {
echo "Stopping ${NAME}"
2018-01-30 22:41:32 +11:00
kill $(cat /var/run/clamav/clamd.pid)
2017-06-02 23:48:48 +10:00
}
trap 'stop' SIGTERM
if [ "$1" == "start" ]; then
2018-01-30 22:41:32 +11:00
chown -R clamav:clamav /var/lib/clamav
[ -f /var/lib/clamav/daily.cvd ] || /usr/bin/freshclam
# Update Daemon
/usr/bin/freshclam -dc 6
2018-01-31 10:22:05 +11:00
[ -x /usr/sbin/clamd ] && exec /usr/sbin/clamd &
2017-06-02 23:48:48 +10:00
wait
else
exec $@
fi