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