summaryrefslogtreecommitdiff
path: root/community/courier-mta/courier.rc.d
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-28 08:22:26 -0500
committerJoshua Ismael Haase Hernández <hahj87@gmail.com>2011-06-28 08:22:26 -0500
commitcf34f2a7f0e4e0ca113a46845509e43cdc0eb3c3 (patch)
tree009c64b580f512fe47a0543b590580585b56534f /community/courier-mta/courier.rc.d
parent3dc4525661db2630038e019a2a31b71fdcbfb74a (diff)
parent1732308adb7885b00fc388f978e65b3ad15aa067 (diff)
Merge branch 'master' of vparabola:~/abslibre-pre-mips64el
Conflicts: community/mingw32-gcc/PKGBUILD extra/transmission/PKGBUILD libre/icecat/PKGBUILD multilib/nspluginwrapper/PKGBUILD
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