Dominic Reich
d363f1cc81
- update-blacklist creates text file with blocked ips for import to pfBlockerNG on my Router/FW - aprs_sendstatus.py sends a status message to the APRS-IS network and updates the status line of my WX station
16 lines
638 B
Bash
Executable file
16 lines
638 B
Bash
Executable file
#!/bin/sh
|
|
# or use this one to create only ip addresses
|
|
# iptables -nL BLACKLIST | tail -n +3 | awk '{ print $4 }' | sort -g
|
|
|
|
FILE=/var/www/html/blocked.txt
|
|
|
|
/usr/bin/echo -n "# " | /usr/bin/tee $FILE > /dev/null
|
|
|
|
/usr/sbin/iptables-nft -nL BLACKLIST | /usr/bin/tail -n +3 | /usr/bin/wc -l | \
|
|
/usr/bin/tr -d "\n" | /usr/bin/tee -a $FILE > /dev/null
|
|
|
|
/usr/bin/echo -en " ips saved.\n# source pkts bytes\n" | /usr/bin/tee -a $FILE > /dev/null
|
|
|
|
/usr/sbin/iptables -vnL BLACKLIST | /usr/bin/tail -n +3 | \
|
|
/usr/bin/awk ' { printf "%-18s %-6s %-6s\n", $8, $1, $2 } ' | /usr/bin/sort -g | \
|
|
/usr/bin/tee -a $FILE > /dev/null
|