27 lines
380 B
Bash
Executable File
27 lines
380 B
Bash
Executable File
#!/bin/bash
|
|
set -e
|
|
|
|
NAME="CLAMAV"
|
|
|
|
function stop {
|
|
echo "Stopping ${NAME}"
|
|
kill $(cat /var/run/clamav/clamd.pid)
|
|
}
|
|
|
|
trap 'stop' SIGTERM
|
|
|
|
if [ "$1" == "start" ]; then
|
|
chown -R clamav:clamav /var/lib/clamav
|
|
|
|
[ -f /var/lib/clamav/daily.cvd ] || /usr/bin/freshclam
|
|
|
|
# Update Daemon
|
|
/usr/bin/freshclam -dc 6
|
|
|
|
[ -x /usr/sbin/clamd ] && /usr/sbin/clamd &
|
|
|
|
wait
|
|
else
|
|
exec $@
|
|
fi
|