summaryrefslogtreecommitdiff
path: root/testing/postfix/rc.d
diff options
context:
space:
mode:
authorroot <root@rshg047.dnsready.net>2011-05-14 22:37:30 +0000
committerroot <root@rshg047.dnsready.net>2011-05-14 22:37:30 +0000
commite69c538fc7af5a9861c7688dd15913082d978180 (patch)
treef193cf26628a71f1c474227fa6c429713558f0a2 /testing/postfix/rc.d
parent2c4629f613c001fd29740d0f4c0e497c771a2182 (diff)
Sat May 14 22:37:30 UTC 2011
Diffstat (limited to 'testing/postfix/rc.d')
-rwxr-xr-xtesting/postfix/rc.d37
1 files changed, 37 insertions, 0 deletions
diff --git a/testing/postfix/rc.d b/testing/postfix/rc.d
new file mode 100755
index 000000000..94ccc2af0
--- /dev/null
+++ b/testing/postfix/rc.d
@@ -0,0 +1,37 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+name=postfix
+PID=$(pidof -o %PPID /usr/lib/postfix/master)
+
+case "$1" in
+start)
+ stat_busy "Starting $name daemon"
+ [[ -z "$PID" ]] && /usr/sbin/postfix start &>/dev/null \
+ && { add_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+stop)
+ stat_busy "Stopping $name daemon"
+ [[ -n "$PID" ]] && /usr/sbin/postfix stop &>/dev/null \
+ && { rm_daemon $name; stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+reload)
+ stat_busy "Reloading $name daemon"
+ [[ -n "$PID" ]] && kill -HUP $PID &>/dev/null \
+ && { stat_done; } \
+ || { stat_fail; exit 1; }
+ ;;
+restart)
+ $0 stop
+ sleep 1
+ $0 start
+ ;;
+*)
+ echo "usage: $0 {start|stop|restart|reload}"
+ ;;
+esac
+exit 0