fix: replace dead firehol feeds, fix arithmetic under set -e

Replace bruteforcelogin and bi_any_2_30d (404) with dshield and
spamhaus_drop. Guard ((var++)) with || true to prevent set -e from
killing the script when the pre-increment value is 0.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
This commit is contained in:
user
2026-02-15 02:41:32 +01:00
parent 23b4d6f2a4
commit 19f54da3cf
2 changed files with 13 additions and 13 deletions

View File

@@ -39,7 +39,7 @@ update_tor() {
else
rm -f "$dest.tmp"
err "Failed to download Tor exit list"
((FAILURES++))
((FAILURES++)) || true
fi
}
@@ -52,8 +52,8 @@ update_iprep() {
"firehol_level1.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset"
"firehol_level2.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level2.netset"
"et_compromised.ipset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/et_compromised.ipset"
"bruteforcelogin.ipset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bruteforcelogin.ipset"
"bi_any_2_30d.ipset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bi_any_2_30d.ipset"
"dshield.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield.netset"
"spamhaus_drop.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/spamhaus_drop.netset"
)
local ok=0 fail=0
@@ -63,16 +63,16 @@ update_iprep() {
dim "Fetching $name..."
if curl -sS -fL --max-time 30 -o "$dest_dir/$name.tmp" "$url"; then
mv "$dest_dir/$name.tmp" "$dest_dir/$name"
((ok++))
((ok++)) || true
else
rm -f "$dest_dir/$name.tmp"
((fail++))
((fail++)) || true
fi
done
if [[ $fail -gt 0 ]]; then
err "IP rep feeds: $ok/${#feeds[@]} ($fail failed)"
((FAILURES++))
((FAILURES++)) || true
else
info "IP rep feeds: $ok/${#feeds[@]}"
fi
@@ -101,7 +101,7 @@ update_geolite2() {
else
rm -f "$DATA_DIR/$edition.tar.gz"
err "Failed to download $edition"
((FAILURES++))
((FAILURES++)) || true
fi
done
}