summaryrefslogtreecommitdiff
path: root/community/courier-mta/courier.rc.d
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-07-02 23:10:09 +0000
committerroot <root@rshg047.dnsready.net>2011-07-02 23:10:09 +0000
commit1732308adb7885b00fc388f978e65b3ad15aa067 (patch)
tree7a26cedab2b721f05a3b57ccf578787217f8a9a7 /community/courier-mta/courier.rc.d
parenta81bc5be2e3672119ca0313a1fde10397a31211e (diff)
Sat Jul 2 23:10:09 UTC 2011
Diffstat (limited to 'community/courier-mta/courier.rc.d')
-rw-r--r--community/courier-mta/courier.rc.d45
1 files changed, 45 insertions, 0 deletions
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