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",
|
("et_compromised.ipset",
|
||||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/et_compromised.ipset",
|
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/et_compromised.ipset",
|
||||||
"ET Compromised"),
|
"ET Compromised"),
|
||||||
("bruteforcelogin.ipset",
|
("dshield.netset",
|
||||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bruteforcelogin.ipset",
|
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield.netset",
|
||||||
"BruteForce"),
|
"DShield"),
|
||||||
("bi_any_2_30d.ipset",
|
("spamhaus_drop.netset",
|
||||||
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bi_any_2_30d.ipset",
|
"https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/spamhaus_drop.netset",
|
||||||
"Badips 30d"),
|
"Spamhaus DROP"),
|
||||||
]
|
]
|
||||||
|
|
||||||
_MAX_AGE = 86400 # Refresh cache after 24h
|
_MAX_AGE = 86400 # Refresh cache after 24h
|
||||||
|
|||||||
@@ -39,7 +39,7 @@ update_tor() {
|
|||||||
else
|
else
|
||||||
rm -f "$dest.tmp"
|
rm -f "$dest.tmp"
|
||||||
err "Failed to download Tor exit list"
|
err "Failed to download Tor exit list"
|
||||||
((FAILURES++))
|
((FAILURES++)) || true
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -52,8 +52,8 @@ update_iprep() {
|
|||||||
"firehol_level1.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset"
|
"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"
|
"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"
|
"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"
|
"dshield.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/dshield.netset"
|
||||||
"bi_any_2_30d.ipset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/bi_any_2_30d.ipset"
|
"spamhaus_drop.netset:https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/spamhaus_drop.netset"
|
||||||
)
|
)
|
||||||
|
|
||||||
local ok=0 fail=0
|
local ok=0 fail=0
|
||||||
@@ -63,16 +63,16 @@ update_iprep() {
|
|||||||
dim "Fetching $name..."
|
dim "Fetching $name..."
|
||||||
if curl -sS -fL --max-time 30 -o "$dest_dir/$name.tmp" "$url"; then
|
if curl -sS -fL --max-time 30 -o "$dest_dir/$name.tmp" "$url"; then
|
||||||
mv "$dest_dir/$name.tmp" "$dest_dir/$name"
|
mv "$dest_dir/$name.tmp" "$dest_dir/$name"
|
||||||
((ok++))
|
((ok++)) || true
|
||||||
else
|
else
|
||||||
rm -f "$dest_dir/$name.tmp"
|
rm -f "$dest_dir/$name.tmp"
|
||||||
((fail++))
|
((fail++)) || true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
if [[ $fail -gt 0 ]]; then
|
if [[ $fail -gt 0 ]]; then
|
||||||
err "IP rep feeds: $ok/${#feeds[@]} ($fail failed)"
|
err "IP rep feeds: $ok/${#feeds[@]} ($fail failed)"
|
||||||
((FAILURES++))
|
((FAILURES++)) || true
|
||||||
else
|
else
|
||||||
info "IP rep feeds: $ok/${#feeds[@]}"
|
info "IP rep feeds: $ok/${#feeds[@]}"
|
||||||
fi
|
fi
|
||||||
@@ -101,7 +101,7 @@ update_geolite2() {
|
|||||||
else
|
else
|
||||||
rm -f "$DATA_DIR/$edition.tar.gz"
|
rm -f "$DATA_DIR/$edition.tar.gz"
|
||||||
err "Failed to download $edition"
|
err "Failed to download $edition"
|
||||||
((FAILURES++))
|
((FAILURES++)) || true
|
||||||
fi
|
fi
|
||||||
done
|
done
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user