Procházet zdrojové kódy

Include any messages in the renewal failure email

Bob Mottram před 9 roky
rodič
revize
9456dad28d
1 změnil soubory, kde provedl 13 přidání a 10 odebrání
  1. 13
    10
      src/freedombone

+ 13
- 10
src/freedombone Zobrazit soubor

@@ -1700,8 +1700,11 @@ function letsencrypt_renewals {
1700 1700
     echo '        if [ -f /etc/nginx/sites-available/$LETSENCRYPT_DOMAIN ]; then' >> $renewals_script
1701 1701
     echo '            ${PROJECT_NAME}-renew-cert -h $LETSENCRYPT_DOMAIN -p letsencrypt' >> $renewals_script
1702 1702
     echo '            if [ ! "$?" = "0" ]; then' >> $renewals_script
1703
-    echo -n "                echo \"$renewal_failure_msg\" | mail -s \"$renewal_email_title\" " >> $renewals_script
1703
+    echo "               echo \"${renewal_failure_msg}\n\n\" > ~/temp_renewletsencrypt.txt" >> $renewals_script
1704
+    echo '               ${PROJECT_NAME}-renew-cert -h $LETSENCRYPT_DOMAIN -p letsencrypt >> ~/temp_renewletsencrypt.txt' >> $renewals_script
1705
+    echo -n "                cat ~/temp_renewletsencrypt.txt | mail -s \"${renewal_email_title}\" " >> $renewals_script
1704 1706
     echo '$ADMIN_EMAIL_ADDRESS' >> $renewals_script
1707
+    echo '               rm ~/temp_renewletsencrypt.txt' >> $renewals_script
1705 1708
     echo '            fi' >> $renewals_script
1706 1709
     echo '        fi' >> $renewals_script
1707 1710
     echo '    done' >> $renewals_script
@@ -3702,7 +3705,7 @@ function set_your_domain_name {
3702 3705
         return
3703 3706
     fi
3704 3707
 
3705
-	set_hostname $DEFAULT_DOMAIN_NAME
3708
+    set_hostname $DEFAULT_DOMAIN_NAME
3706 3709
 
3707 3710
     echo 'set_your_domain_name' >> $COMPLETION_FILE
3708 3711
 }
@@ -4128,7 +4131,7 @@ function configure_email {
4128 4131
     fi
4129 4132
     EMAIL_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_email/hostname)
4130 4133
     if [[ $ONION_ONLY != "no" ]]; then
4131
-		set_hostname ${EMAIL_ONION_HOSTNAME}
4134
+        set_hostname ${EMAIL_ONION_HOSTNAME}
4132 4135
         MY_EMAIL_ADDRESS=${MY_USERNAME}@${DEFAULT_DOMAIN_NAME}
4133 4136
     fi
4134 4137
     if ! grep -q "Email onion domain" $COMPLETION_FILE; then
@@ -4217,13 +4220,13 @@ function configure_email {
4217 4220
     sed -i 's|pam_mail.so nopen|pam_mail.so dir=~/Maildir nopen|g' /etc/pam.d/su
4218 4221
 
4219 4222
     echo 'dc_eximconfig_configtype="internet"' > /etc/exim4/update-exim4.conf.conf
4220
-	if [[ $ONION_ONLY == "no" ]]; then
4221
-		# both ICANN and onion domains
4222
-		echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME};${EMAIL_ONION_HOSTNAME}'" >> /etc/exim4/update-exim4.conf.conf
4223
-	else
4224
-		# in onion-only mode the default domain is the same as the onion domain for email
4225
-		echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME}'" >> /etc/exim4/update-exim4.conf.conf
4226
-	fi
4223
+    if [[ $ONION_ONLY == "no" ]]; then
4224
+        # both ICANN and onion domains
4225
+        echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME};${EMAIL_ONION_HOSTNAME}'" >> /etc/exim4/update-exim4.conf.conf
4226
+    else
4227
+        # in onion-only mode the default domain is the same as the onion domain for email
4228
+        echo "dc_other_hostnames='${DEFAULT_DOMAIN_NAME}'" >> /etc/exim4/update-exim4.conf.conf
4229
+    fi
4227 4230
     echo "dc_local_interfaces=''" >> /etc/exim4/update-exim4.conf.conf
4228 4231
     echo "dc_readhost=''" >> /etc/exim4/update-exim4.conf.conf
4229 4232
     echo "dc_relay_domains=''" >> /etc/exim4/update-exim4.conf.conf