diff options
author | Yalla-One <yallaone@gmail.com> | 2010-05-11 20:01:55 +0200 |
---|---|---|
committer | Michiel van Wessem <michiel@slackbuilds.org> | 2010-05-11 20:01:55 +0200 |
commit | cc4bb035e088be5f70b558b9b334abc8c9cb338f (patch) | |
tree | d3a61b9b3408f89a9f63a87718d0b9fcf773d53d /system/clamav/rc.clamav | |
parent | 4005438306155237f377642a892d0b2b8fb6bc5e (diff) |
system/clamav: Added to 12.0 repository
Diffstat (limited to 'system/clamav/rc.clamav')
-rw-r--r-- | system/clamav/rc.clamav | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/system/clamav/rc.clamav b/system/clamav/rc.clamav new file mode 100644 index 0000000000000..5197a1c4de49a --- /dev/null +++ b/system/clamav/rc.clamav @@ -0,0 +1,58 @@ +#!/bin/sh +# Start/stop/restart clamav. +# $Id: rc.clamav,v 1.1 2007/02/14 10:29:03 root Exp root $ +# Author: Eric Hameleers <alien@slackware.com> +# --------------------------------------------------------------------------- +# Slightly modified by Robby Workman <rworkman@slackbuilds.org> +# to replace backticks ( s/`command`/$(command)/ ) + +# Set to '1' if you want milter support: +MILTER=0 + +# Start clamav: +clamav_start() { + if [ -x /usr/sbin/clamd ]; then + echo -n "Starting clamd daemon: /usr/sbin/clamd " + /usr/sbin/clamd + echo "." + # Give clamd a chance to create the socket + sleep 1 + echo -n "Starting freshclam daemon: /usr/bin/freshclam -d -l /var/log/freshclam.log " + /usr/bin/freshclam -d -l /var/log/freshclam.log + echo "." + if [ "$MILTER" == "1" ]; then + echo -n "Starting clamav-milter daemon: /usr/sbin/clamav-milter -dblo --max-children=2 local:/var/run/clamav/clmilter.sock " + /usr/sbin/clamav-milter -dblo --max-children=2 local:/var/run/clamav/clmilter.sock + echo "." + fi + fi +} + +# Stop clamav: +clamav_stop() { + kill $(cat /var/run/clamav/clamd.pid) + #killall freshclam + kill $(cat /var/run/clamav/freshclam.pid) + [ "$MILTER" == "1" ] && killall clamav-milter +} + +# Restart clamav: +clamav_restart() { + clamav_stop + sleep 1 + clamav_start +} + +case "$1" in +'start') + clamav_start + ;; +'stop') + clamav_stop + ;; +'restart') + clamav_restart + ;; +*) + echo "usage $0 start|stop|restart" +esac |