fetch archaic binaries blacklisted ip's too
This commit is contained in:
parent
594d857188
commit
fd63734b64
41
twitupd.sh
41
twitupd.sh
@ -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 "[[1;32m+[0m] $I"
|
if [[ $CHECK -lt 1 ]]; then
|
||||||
echo "$(date) [+] $I" >> $MYS_LOGS/twitupd.log
|
echo $I >> $MYS_DATA/blacklist.txt
|
||||||
else
|
echo "[[1;32m+[0m] $I"
|
||||||
echo "[[1;33m✔[0m] $I"
|
echo "$(date) [+] $I" >> $MYS_LOGS/twitupd.log
|
||||||
echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log
|
else
|
||||||
fi
|
echo "[[1;33m✔[0m] $I"
|
||||||
|
echo "$(date) [✔] $I" >> $MYS_LOGS/twitupd.log
|
||||||
|
fi
|
||||||
|
done
|
||||||
done
|
done
|
||||||
|
Loading…
x
Reference in New Issue
Block a user