Advertisement
Guest User

Untitled

a guest
Jan 20th, 2023
112
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Bash 0.97 KB | None | 0 0
  1. #! /usr/bin/env bash
  2.  
  3. url='https://distrowatch.com/table.php?distribution=supergrub'
  4. header_ua='User-Agent: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/94.0.4606.81 Safari/537.36'
  5. header_accept='Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/jxl,image/webp,*/*;q=0.8'
  6. header_lang='Accept-Language: en-US,en;q=0.5'
  7. header_ref='Referer: https://distrowatch.com/'
  8.  
  9. try=0
  10.  
  11. request() {
  12.   [ $try -gt 5 ] && try=0 && return
  13.  
  14.   response=`proxychains -q curl -s -S -o /dev/null -w '%{http_code}' -D - -H "$header_ua" -H "$header_accept" -H "$header_lang" -H "$header_ref" --compressed "$url"`
  15.  
  16.   if [ "${response: -3}" != "200" ]; then
  17.     ((try++))
  18.     #echo "$response"
  19.     #echo -n '. '
  20.     sleep $(shuf -i 2-5 -n 1)
  21.     request
  22.   else
  23.     try=0
  24.     echo 'ok'
  25.   fi
  26. }
  27.  
  28. while true; do
  29.   #proxychains -q curl -s -w ' ' ifconfig.me/ip
  30.   request
  31.   systemctl restart tor
  32.   sleep $(shuf -i 10-20 -n 1)
  33. done
  34.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement