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:
@@ -24,12 +24,12 @@ _FEEDS = [
|
||||
("et_compromised.ipset",
|
||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/et_compromised.ipset",
|
||||
"ET Compromised"),
|
||||
("bruteforcelogin.ipset",
|
||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bruteforcelogin.ipset",
|
||||
"BruteForce"),
|
||||
("bi_any_2_30d.ipset",
|
||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bi_any_2_30d.ipset",
|
||||
"Badips 30d"),
|
||||
("dshield.netset",
|
||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield.netset",
|
||||
"DShield"),
|
||||
("spamhaus_drop.netset",
|
||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/spamhaus_drop.netset",
|
||||
"Spamhaus DROP"),
|
||||
]
|
||||
|
||||
_MAX_AGE = 86400 # Refresh cache after 24h
|
||||
|
||||
@@ -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
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user