summaryrefslogtreecommitdiffstats
path: root/spampd/rc-script
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2010-03-17 15:35:18 +0100
committerFlorian Pritz <bluewind@xssn.at>2010-03-17 15:37:03 +0100
commit0e572da1852de5d350bfa95885600ea21f7343a9 (patch)
tree77d347447c470beb43fb370b40fa885cfe2a8423 /spampd/rc-script
parent1dffac4f0cca7bc2f6bdc044e2805edff5be1c87 (diff)
downloadaur-packages-0e572da1852de5d350bfa95885600ea21f7343a9.tar.gz
aur-packages-0e572da1852de5d350bfa95885600ea21f7343a9.tar.xz
add spampd
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'spampd/rc-script')
-rwxr-xr-xspampd/rc-script46
1 files changed, 46 insertions, 0 deletions
diff --git a/spampd/rc-script b/spampd/rc-script
new file mode 100755
index 0000000..364e064
--- /dev/null
+++ b/spampd/rc-script
@@ -0,0 +1,46 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+. /etc/conf.d/spampd
+
+PID=$(cat /var/run/spampd.pid)
+
+start() {
+ stat_busy "Starting Spampd"
+ /usr/bin/spampd $ARGS
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon spampd
+ stat_done
+ fi
+}
+
+stop() {
+ stat_busy "Stopping Spampd"
+ kill $PID
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon postfix
+ stat_done
+ fi
+}
+
+case "$1" in
+ start)
+ start
+ ;;
+ stop)
+ stop
+ ;;
+ restart)
+ # calling 'stop' and 'start' without the $0 fails...
+ $0 stop
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0