Changeset 4297 in genesis for tools/pencontrl/pencontrl.sh


Ignore:
Timestamp:
Apr 14, 2005, 4:04:56 PM (20 years ago)
Author:
dirk
Message:

een nieuwe pencontrl met fetch

File:
1 edited

Legend:

Unmodified
Added
Removed
  • tools/pencontrl/pencontrl.sh

    r4283 r4297  
    11#!/bin/sh
    2 dir=/usr/local/etc/
    3 dbdir=/var/db
    4 echo > /tmp/proxytest
    5 for i in proxy1 proxy2 proxy3
    6 do
    7   http_proxy=http://$i.wleiden.net:3128/
    8   echo $i >> /tmp/proxytest
    9   wget -t 1 -T 100 -O /dev/null www.planet.nl 2>>/tmp/proxytest
    10 done
    11 awk -f $dir/awkpencontrl /tmp/proxytest | sort -r -n >$dbdir/pensequence
    12 awk '{print $2 " "}' $dbdir/pensequence | tr -d "\n"
     2echo "" > /tmp/tmp
    133
     4get_fetch() {
     5  http_proxy="$1:$2"
     6  export http_proxy
     7  test=`fetch -T 10 -o /dev/null http://www.planet.nl 2>&1`
     8  if [ $? = 0 ]; then
     9    echo "`echo "$test" |grep kBps | \
     10    sed 's/^.*(//' | awk '{print $1}'` $1" >> /tmp/tmp
     11  fi
     12}
     13
     14get_fetch proxy1.wleiden.net 3128
     15get_fetch proxy2.wleiden.net 3128
     16get_fetch proxy3.wleiden.net 3128
     17
     18sort -nr /tmp/tmp
     19
Note: See TracChangeset for help on using the changeset viewer.