#!/bin/sh exec 2>&1 CLAMD_FILE=/tmp/clamd SCAN_FILE=$0 if [ -e $CLAMD_FILE ] then echo "run: WARNING: file $CLAMD_FILE exists" echo "run: Lets see if a scanner is already running. If not, then we remove the file." if clamdscan $SCAN_FILE then echo "run: Clamd is already running. Please fix this." echo "run: The clamd startup will most likely fail, but we will try it anyway." else echo "run: Clamd is not running. Removing file $CLAMD_FILE" rm -f $CLAMD_FILE fi fi exec setuidgid Gqscanq /usr/local/sbin/clamd