summaryrefslogtreecommitdiffstats
path: root/dovecot/dovecot.sh
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-08-20 19:20:36 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-08-20 19:20:36 +0200
commitf0d152ea0fe92423f39a487e97908d409f98047b (patch)
tree6396fb8e6a851f46f0cfc978c4720b3d2c3726b5 /dovecot/dovecot.sh
parent4955b0d9fc05950c5794c9cc37923deb00e9cfa5 (diff)
downloadaur-packages-f0d152ea0fe92423f39a487e97908d409f98047b.tar.gz
aur-packages-f0d152ea0fe92423f39a487e97908d409f98047b.tar.xz
some updates again
Diffstat (limited to 'dovecot/dovecot.sh')
-rw-r--r--dovecot/dovecot.sh36
1 files changed, 36 insertions, 0 deletions
diff --git a/dovecot/dovecot.sh b/dovecot/dovecot.sh
new file mode 100644
index 0000000..b7555fe
--- /dev/null
+++ b/dovecot/dovecot.sh
@@ -0,0 +1,36 @@
+#!/bin/bash
+
+. /etc/rc.conf
+. /etc/rc.d/functions
+
+PID=`pidof -o %PPID /usr/sbin/dovecot`
+case "$1" in
+ start)
+ stat_busy "Starting Dovecot"
+ [ -z "$PID" ] && /usr/sbin/dovecot
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ add_daemon dovecot
+ stat_done
+ fi
+ ;;
+ stop)
+ stat_busy "Stopping Dovecot"
+ [ ! -z "$PID" ] && kill $PID &> /dev/null
+ if [ $? -gt 0 ]; then
+ stat_fail
+ else
+ rm_daemon dovecot
+ stat_done
+ fi
+ ;;
+ restart)
+ $0 stop
+ sleep 2
+ $0 start
+ ;;
+ *)
+ echo "usage: $0 {start|stop|restart}"
+esac
+exit 0