summaryrefslogtreecommitdiff
path: root/testing/postfix/rc.d
diff options
context:
space:
mode:
authorJoshua Ismael Haase Hernandez <hahj87@gmail.com>2011-05-18 10:36:32 -0500
committerJoshua Ismael Haase Hernandez <hahj87@gmail.com>2011-05-18 10:36:32 -0500
commit02c6fa41964c6bb1e7f285ff530e8082b9326399 (patch)
tree2c13819f471dca50955bddeadbf940ff3631c1e2 /testing/postfix/rc.d
parent8c0e0492541a5ef68bf2814712502103d8f475b5 (diff)
parenta4f85b5a8c5460995c83445460351846cde419f8 (diff)
Merge branch 'master' of http://projects.parabolagnulinux.org/abslibre-mips64el
Conflicts: extra/python/PKGBUILD
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