#!/bin/bash # Christopher Jones # 08/09/2013 # checkproxies.sh # script checks proxies from proxy list and outputs the good ones to a file #Proxy List Proxylist=./proxies.txt #Output File OUTFILE=./goodproxies.txt #Clear File echo -n > $OUTFILE index=0 while read line ; do IPARRAY[$index]="$line" index=$(($index+1)) done < $Proxylist #Set Field Seperator to New Line OLD_IFS="$IFS" IFS=" " # Run Test on each Proxy for IP in ${IPARRAY[@]}; do nc -w 3 -z "$IP" 1>/dev/null 2>&1; result=$?; if [ $result -eq 0 ]; then echo "$IP proxy is up" else echo "$IP proxy is down" fi done IFS="$OLD_IFS"