aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dspam/pkg/010.clamav-clamd.sh
diff options
context:
space:
mode:
authorDaniel Stefan Haischt <dsh@pfsense.org>2006-07-15 22:16:04 +0000
committerDaniel Stefan Haischt <dsh@pfsense.org>2006-07-15 22:16:04 +0000
commit3eab27426aa39497d87a9fb768fd860f924e10be (patch)
tree729d886e70f6cd07f138bd72cf6308a1908ec9db /packages/dspam/pkg/010.clamav-clamd.sh
parent5ea99d5d96bb72340cdb7d24e1258cb07b5cdfa1 (diff)
downloadpfsense-packages-3eab27426aa39497d87a9fb768fd860f924e10be.tar.gz
pfsense-packages-3eab27426aa39497d87a9fb768fd860f924e10be.tar.bz2
pfsense-packages-3eab27426aa39497d87a9fb768fd860f924e10be.zip
- initial version of the DSPAM package
Diffstat (limited to 'packages/dspam/pkg/010.clamav-clamd.sh')
-rw-r--r--packages/dspam/pkg/010.clamav-clamd.sh56
1 files changed, 56 insertions, 0 deletions
diff --git a/packages/dspam/pkg/010.clamav-clamd.sh b/packages/dspam/pkg/010.clamav-clamd.sh
new file mode 100644
index 00000000..aeb23b04
--- /dev/null
+++ b/packages/dspam/pkg/010.clamav-clamd.sh
@@ -0,0 +1,56 @@
+#!/bin/sh
+# This file was automatically generated
+# by the pfSense service handler
+
+rc_start() {
+test_clamav_group=`cat /etc/group | grep clam`
+test_clamav_user=`cat /etc/passwd | grep clam`
+
+if [ -z "${test_clamav_group}" ]; then
+ pw groupadd clamav -g 106
+fi
+
+if [ -z "${test_clamav_user}" ]; then
+ pw useradd clamav -u 106 -g 106 -d /nonexistent -s /sbin/nologin -c 'Clam Antivirus'
+fi
+
+if [ ! -d "/usr/local/share/clamav" ]; then
+ mkdir /usr/local/share/clamav && chown clamav:clamav /usr/local/share/clamav
+fi
+
+if [ ! -d "/var/log/clamav" ]; then
+ mkdir /var/log/clamav && chown clamav:clamav /var/log/clamav
+fi
+
+if [ ! -d "/var/run/clamav" ]; then
+ mkdir /var/run/clamav && chown clamav:clamav /var/run/clamav
+fi
+
+ /sbin/mount_fdescfs fdescfs /dev/fd
+ /usr/local/sbin/clamd
+}
+
+rc_stop() {
+ /usr/bin/killall clamd
+ sleep 2
+}
+
+rc_restart() {
+ rc_stop
+ rc_start
+}
+
+case $1 in
+ start)
+ rc_start
+ ;;
+ stop)
+ rc_stop
+ ;;
+ restart)
+ rc_restart
+ ;;
+ *)
+ echo "Usage: $0 <start|stop|restart>"
+ ;;
+esac