Browse Source

Merge pull request #991 from Lupul/fix-200723

Fix 200723
Kristan Kenney 5 years ago
parent
commit
3bd1ac9716
2 changed files with 3 additions and 3 deletions
  1. 1 1
      bin/v-delete-letsencrypt-domain
  2. 2 2
      func/rebuild.sh

+ 1 - 1
bin/v-delete-letsencrypt-domain

@@ -68,7 +68,7 @@ else
     $BIN/v-delete-mail-domain-ssl $user $domain $restart >/dev/null 2>&1
     $BIN/v-delete-mail-domain-ssl $user $domain $restart >/dev/null 2>&1
 fi
 fi
 cmdstatus="$?"
 cmdstatus="$?"
-if [ "$cmdstatus" -ne E_NOTEXIST ]; then
+if [ "$cmdstatus" -ne "$E_NOTEXIST" ]; then
     check_result "$cmdstatus" "SSL delete" >/dev/null
     check_result "$cmdstatus" "SSL delete" >/dev/null
 fi
 fi
 
 

+ 2 - 2
func/rebuild.sh

@@ -528,13 +528,13 @@ rebuild_mail_domain_conf() {
         if [ ! -z "$local_ip" ]; then
         if [ ! -z "$local_ip" ]; then
             IP_RDNS=$(is_ip_rdns_valid "$local_ip")
             IP_RDNS=$(is_ip_rdns_valid "$local_ip")
             if [ ! -z "$IP_RDNS" ]; then
             if [ ! -z "$IP_RDNS" ]; then
-                if [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
+                if [ -f /etc/exim4/mailhelo.conf ] && [ $(grep -s "^${domain}:" /etc/exim4/mailhelo.conf) ]; then
                     sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
                     sed -i "/^${domain}:/c\\${domain}:${IP_RDNS}" /etc/exim4/mailhelo.conf
                 else
                 else
                     echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
                     echo ${domain}:${IP_RDNS} >> /etc/exim4/mailhelo.conf
                 fi
                 fi
             else
             else
-                sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf
+                sed -i "/^${domain}:/d" /etc/exim4/mailhelo.conf >/dev/null 2>&1
             fi
             fi
         fi
         fi