]> git.pld-linux.org Git - packages/courier-imap.git/commitdiff
- pldized
authorArkadiusz Miśkiewicz <arekm@maven.pl>
Thu, 1 Sep 2005 14:37:14 +0000 (14:37 +0000)
committercvs2git <feedback@pld-linux.org>
Sun, 24 Jun 2012 12:13:13 +0000 (12:13 +0000)
Changed files:
    courier-imap-pop3-ssl.init -> 1.1
    courier-imap-pop3.init -> 1.15

courier-imap-pop3-ssl.init [new file with mode: 0644]
courier-imap-pop3.init

diff --git a/courier-imap-pop3-ssl.init b/courier-imap-pop3-ssl.init
new file mode 100644 (file)
index 0000000..c51ef88
--- /dev/null
@@ -0,0 +1,71 @@
+#!/bin/sh
+# POP3 SSL Daemon
+#
+# chkconfig:   345 80 20
+# description: POP3 SSL Daemon
+
+sysconfdir=@sysconfdir@
+libexecdir=@libexecdir@
+sbindir=@sbindir@
+
+# Source function library
+. /etc/rc.d/init.d/functions
+
+# Get network config
+. /etc/sysconfig/network
+
+# Check that networking is up.
+if is_yes "${NETWORKING}"; then
+    if [ ! -f /var/lock/subsys/network -a "$1" != stop -a "$1" != status ]; then
+       msg_network_down pop3d-ssl
+       exit 1
+    fi
+else
+    exit 0
+fi
+
+RETVAL=0
+# See how we were called.
+case "$1" in
+    start)
+    # Check if the service is already running?
+    if [ ! -f /var/lock/subsys/courier-pop3-ssl ]; then
+       if [ -x "$COURIERTLS" -a ! -f "$TLS_CERTFILE" ]; then
+           msg_starting "pop3d-ssl cert generation"
+           daemon $sbindir/mkpop3dcert
+       fi
+       . $sysconfdir/pop3d-ssl
+       msg_starting pop3d-ssl
+       daemon $libexecdir/pop3d-ssl.rc start
+       RETVAL=$?
+       [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3-ssl
+    else
+       msg_already_running pop3d-ssl
+    fi
+    ;;
+    stop)
+    if [ -f /var/lock/subsys/courier-pop3-ssl ]; then
+       . $sysconfdir/pop3d-ssl
+       msg_stopping pop3d-ssl
+       daemon $libexecdir/pop3d-ssl.rc stop
+       RETVAL=$?
+       rm -f /var/lock/subsys/courier-pop3-ssl >/dev/null 2>&1
+    else
+       msg_not_running pop3d-ssl
+    fi
+    ;;
+    restart|force-reload)
+    $0 stop
+    $0 start
+    exit $?
+    ;;
+    status)
+    status couriertcpd
+    exit $?
+    ;;
+    *)
+    msg_usage "$0 {start|stop|restart|force-reload|status}"
+    exit 3
+esac
+
+exit $RETVAL
index 49cc5738a53938f9be9add207292a23ad83f9769..eca3c0ff8551c3bdcc213960f8344bc9ade027b4 100644 (file)
@@ -30,86 +30,24 @@ case "$1" in
   start)
        # Check if the service is already running?
        if [ ! -f /var/lock/subsys/courier-pop3 ]; then
-
-        POP3DSTART=""
-        POP3DSSLSTART=""
-
-        if test -f $sysconfdir/pop3d
-        then
-            . $sysconfdir/pop3d
-        fi
-
-        case x$POP3DSTART in
-        x[yY]*)
-        # Start daemons.
-       msg_starting pop3d
-        $libexecdir/pop3d.rc start
-       RETVAL=$?
-        if [ $RETVAL -eq 0 ]; then ok; else fail; fi
-        ;;
-        esac
-
-        if test -f $sysconfdir/pop3d-ssl
-        then
-        . $sysconfdir/pop3d-ssl
-        fi
-
-        case x$POP3DSSLSTART in
-       x[yY]*)
-        if test -x $COURIERTLS
-       then
-       # First time we start this, generate a dummy SSL certificate.
-       if test ! -f $TLS_CERTFILE
-       then
-       echo -n " generating-SSL-certificate..."
-       $sbindir/mkpop3dcert >/dev/null 2>&1
-       fi
-       msg_starting pop3d-ssl
-        $libexecdir/pop3d-ssl.rc start
-       RETVAL=$?
-       if [ $RETVAL -eq 0 ]; then ok; else fail; fi
-
-       fi
-       ;;
-       esac
-
-       touch /var/lock/subsys/courier-pop3
+               . $sysconfdir/pop3d
+               msg_starting pop3d
+               daemon $libexecdir/pop3d.rc start
+               RETVAL=$?
+               [ $RETVAL -eq 0 ] && touch /var/lock/subsys/courier-pop3
        else
-               msg_already_running "Courier POP3"
+               msg_already_running pop3d
        fi
-       ;;
+        ;;
   stop)
        if [ -f /var/lock/subsys/courier-pop3 ]; then
-
-        . $sysconfdir/pop3d
-        if [ -f $PIDFILE ]; then
-           msg_stopping pop3d
-           $libexecdir/pop3d.rc stop
-           RETVAL=$?
-           if [ $RETVAL -eq 0 ]; then
-               ok
-               rm -f $PIDFILE
-           else
-               fail
-           fi
-       fi
-
-        . $sysconfdir/pop3d-ssl
-        if [ -f $SSLPIDFILE ]; then
-           msg_stopping pop3d-ssl
-           $libexecdir/pop3d-ssl.rc stop
-           RETVAL=$?
-           if [ $RETVAL -eq 0 ]; then
-               ok
-               rm -f $SSLPIDFILE
-           else 
-               fail
-           fi
-       fi
-
-       rm -f /var/lock/subsys/courier-pop3
+               . $sysconfdir/pop3d
+               msg_stopping pop3d
+               daemon $libexecdir/pop3d.rc stop
+               RETVAL=$?
+               rm -f /var/lock/subsys/courier-pop3 >/dev/null 2>&1
        else
-               msg_not_running "Courier POP3"
+               msg_not_running pop3d
        fi
        ;;
   restart|force-reload)
This page took 0.616297 seconds and 4 git commands to generate.