SOURCES: courier-imap-pop3-ssl.init (NEW), courier-imap-pop3.init ...

arekm arekm at pld-linux.org
Thu Sep 1 16:37:20 CEST 2005


Author: arekm                        Date: Thu Sep  1 14:37:19 2005 GMT
Module: SOURCES                       Tag: HEAD
---- Log message:
- pldized

---- Files affected:
SOURCES:
   courier-imap-pop3-ssl.init (NONE -> 1.1)  (NEW), courier-imap-pop3.init (1.14 -> 1.15) 

---- Diffs:

================================================================
Index: SOURCES/courier-imap-pop3-ssl.init
diff -u /dev/null SOURCES/courier-imap-pop3-ssl.init:1.1
--- /dev/null	Thu Sep  1 16:37:19 2005
+++ SOURCES/courier-imap-pop3-ssl.init	Thu Sep  1 16:37:14 2005
@@ -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: SOURCES/courier-imap-pop3.init
diff -u SOURCES/courier-imap-pop3.init:1.14 SOURCES/courier-imap-pop3.init:1.15
--- SOURCES/courier-imap-pop3.init:1.14	Thu Jul  8 17:01:12 2004
+++ SOURCES/courier-imap-pop3.init	Thu Sep  1 16:37:14 2005
@@ -30,86 +30,24 @@
   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)
================================================================

---- CVS-web:
    http://cvs.pld-linux.org/SOURCES/courier-imap-pop3.init?r1=1.14&r2=1.15&f=u




More information about the pld-cvs-commit mailing list