#!/bin/bash # Let's encrypt certbot installation on NextcloudPi # # Copyleft 2017 by Ignacio Nunez Hernanz # GPL licensed (see end of file) * Use at your own risk! # # More at https://ownyourbits.com/2017/03/17/lets-encrypt-installer-for-apache/ ncdir=/var/www/nextcloud nc_vhostcfg=/etc/apache2/sites-available/001-nextcloud.conf ncp_vhostcfg=/etc/apache2/sites-available/ncp.conf letsencrypt=/usr/bin/letsencrypt is_active() { [[ "${ACTIVE}" == "yes" ]] && [[ $( find /etc/letsencrypt/live/ -maxdepth 0 -empty | wc -l ) == 0 ]] } tmpl_letsencrypt_domain() { ( . /usr/local/etc/library.sh if is_active_app letsencrypt; then find_app_param letsencrypt DOMAIN fi ) } install() { cd /etc || return 1 apt-get update apt-get install --no-install-recommends -y letsencrypt rm -f /etc/cron.d/certbot mkdir -p /etc/letsencrypt/live is_docker && { # execute before lamp stack cat > /etc/services-available.d/009letsencrypt < /etc/cron.weekly/letsencrypt-ncp < /etc/letsencrypt/renewal-hooks/deploy/ncp <