X-Git-Url: https://plomlompom.com/repos/?a=blobdiff_plain;f=all_new_2018%2Fletsencrypt_local_set.sh;h=d4ca0d15d9d9f2812d120b1fccbcd4fe34f84cf2;hb=1b8bb66a16702bf3488ccddb27db8f2001c4b865;hp=a7ec6e50451550af30a90591fdd7ff31128eaf2f;hpb=f2a01cfd1fb4fc2510ce1df00def189a10be42d7;p=config diff --git a/all_new_2018/letsencrypt_local_set.sh b/all_new_2018/letsencrypt_local_set.sh index a7ec6e5..d4ca0d1 100755 --- a/all_new_2018/letsencrypt_local_set.sh +++ b/all_new_2018/letsencrypt_local_set.sh @@ -2,11 +2,12 @@ set -e # Ensure we have a mail address as argument. -if [ $# -lt 1 ]; then - echo "Need mail address as argument." +if [ $# -lt 2 ]; then + echo "Need target domain and mail address as argument." false fi -mail_address="$1" +domain="$1" +mail_address="$2" # If port 80 blocked by iptables, open it. set +e @@ -18,7 +19,7 @@ if [ "${open_iptables}" -eq "1" ]; then fi # Create new certificate and copy it to /etc/letsencrypt. -certbot certonly --standalone --agree-tos -m "${mail}" -d "$(hostname -f)" +certbot certonly --standalone --agree-tos -m "${mail_address}" -d "${domain}" # Remove iptables rule to open port 80 if we added it. if [ "${open_iptables}" -eq "1" ]; then