#!/bin/bash cd "$(dirname $0)" . $PWD/config.ini DOMAIN=$1 if [ ! -f "/etc/letsencrypt/live/$DOMAIN/cert.pem" ] ; then /etc/init.d/apache2 stop $LETSENCRYPT_BIN certonly --standalone --renew-by-default --rsa-key-size 4096 -t --agree-tos --preferred-challenges http -m $MAINTAINER -d $DOMAIN if [ "$?" -ne "0" ] ; then echo "OOPS !! Ca a foiré pour /etc/letsencrypt/live/$domain" else echo "COOL !! Ca s'est bien passé ! Je recrée ce qu'il faut si besoin et je recharge les services qui vont bien" fi /etc/init.d/apache2 start fi