#!/bin/sh # check http://www.socksproxy.de/ for proxies my_proxies=(`cat /etc/banners/proxies`) ## store the whole file in an array LOBOUND=0 HIBOUND=10000000 killall -9 wget >/dev/null sleep 5 for i in 1 2 3;do num=$(( $LOBOUND + ($HIBOUND * $RANDOM) / (32767 + 1) )) no_of_proxies=${#my_proxies[@]} ## get no. of elements in array ## % is modulus operator line_to_get=$(( $num % $no_of_proxies )) ## N.B.: max. 32767 myproxy=${my_proxies[$line_to_get]} param="http://banner.kiev.ua/cgi-bin/bi.cgi?i13282&$num&2" /usr/bin/wget --spider --tries=1 --timeout=20 --ignore-length -C off -Y on -q -e http_proxy=$myproxy $param 2>>/etc/banners/b2.log RETURN=$? # if proxy is working if [ $RETURN==0 ]; then param="http://banner.kiev.ua/cgi-bin/bi.cgi?i19244&$num&2" /usr/bin/wget --spider --tries=1 --timeout=20 --ignore-length -C off -Y on -q -e http_proxy=$myproxy $param 2>>/etc/banners/b2.log fi done for i in 1 2 3 4 5;do num=$(( $LOBOUND + ($HIBOUND * $RANDOM) / (32767 + 1) )) no_of_proxies=${#my_proxies[@]} ## get no. of elements in array ## % is modulus operator line_to_get=$(( $num % $no_of_proxies )) ## N.B.: max. 32767 myproxy=${my_proxies[$line_to_get]} param="http://banner.kiev.ua/cgi-bin/bi.cgi?h13282&$num&2" /usr/bin/wget --spider --tries=1 --timeout=20 --ignore-length -C off -Y on -q -e http_proxy=$myproxy $param 2>>/etc/banners/b2.log RETURN=$? # if proxy is working if [ $RETURN==0 ]; then param="http://banner.kiev.ua/cgi-bin/bi.cgi?h19244&$num&2" /usr/bin/wget --spider --tries=1 --timeout=20 --ignore-length -C off -Y on -q -e http_proxy=$myproxy $param 2>>/etc/banners/b2.log fi done exit 0