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,10 +1,26 @@
#!/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
for URL in ${URLS[@]}; do
for I in $(curl -s $URL); do
CHECK=$(grep -c $I $MYS_DATA/blacklist.txt) CHECK=$(grep -c $I $MYS_DATA/blacklist.txt)
if [[ $CHECK -lt 1 ]]; then if [[ $CHECK -lt 1 ]]; then
echo $I >> $MYS_DATA/blacklist.txt echo $I >> $MYS_DATA/blacklist.txt
@ -14,4 +30,5 @@ for I in $(curl https://www.erb.pw/blacklist 2>/dev/null); do
echo "[✔] $I" echo "[✔] $I"
echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log
fi fi
done
done done