aboutsummaryrefslogtreecommitdiffstats
path: root/packages/dspam/pkg/030.p3scan.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/030.p3scan.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/030.p3scan.sh')
-rw-r--r--packages/dspam/pkg/030.p3scan.sh60
1 files changed, 60 insertions, 0 deletions
diff --git a/packages/dspam/pkg/030.p3scan.sh b/packages/dspam/pkg/030.p3scan.sh
new file mode 100644
index 00000000..ffd08abf
--- /dev/null
+++ b/packages/dspam/pkg/030.p3scan.sh
@@ -0,0 +1,60 @@
+#!/bin/sh
+# This file was automatically generated
+# by the pfSense service handler
+
+rc_start() {
+test_p3scan_user=`cat /etc/passwd | grep p3scan`
+test_p3scan_group=`cat /etc/passwd | grep p3scan`
+
+if [ -z "${test_p3scan_group}" ]; then
+ pw groupadd p3scan -g 108
+fi
+
+if [ -z "${test_p3scan_user}" ]; then
+ pw useradd p3scan -u 108 -g p3scan -d /var/spool/p3scan -s /sbin/nologin -c 'P3Scan Daemon'
+fi
+
+if [ ! -d "/var/spool/p3scan" ]; then
+ mkdir /var/spool/p3scan && chown p3scan:p3scan /var/spool/p3scan
+fi
+
+if [ ! -d "/var/spool/p3scan/children" ]; then
+ mkdir /var/spool/p3scan/children && chown p3scan:p3scan /var/spool/p3scan/children
+fi
+
+if [ ! -d "/var/spool/p3scannotify" ]; then
+ mkdir /var/spool/p3scannotify && chown p3scan:p3scan /var/spool/p3scannotify
+fi
+
+if [ ! -d "/var/run/p3scan" ]; then
+ mkdir /var/run/p3scan && chown p3scan:p3scan /var/run/p3scan
+fi
+
+ /sbin/mount_fdescfs fdescfs /dev/fd
+ /usr/local/sbin/p3scan --configfile=/usr/local/etc/p3scan/p3scan.conf &
+}
+
+rc_stop() {
+ /usr/bin/killall p3scan
+ 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