fetch archaic binaries blacklisted ip's too

This commit is contained in:
MeaTLoTioN 2022-12-05 14:49:17 +00:00
parent 594d857188
commit fd63734b64

View File

@ -1,17 +1,34 @@
#!/bin/bash #!/bin/bash
MYS_DATA="/mystic/data" # Recommended crontab entry
MYS_LOGS="/mystic/logs" # 0 0 * * * /mystic/scripts/twitupd.sh && logger -t "mystic_twitupd.sh" "[crontab] blacklist.txt updated"
if [[ -z "$1" ]]; then
MYS_HOME="/mystic"
else
MYS_HOME="$1"
fi
MYS_DATA="$MYS_HOME/data"
MYS_LOGS="$MYS_HOME/logs"
URLS=(
"https://erb.pw/blacklist"
"https://ibbs.archaicbinary.net/ibbs-bots"
)
IFS=$'\n' IFS=$'\n'
for I in $(curl https://www.erb.pw/blacklist 2>/dev/null); do #for I in $(curl -s https://erb.pw/blacklist); do
CHECK=$(grep -c $I $MYS_DATA/blacklist.txt) for URL in ${URLS[@]}; do
if [[ $CHECK -lt 1 ]]; then for I in $(curl -s $URL); do
echo $I >> $MYS_DATA/blacklist.txt CHECK=$(grep -c $I $MYS_DATA/blacklist.txt)
echo "[+] $I" if [[ $CHECK -lt 1 ]]; then
echo "$(date) [+] $I" >> $MYS_LOGS/twitupd.log echo $I >> $MYS_DATA/blacklist.txt
else echo "[+] $I"
echo "[✔] $I" echo "$(date) [+] $I" >> $MYS_LOGS/twitupd.log
echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log else
fi echo "[✔] $I"
echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log
fi
done
done done