Usefull script to check if a proxy is alive.
bash |copy code |?
01 #!/bin/bash02 # HTTP Proxy Server's IP Address (or URL)03 proxy_server=$104 05 06 # HTTP Proxy Server's Port Number07 08 port=$209 10 # We're trying to reach this url via the given HTTP Proxy Server11 12 # (http://www.google.com by default)13 url="http://www.google.com"14 15 16 # Timeout time (in seconds)17 18 timeout=2019 20 # We're fetching the return code and assigning it to the $result variable21 result=`HEAD -d -p http://$proxy_server:$port -t $timeout $url`22 23 # If the return code is 200, we've reached to $url successfully24 if [ "$result" = "200 OK" ]; then25 echo "1 (proxy works)"26