FASTEST_CVSUP(7)

NAME
fastest_cvsup - find fastest CVSup server

SYNOPSIS
fastest_cvsup [-h] [-(q|Q)] [-r] -c (country codes|local|all)

DESCRIPTION
Displays the 3 fastest CVSup servers in user specified countries. It can just return the fastest for use in automated shell scripts.

It uses Time::HiRes for timings and IO::Socket::INET to make a socket connection to the target server, the server response is taken notice of. Unlike some shell scripts it does not rely on 'pings' to measure network speed.

USAGE

-h  displays usage.

-q  quiet mode - only returns the fastest server and prints a progress meter.

-Q  very quiet mode - in addition the progress meter is not shown.

-r  uses remote CVSup server list from the online FreeBSD Handbook.

    If the variable $REWRITE_SELF is set to 1 in the script then (as if by magic) it re-writes itself with the new server list. This only works as root and does not do it by default.

-c country codes
    this is a list (comma separated, no spaces) of server groups to time.

    FreeBSD servers are grouped into country codes - see the script or the FreeBSD Handbook for a full list.

    NetBSD and OpenBSD servers are lumped together under the 'netbsd' and 'openbsd' codes respectively.

-c local
    uses the countries specifed in the @LOCAL_CC array. Edit the script to specify which countries are considered local.

-c all
    uses all the FreeBSD servers. This may take some time, but is quite interesting!

EXAMPLES

1   times the FreeBSD CVSup servers in the United Kingdom, France and Germany:

        $ fastest_cvsup -c uk,fr,de

2   times the OpenBSD and NetBSD CVSup servers:

        $ fastest_cvsup -c openbsd,netbsd

3   shell script, finds the fastest UK FreeBSD CVSup server, then runs cvsup using that server:

        #!/bin/sh
        if SERVER=`fastest_cvsup -q -c uk`; then
          cvsup -h $SERVER /usr/local/etc/cvsup/supfile
        fi

RETURN VALUES
Returns 0 without any errors, 1 with errors.

AUTHOR
A.J.Robinson, <ajr@subdimension.com>