2Jun/110
Checking proxy list in bash
Hello again!
Now i will tell you how to check proxy list with bash script and curl.
First of all we need to make some page somewhere with content "proxyok" (you can use some free hosting for example), and you should have some proxy list file where every proxy is on a new row and format is host:port.
Now lets begin.
#!/bin/bash
x=0
while [ $x -lt $(cat proxylist.txt | wc -l) ]
do
let x=x+1
PROXY=`head -n $x proxylist.txt | tail -n 1`
echo "Checking proxy $PROXY, number $x"
CONTENT=`curl "http://www.testurl.com/page.html" --proxy "$PROXY" --silent --compressed --progress-bar`
if [ "$CONTENT" == "proxyok" ]
then
echo "proxy is ok!"
echo $PROXY >> activeproxy.txt
else
echo "proxy is DOWN!"
fi
done
Now change "http://www.testurl.com/page.html" with your URL and proxylist.txt to your proxy list.