summaryrefslogtreecommitdiffstats
path: root/testing/dspam/dspam.initd
diff options
context:
space:
mode:
authorNatanael Copa <ncopa@alpinelinux.org>2010-01-06 16:36:19 +0000
committerNatanael Copa <ncopa@alpinelinux.org>2010-01-06 16:36:19 +0000
commit768e3586d89f22da78c1655f851ed759255cf556 (patch)
tree8a0c529b36d93eb3dc2db9c8c0a0effb6d95a98c /testing/dspam/dspam.initd
parent8533b151798c4012d6f179f1b84cd9ad0f6bebbd (diff)
testing/dspam: new aport
A statistical-algorithmic hybrid anti-spam filter http://dspam.nuclearelephant.com/
Diffstat (limited to 'testing/dspam/dspam.initd')
-rw-r--r--testing/dspam/dspam.initd46
1 files changed, 46 insertions, 0 deletions
diff --git a/testing/dspam/dspam.initd b/testing/dspam/dspam.initd
new file mode 100644
index 00000000000..d91fefeb890
--- /dev/null
+++ b/testing/dspam/dspam.initd
@@ -0,0 +1,46 @@
+#!/sbin/runscript
+# Copyright 1999-2005 Gentoo Foundation
+# Distributed under the terms of the GNU General Public License v2
+# $Header: /var/cvsroot/gentoo-x86/mail-filter/dspam/files/dspam.rc,v 1.1 2005/03/21 00:10:30 st_lim Exp $
+
+conf=/etc/dspam/dspam.conf
+
+depend() {
+ use logger
+ need net
+ before mta
+ after pg_autovacuum postgresql mysql
+}
+
+checkconfig() {
+ if [ ! -f "$conf" ]
+ then
+ eerror "You need a DSPAM configuration in $conf"
+ return 1
+ fi
+ if (! grep -q "^ServerPID" $conf); then
+ eerror "ServerPID missing in DSPAM configuration $conf"
+ return 1
+ fi
+}
+
+start() {
+ checkconfig || return 1
+
+ ebegin "Starting DSPAM"
+ start-stop-daemon --start --quiet --background \
+ --exec /usr/bin/dspam -- --daemon
+ eend ${?}
+}
+
+stop() {
+ checkconfig || return 1
+
+ local DSPAM_PID="$(grep "^ServerPID" $conf)"
+ DSPAM_PID="${DSPAM_PID/ServerPID/}"
+
+ ebegin "Stopping DSPAM"
+ start-stop-daemon --stop --quiet --pidfile ${DSPAM_PID}
+ eend ${?}
+}
+