diff --git a/bin/letsencrypt-certonly.sh b/bin/letsencrypt-certonly.sh index 7177258..3027e97 100755 --- a/bin/letsencrypt-certonly.sh +++ b/bin/letsencrypt-certonly.sh @@ -57,7 +57,13 @@ done # check for domain (hostname) if [[ -z $domain ]]; then echo "domain (hostname) is required" - exit + exit 1 +fi + +# check for existing pem file +if [[ -f /etc/ssl/letsencrypt/$domain.pem ]]; then + echo "pem file for $domain already exists" + exit 1 fi # set vars