Browse Source

Invert logic

Bob Mottram 1 month ago
parent
commit
ebedf28e9c
1 changed files with 14 additions and 16 deletions
  1. 14 16
      src/freedombone-installer

+ 14 - 16
src/freedombone-installer

@@ -3503,23 +3503,21 @@ function update_blocklist {
 
 function block_evil_domains {
     if ! grep -q "exited.eu\|cyzed.com\|gab.steeck.eu\|gab.polaris-1.work\|not-develop.gab.com\|develop.gab.com\|gab.com" "${FIREWALL_DOMAINS}"; then
-	return
-    fi
-    
-    renew_blocks=
-    evildoers=("exited.eu" "cyzed.com" "gab.steeck.eu" "gab.polaris-1.work" "gab.com")
-    # shellcheck disable=SC2068
-    for evil_domain in ${evildoers[@]}; do
-	if ! grep -q "$evil_domain" "${FIREWALL_DOMAINS}"; then
-	    echo "$evil_domain" >> "${FIREWALL_DOMAINS}"
-	    renew_blocks=1
+	renew_blocks=
+	evildoers=("exited.eu" "cyzed.com" "gab.steeck.eu" "gab.polaris-1.work" "gab.com")
+	# shellcheck disable=SC2068
+	for evil_domain in ${evildoers[@]}; do
+	    if ! grep -q "$evil_domain" "${FIREWALL_DOMAINS}"; then
+		echo "$evil_domain" >> "${FIREWALL_DOMAINS}"
+		renew_blocks=1
+	    fi
+	done
+
+	if [ $renew_blocks ]; then
+            update_email_blocklists "${FIREWALL_DOMAINS}"
+	    rsync_deny_blocked_domains
+	    regenerate_blocklist
 	fi
-    done
-
-    if [ $renew_blocks ]; then
-        update_email_blocklists "${FIREWALL_DOMAINS}"
-	rsync_deny_blocked_domains
-	regenerate_blocklist
     fi
 }