summaryrefslogtreecommitdiff
path: root/system/clamav/rc.clamav
diff options
context:
space:
mode:
authorponce <matteo.bernardini@gmail.com>2011-09-23 12:24:45 -0300
committerNiels Horn <niels.horn@slackbuilds.org>2011-09-23 12:24:45 -0300
commit6eb187c4a49e24c7073c9bc0739bb0bdc2af0973 (patch)
tree04e4c334e7bdf7bf9c379336637347da8275329b /system/clamav/rc.clamav
parente88a3ceca0552f36fe086554483239aa223a14a8 (diff)
downloadslackbuilds-6eb187c4a49e24c7073c9bc0739bb0bdc2af0973.tar.gz
system/clamav: Updated for version 0.97.2 (+new maintainer)
Signed-off-by: Niels Horn <niels.horn@slackbuilds.org>
Diffstat (limited to 'system/clamav/rc.clamav')
-rw-r--r--system/clamav/rc.clamav59
1 files changed, 59 insertions, 0 deletions
diff --git a/system/clamav/rc.clamav b/system/clamav/rc.clamav
new file mode 100644
index 0000000000..43940738a4
--- /dev/null
+++ b/system/clamav/rc.clamav
@@ -0,0 +1,59 @@
+#!/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
+