diff options
author | Leonardo Arena <rnalrd@gmail.com> | 2011-05-18 06:02:28 +0000 |
---|---|---|
committer | Leonardo Arena <rnalrd@gmail.com> | 2011-05-18 06:02:36 +0000 |
commit | 3c6b7e589016c540ed3fae032bf825c55475ac81 (patch) | |
tree | 5ec113328a540c22e8ef4b4b579a1333c3a980fe /main/perdition/perdition.initd | |
parent | 238961cca5cd7e51bf55672f0634022e8d6802fb (diff) | |
download | aports-3c6b7e589016c540ed3fae032bf825c55475ac81.tar.bz2 aports-3c6b7e589016c540ed3fae032bf825c55475ac81.tar.xz |
testing/perdition: move to main
Diffstat (limited to 'main/perdition/perdition.initd')
-rw-r--r-- | main/perdition/perdition.initd | 76 |
1 files changed, 76 insertions, 0 deletions
diff --git a/main/perdition/perdition.initd b/main/perdition/perdition.initd new file mode 100644 index 0000000000..0242169c4b --- /dev/null +++ b/main/perdition/perdition.initd @@ -0,0 +1,76 @@ +#!/sbin/runscript +# Copyright 1999-2005 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 +# $Header: /var/cvsroot/gentoo-x86/net-mail/perdition/files/perdition.initd,v 1.2 2008/06/10 18:28:27 dertobi123 Exp $ + +depend() { + need net +} + + +check_key() { + if [ ! -e /etc/perdition/perdition.crt.pem ] ; then + einfo "No SSL keys; see man perdition to create them. Or run: " + einfo "$ openssl req -new -x509 -nodes -out /etc/perdition/perdition.crt.pem -keyout /etc/perdition/perdition.key.pem -days 365" + return 1 + fi +} + +start() { + if [ "${POP3}" = "yes" ]; then + ebegin "Starting perdition services (POP3)" + start-stop-daemon --quiet --start --startas /usr/sbin/perdition.pop3 -p ${PIDDIR}/pop3.pid \ + -- ${FLAGS} ${POP3_FLAGS} -u ${PERDITION_USER} --pid_file ${PIDDIR}/pop3.pid + eend $? + fi + + if [ "${POP3S}" = "yes" ]; then + check_key || return 1 + ebegin "Starting perdition services (POP3S)" + start-stop-daemon --quiet --start --startas /usr/sbin/perdition.pop3s -p ${PIDDIR}/pop3s.pid \ + -- ${FLAGS} ${POP3S_FLAGS} -u ${PERDITION_USER} --pid_file ${PIDDIR}/pop3s.pid + eend $? + fi + + if [ "${IMAP4}" = "yes" ]; then + ebegin "Starting perdition services (IMAP4)" + start-stop-daemon --quiet --start --startas /usr/sbin/perdition.imap4 -p ${PIDDIR}/imap4.pid \ + -- ${FLAGS} ${IMAP4_FLAGS} -u ${PERDITION_USER} --pid_file ${PIDDIR}/imap4.pid + eend $? + fi + + if [ "${IMAP4S}" = "yes" ]; then + check_key || return 1 + ebegin "Starting perdition services (IMAP4S)" + start-stop-daemon --quiet --start --startas /usr/sbin/perdition.imap4s -p ${PIDDIR}/imap4s.pid \ + -- ${FLAGS} ${IMAP4S_FLAGS} -u ${PERDITION_USER} --pid_file ${PIDDIR}/imap4s.pid + eend $? + fi +} + + +stop() { + if [ "${POP3}" = "yes" ]; then + ebegin "Shutting down perdition services (POP3)" + start-stop-daemon -o --quiet --stop --pidfile ${PIDDIR}/pop3.pid + eend $? + fi + + if [ "${POP3S}" = "yes" ]; then + ebegin "Shutting down perdition services (POP3S)" + start-stop-daemon -o --quiet --stop --pidfile ${PIDDIR}/pop3s.pid + eend $? + fi + + if [ "${IMAP4}" = "yes" ]; then + ebegin "Shutting down perdition services (IMAP4)" + start-stop-daemon -o --quiet --stop --pidfile ${PIDDIR}/imap4.pid + eend $? + fi + + if [ "${IMAP4S}" = "yes" ]; then + ebegin "Shutting down perdition services (IMAP4S)" + start-stop-daemon -o --quiet --stop --pidfile ${PIDDIR}/imap4s.pid + eend $? + fi +} |