whois script

From: Paul Roddy (proddy_at_noemail.com.com)
Date: 10/06/04


Date: Wed, 6 Oct 2004 10:20:40 -0500

I want to write a small script to check the whois information for domains
that I want to check on. The information I want is when the domain expires.
problem I am having is when I check a .com domain, the text returned is
"Expires" and when I check a .ca domain, the text I'm looking for is
"Renewal" How can I write this script to check for either word and grep it
out without having to run the whois command twice?

Here's my script so far:

#!/bin/sh
echo
echo -n "Enter domain name to check: "
read DOMAIN
echo "Checking whois information for $DOMAIN..."
whois $DOMAIN | grep Expires
whois $DOMAIN | grep Renewal



Relevant Pages

  • Re: auto-response IDS againt port-scanning or attacked ip?
    ... (the IP address of the attacker, and the time of the attack). ... (another trick I use in a different script is do a whois ... In this script, I also do a grep of the httpd logs for signs ... echo To: $email_to, "$email_to2" ...
    (Focus-IDS)
  • Re: Hacked - FreeBSD 7.1-Release
    ... I've written my own script to do all of this. ... security mails, and does WHOIS lookups + parses the ... Because I'm fairly familiar with it, I use IPFW. ... I also configure IPFW to log all SSH ...
    (freebsd-stable)
  • Re: Yantbsp (yet another new to bash scripting post)
    ... >>> output of the whois to the registrar and domain servers. ... >> one), the script can fail. ... >> calls to whois, use sleep. ...
    (comp.unix.shell)
  • Re: Yantbsp (yet another new to bash scripting post)
    ... >> output of the whois to the registrar and domain servers. ... > one), the script can fail. ... > calls to whois, use sleep. ...
    (comp.unix.shell)
  • Re: Hacked - FreeBSD 7.1-Release
    ... I've written my own script to do all of this. ... care to share your whois lookup / parsing script for this? ... Because I'm fairly familiar with it, I use IPFW. ... I'm fortunate to be able to only allow SSH access to known hosts; ...
    (freebsd-stable)