Date: Sat, 03 Feb 1996 15:32:48 -0800 From: "Jordan K. Hubbard" <jkh@time.cdrom.com> To: Kim Culhan <kimc@w8hd.org> Cc: hackers@freebsd.org Subject: Re: sup is broken? Message-ID: <26932.823390368@time.cdrom.com> In-Reply-To: Your message of "Sat, 03 Feb 1996 13:09:53 EST." <Pine.BSF.3.91.960203125915.304F-100000@moonpie.w8hd.org>
next in thread | previous in thread | raw e-mail | index | archive | help
> I think I looked everywhere for a list of alternate servers but could
> not find it.
% cat > hosts <<EOF
#!/bin/sh
usage()
{
echo "Usage: $0 [-q] domain|top [server-type]"
exit 1
}
if [ $# -lt 1 ]; then
usage
fi
if [ "$1" = "-q" ]; then
quiet=YES
shift
else
quiet=NO
fi
if [ $# -lt 1 ]; then
usage
elif [ $# -lt 2 ]; then
target=ftp
else
target=$2
fi
if [ "$1" != "top" ]; then
domain=$1.freebsd.org
else
domain=freebsd.org
fi
if [ "$quiet" != "YES" ]; then
echo Looking for $target servers in the $domain domain.
fi
# First look for the `base' server. If it doesn't exist, it's pretty much
# assured that there won't be any others.
if host $target.$domain > /dev/null 2>&1 ; then
echo $target.$domain
next=2
while [ $next -ne 0 ]; do
if host $target$next.$domain > /dev/null 2>&1 ; then
echo $target$next.$domain
next=`expr $next + 1`
else
success=NO
next=0
fi
done
fi
exit 0
EOF
% chmod 755 hosts
% ./hosts top sup
Looking for sup servers in the freebsd.org domain.
sup.freebsd.org
sup2.freebsd.org
sup3.freebsd.org
sup4.freebsd.org
Jordan
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?26932.823390368>
