Initial backup commit

This commit is contained in:
root
2025-12-25 09:43:54 -08:00
commit c0543ca125
3 changed files with 176 additions and 0 deletions

24
firehol-sync.sh Executable file
View File

@@ -0,0 +1,24 @@
#!/bin/bash
MIKROTIK="10.10.10.1"
USER="fail2ban"
LIST="firehol_l1"
TIMEOUT="7d"
TMP="/tmp/firehol_l1.txt"
LOG="/var/log/firehol-sync.log"
echo "[$(date)] FireHOL sync started" >> $LOG
curl -s https://raw.githubusercontent.com/firehol/blocklist-ipsets/master/firehol_level1.netset \
| grep -E '^[0-9]' \
| grep -v ':' \
| grep -Ev '^(0\.|10\.|127\.|169\.254\.|172\.(1[6-9]|2[0-9]|3[0-1])\.|192\.168\.|224\.|240\.)' \
> $TMP
while read ip; do
ssh -o ConnectTimeout=3 $USER@$MIKROTIK \
"/ip firewall address-list add list=$LIST address=$ip timeout=$TIMEOUT comment=FireHOL" \
2>/dev/null
done < $TMP
echo "[$(date)] FireHOL sync finished" >> $LOG