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