]> git.pld-linux.org Git - packages/courier-imap.git/blobdiff - courier-imap-pop3.init
- add md5sum
[packages/courier-imap.git] / courier-imap-pop3.init
index 515e2a3d92c0e3c0fcd2f2cec673805ee7b52a4e..e1cc2b837e3069905bd9a464b713186fca94cf64 100644 (file)
@@ -21,11 +21,16 @@ POP3DSSLSTART="no"
 [ -f /etc/sysconfig/courier-pop3 ] && . /etc/sysconfig/courier-pop3
 
 # Check that networking is up.
-if is_no "${NETWORKING}" ; then
-       msg_network_down "Courier POP3"
-       exit 1
+if is_yes "${NETWORKING}"; then
+       if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+               msg_network_down "Courier POP3"
+               exit 1
+       fi
+else
+       exit 0
 fi
 
+RETVAL=0
 # See how we were called.
 case "$1" in
   start)
@@ -33,14 +38,14 @@ case "$1" in
        if [ ! -f /var/lock/subsys/courier-pop3 ]; 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 POP3"
-                                   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 POP3"
+                               fail
+                               exit 1
+                       fi
                fi
                msg_starting "Courier POP3"
                /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \
@@ -59,7 +64,6 @@ case "$1" in
                        fail
                fi
 
-               
                if is_yes "$POP3DSSLSTART"; then
                        msg_starting "Courier POP3 (SSL)"
                        /usr/bin/env - /bin/sh -c " . /etc/sysconfig/courier-pop3 ; \
@@ -83,7 +87,6 @@ case "$1" in
                touch /var/lock/subsys/courier-pop3
        else
                msg_already_running "Courier POP3"
-               exit 1
        fi
        ;;
   stop)
@@ -94,24 +97,23 @@ case "$1" in
                        msg_stopping "Courier POP3 (SSL)"
                        daemon /usr/lib/courier-imap/couriertcpd -pid=/var/run/pop3d-ssl.pid -stop
                fi
-               RETVAL=$?
                rm -f /var/lock/subsys/courier-pop3
        else
                msg_not_running "Courier POP3"
-               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.037833 seconds and 4 git commands to generate.