#!/sbin/runscript # Copyright 1999-2004 Gentoo Foundation # Distributed under the terms of the GNU General Public License v2 # $Header: /var/cvsroot/gentoo-x86/app-antivirus/clamav/files/clamd.rc,v 1.6 2005/01/27 08:39:02 ticho Exp $ depend() { use net provide antivirus } start() { if [ "${START_CLAMD}" = "yes" ]; then if [ -S "/tmp/clamd" ]; then rm -f /tmp/clamd fi if [ -n "${CLAMD_LOG}" -a ! -f "${CLAMD_LOG}" ]; then touch "${CLAMD_LOG}" chown clamav:clamav "${CLAMD_LOG}" CLAMD_OPTS="${CLAMD_OPTS}${CLAMD_LOG}" fi ebegin "Starting clamd" start-stop-daemon --start --quiet \ --exec /usr/sbin/clamd -- ${CLAMD_OPTS} eend $? "Failed to start clamd" fi if [ "${START_FRESHCLAM}" = "yes" ]; then if [ -n "${FRESHCLAM_LOG}" ]; then if [ ! -f "${FRESHCLAM_LOG}" ]; then touch "${FRESHCLAM_LOG}" chown clamav:clamav "${FRESHCLAM_LOG}" fi FRESHCLAM_OPTS="${FRESHCLAM_OPTS} -l ${FRESHCLAM_LOG}" fi ebegin "Starting freshclam" start-stop-daemon --start --quiet \ --exec /usr/bin/freshclam -- ${FRESHCLAM_OPTS} eend $? "Failed to start freshclam" fi } stop() { if [ "${START_CLAMD}" = "yes" ]; then ebegin "Stopping clamd" start-stop-daemon --stop --quiet --name clamd eend $? "Failed to stop clamd" fi if [ "${START_FRESHCLAM}" = "yes" ]; then ebegin "Stopping freshclam" start-stop-daemon --stop --quiet --name freshclam eend $? "Failed to stop freshclam" fi }