]> git.pld-linux.org Git - packages/courier-imap.git/blobdiff - courier-imap.init
- massive attack s/pld.org.pl/pld-linux.org/
[packages/courier-imap.git] / courier-imap.init
index 024f41334a51cd435a3b4f1bc6b864861c450d32..bd811796694daca0eddd76f51d93508fb220e208 100644 (file)
@@ -21,11 +21,16 @@ IMAPDSSLSTART="no"
 [ -f /etc/sysconfig/courier-imap ] && . /etc/sysconfig/courier-imap
 
 # Check that networking is up.
-if is_no "${NETWORKING}" ; then
-       msg_network_down "Courier IMAP"
-       exit 1
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network ]; then
+               msg_network_down "Courier IMAP"
+               exit 1
+       fi
+else
+       exit 0
 fi
 
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -33,16 +38,17 @@ case "$1" in
        if [ ! -f /var/lock/subsys/courier-imap ]; then
                # start authdaemon, if not running..
                if [ ! -f /var/lock/subsys/authdaemon -a \
-                    -x /etc/rc.d/init.d/authdaemon ]; then
-                           /etc/rc.d/init.d/authdaemon start
-                           RETVAL=$?
-                           if [ $RETVAL -ne 0 ]; then
-                                   msg_starting "Courier IMAP"
-                                   fail
-                                   exit 1
-                           fi
+                  -x /etc/rc.d/init.d/authdaemon ]; then
+                       /etc/rc.d/init.d/authdaemon start
+                       RETVAL=$?
+                       if [ $RETVAL -ne 0 ]; then
+                               msg_starting "Courier IMAP"
+                               fail
+                               exit 1
+                       fi
                fi
                msg_starting "Courier IMAP"
+               busy
                ulimit -d $IMAP_ULIMITD
                /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-imap ; \
                        `sed -n '/^#/d;/=/p' </etc/sysconfig/courier-imap | \
@@ -83,7 +89,6 @@ case "$1" in
                touch /var/lock/subsys/courier-imap
        else
                msg_already_running "Courier IMAP"
-               exit 1
        fi
        ;;
   stop)
@@ -94,24 +99,23 @@ case "$1" in
                        msg_stopping "Courier IMAP (SSL)"
                        daemon /usr/lib/courier-imap/couriertcpd -pid=/var/run/imapd-ssl.pid -stop
                fi
-               RETVAL=$?
                rm -f /var/lock/subsys/courier-imap
        else
                msg_not_running "Courier IMAP"
-               exit 1
        fi
        ;;
-  restart|reload)
+  restart|force-reload)
        $0 stop
        $0 start
+       exit $?
        ;;
   status)
        status couriertcpd
+       exit $?
        ;;
   *)
-       msg_usage "$0 {start|stop|restart|reload|status}"
-       exit 1
+       msg_usage "$0 {start|stop|restart|force-reload|status}"
+       exit 3
 esac
 
 exit $RETVAL
-
This page took 0.121169 seconds and 4 git commands to generate.