Skip to content

Commit

Permalink
Generate apache.pem only if certbot return a success
Browse files Browse the repository at this point in the history
* cf #3
  • Loading branch information
camlafit committed Aug 29, 2017
1 parent 8f4e7be commit ce055bf
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/usr/lib/alternc/install.d/alternc-certbot
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,8 @@
db_get alternc-certbot/mail
MAIL="$RET"

certbot --agree-tos --email "$MAIL" --non-interactive --apache certonly -d "$FQDN"

cat "/etc/letsencrypt/live/$FQDN/privkey.pem" > /etc/alternc/apache.pem
cat "/etc/letsencrypt/live/$FQDN/fullchain.pem" >> /etc/alternc/apache.pem
if certbot --agree-tos --email "$MAIL" --non-interactive --apache certonly -d "$FQDN"
then
cat "/etc/letsencrypt/live/$FQDN/privkey.pem" > /etc/alternc/apache.pem
cat "/etc/letsencrypt/live/$FQDN/fullchain.pem" >> /etc/alternc/apache.pem
fi

0 comments on commit ce055bf

Please sign in to comment.