#!/bin/sh # # Start/Stop the Clam AntiVirus daemon # start() { echo "Starting clamd: " if [ -e /tmp/clamd ]; then echo "/tmp/clamd file exists! Remove it before starting" echo "the Clam AntiVirus daemon" exit 1 fi test1=`grep "^Example" /etc/clamav/freshclam.conf` test2=`grep "^Example" /etc/clamav/clamd.conf` if [ "$test1" = "Example" -o "$test2" = "Example" ]; then echo "You should edit the files in /etc/clamav, and run \ freshclam to update clamav before starting it !" exit 1 fi /usr/sbin/clamd } stop() { echo "Stopping clamd: " killall -9 clamd rm -rf /tmp/clamd 2> /dev/null } restart() { stop start } case "$1" in 'start') start ;; 'stop') stop ;; 'restart') restart ;; *) echo "Usage $0 start|stop|restart" esac