#!/bin/sh # Start/stop/restart clamd. # Start clamd: clamd_start() { if [ -x /usr/sbin/clamd ]; then echo "Starting clamd: /usr/sbin/clamd" /usr/sbin/clamd -c /etc/clamav/clamav.conf echo "done." fi } # Stop clamd: clamd_stop() { killall clamd rm -rf /var/run/clamav/clamd.pid rm -rf /var/run/clamav/clamd.sock } # Restart clamd: clamd_restart() { clamd_stop sleep 1 clamd_start } case "$1" in 'start') clamd_start ;; 'stop') clamd_stop ;; 'restart') clamd_restart ;; *) echo "usage $0 start|stop|restart" esac