Author: glen                         Date: Sun Nov 19 22:23:31 2006 GMT
Module: SOURCES                       Tag: DEVEL
---- Log message:
- use functions

---- Files affected:
SOURCES:
   dbmail-imapd.init (1.1.2.1 -> 1.1.2.2) 

---- Diffs:

================================================================
Index: SOURCES/dbmail-imapd.init
diff -u SOURCES/dbmail-imapd.init:1.1.2.1 SOURCES/dbmail-imapd.init:1.1.2.2
--- SOURCES/dbmail-imapd.init:1.1.2.1   Sun Nov 19 23:03:20 2006
+++ SOURCES/dbmail-imapd.init   Sun Nov 19 23:23:26 2006
@@ -27,9 +27,7 @@
        exit 0
 fi
 
-# See how we were called.
-case "$1" in
-  start)
+start() {
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/dbmail-imapd ]; then
                msg_starting dbmail-imapd
@@ -39,8 +37,9 @@
        else
                msg_already_running dbmail-imapd
        fi
-       ;;
-  stop)
+}
+
+stop() {
        if [ -f /var/lock/subsys/dbmail ]; then
                # Stop daemons.
                msg_stopping dbmail-imapd
@@ -49,11 +48,19 @@
        else
                msg_not_running dbmail-imapd
        fi
+}
+
+# See how we were called.
+case "$1" in
+  start)
+       start
+       ;;
+  stop)
+       stop
        ;;
   restart)
-       $0 stop
-       $0 start
-       exit $?
+       stop
+       start
        ;;
   reload)
        if [ -f /var/lock/subsys/dbmail-imapd ]; then
@@ -61,11 +68,13 @@
                killproc dbmail -HUP
                RETVAL=$?
        else
-               msg_not_running dbmail-imapd >&2
+               msg_not_running dbmail-imapd
                RETVAL=7
        fi
        ;;
   force-reload)
+  # FIXME: choose one!!!!
+
        # if program allows reloading without stopping
        $0 reload
 
@@ -84,6 +93,3 @@
 esac
 
 exit $RETVAL
-
-# This must be last line !
-# vi:syntax=sh
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/dbmail-imapd.init?r1=1.1.2.1&r2=1.1.2.2&f=u

_______________________________________________
pld-cvs-commit mailing list
[email protected]
http://lists.pld-linux.org/mailman/listinfo/pld-cvs-commit

Reply via email to