]> git.pld-linux.org Git - packages/dovecot.git/commitdiff
- use functions
authorElan Ruusamäe <glen@pld-linux.org>
Wed, 28 Mar 2007 10:14:32 +0000 (10:14 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    dovecot.init -> 1.4

dovecot.init

index a05390d280f798b45ccf6a575825aa2fb0196f2a..b193bbfdbf9af1c825f2761f44866e354db0d236 100644 (file)
@@ -23,10 +23,7 @@ else
        exit 0
 fi
 
-RETVAL=0
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/dovecot ]; then
                msg_starting "Dovecot"
@@ -36,20 +33,30 @@ case "$1" in
        else
                msg_already_running "Dovecot"
        fi
-       ;;
-  stop)
-       if [ -f /var/lock/subsys/dovecot ]; then
+}
+
+stop() {
+       if [ -f /var/lock/subsys/dovecot ]; then
                msg_stopping "Dovecot"
                killproc dovecot
                rm -f /var/lock/subsys/dovecot
        else
                msg_not_running "Dovecot"
        fi
+}
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart|force-reload)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   reload)
        msg_reloading "Dovecot"
This page took 0.142228 seconds and 4 git commands to generate.