LDP/LDP/guide/docbook/abs-guide/ex18.sh

33 lines
818 B
Bash
Raw Normal View History

2001-07-10 14:25:50 +00:00
#!/bin/bash
2005-02-09 20:53:43 +00:00
# ex18.sh
2001-07-10 14:25:50 +00:00
2001-09-04 13:27:31 +00:00
# Does a 'whois domain-name' lookup on any of 3 alternate servers:
# ripe.net, cw.net, radb.net
2001-07-10 14:25:50 +00:00
2005-05-08 20:09:31 +00:00
# Place this script -- renamed 'wh' -- in /usr/local/bin
2001-07-10 14:25:50 +00:00
# Requires symbolic links:
# ln -s /usr/local/bin/wh /usr/local/bin/wh-ripe
2010-03-17 13:43:35 +00:00
# ln -s /usr/local/bin/wh /usr/local/bin/wh-apnic
# ln -s /usr/local/bin/wh /usr/local/bin/wh-tucows
2001-07-10 14:25:50 +00:00
2010-03-17 13:43:35 +00:00
E_NOARGS=75
2005-02-09 20:53:43 +00:00
2001-07-10 14:25:50 +00:00
if [ -z "$1" ]
then
echo "Usage: `basename $0` [domain-name]"
2005-02-09 20:53:43 +00:00
exit $E_NOARGS
2001-07-10 14:25:50 +00:00
fi
2005-02-09 20:53:43 +00:00
# Check script name and call proper server.
2005-05-08 20:09:31 +00:00
case `basename $0` in # Or: case ${0##*/} in
2010-03-17 13:43:35 +00:00
"wh" ) whois $1@whois.tucows.com;;
"wh-ripe" ) whois $1@whois.ripe.net;;
"wh-apnic" ) whois $1@whois.apnic.net;;
"wh-cw" ) whois $1@whois.cw.net;;
* ) echo "Usage: `basename $0` [domain-name]";;
2001-09-04 13:27:31 +00:00
esac
2001-07-10 14:25:50 +00:00
2005-05-08 20:09:31 +00:00
exit $?