courier-imap-4.0.6-r1-courier-imapd-ssl.rc6 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. #!/sbin/openrc-run
  2. # Copyright 1999-2017 Gentoo Foundation
  3. # Distributed under the terms of the GNU General Public License v2
  4. depend() {
  5. need net courier-authlib
  6. use famd
  7. }
  8. . /etc/courier-imap/imapd-ssl
  9. checkconfig() {
  10. if [ ! -e /etc/courier-imap/imapd-ssl ] ; then
  11. eerror "You need an /etc/courier-imap/imapd-ssl file to run courier-imapd-ssl"
  12. return 1
  13. fi
  14. . /etc/courier-imap/imapd-ssl || {
  15. eerror "There are syntax errors in /etc/courier-imap/imapd-ssl"
  16. eerror "Please correct them before trying to start courier-imapd-ssl"
  17. return 3
  18. }
  19. if [ ! -e "${TLS_CERTFILE}" ] ; then
  20. eerror "You need to create a SSL certificate to use IMAP over SSL"
  21. eerror "Edit /etc/courier-imap/imapd.cnf, then run: mkimapdcert"
  22. return 2
  23. fi
  24. }
  25. start() {
  26. checkconfig || return 1
  27. ebegin "Starting courier-imapd over SSL"
  28. /usr/bin/env - /usr/GENTOO_LIBDIR/courier-imap/gentoo-imapd-ssl.rc --pid=${SSLPIDFILE}
  29. eend $?
  30. }
  31. stop() {
  32. ebegin "Stopping courier-imapd over SSL"
  33. start-stop-daemon --quiet --stop --pid=${SSLPIDFILE}
  34. eend $?
  35. }