From 1732308adb7885b00fc388f978e65b3ad15aa067 Mon Sep 17 00:00:00 2001 From: root Date: Sat, 2 Jul 2011 23:10:09 +0000 Subject: Sat Jul 2 23:10:09 UTC 2011 --- community/courier-mta/courier.rc.d | 45 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 45 insertions(+) create mode 100644 community/courier-mta/courier.rc.d (limited to 'community/courier-mta/courier.rc.d') diff --git a/community/courier-mta/courier.rc.d b/community/courier-mta/courier.rc.d new file mode 100644 index 000000000..7c321d452 --- /dev/null +++ b/community/courier-mta/courier.rc.d @@ -0,0 +1,45 @@ +#!/bin/bash + +. /etc/rc.conf +. /etc/rc.d/functions + +case "$1" in + start) + + [ -d /var/run/courier ] || mkdir -p /var/run/courier + chown courier:courier /var/run/courier + + if [ ! -f /var/run/daemons/authdaemond ]; then + echo "ERROR: authdaemond is not running" + stat_fail + exit 1 + fi + + stat_busy "Starting Courier daemon" + /usr/sbin/courier start + if [ $? -gt 0 ]; then + stat_fail + else + add_daemon courier + stat_done + fi + ;; + stop) + stat_busy "Stopping Courier daemon" + /usr/sbin/courier stop > /dev/null + if [ $? -gt 0 ]; then + stat_fail + else + rm_daemon courier + stat_done + fi + ;; + restart) + $0 stop + sleep 1 + $0 start + ;; + *) + echo "usage: $0 {start|stop|restart}" +esac +exit 0 -- cgit v1.2.3-54-g00ecf