diff options
Diffstat (limited to 'scripts')
-rw-r--r-- | scripts/clamsmtpd.sh | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/scripts/clamsmtpd.sh b/scripts/clamsmtpd.sh new file mode 100644 index 0000000..c574e8b --- /dev/null +++ b/scripts/clamsmtpd.sh @@ -0,0 +1,42 @@ +#!/bin/sh + +########################################################################### +# CONFIGURATION + +# The outgoing SMTP server (CHANGE THIS) +smtp=mysmtp.com:25 + +# Directory for temporary files (CHANGE THIS) +tmpdir=/var/tmp + +# The user to run as +user=clamav + +# The prefix clamsmtpd was installed to +prefix=/usr/local/ + +# The location for pid file +piddir=/var/run/clamav/ + +# The clamd socket +clamsock=/var/run/clamav/clamd + + +########################################################################### +# SCRIPT + +case $1 in +start) + mkdir -p $piddir + chown $user $piddir + su -m $user -c "$prefix/sbin/clamsmtpd -c $clamsock -D $tmpdir -p $piddir/clamsmtpd.pid $smtp" + echo -n "clam-smtpd " + ;; +stop) + [ -f $piddir/clamsmtpd.pid ] && kill `cat $piddir/clamsmtpd.pid` + echo -n "clam-smtpd " + ;; +*) + echo "usage: clamsmptd.sh {start|stop}" >&2 + ;; +esac |