Register
It is currently Thu Jul 31, 2014 11:45 pm

Domain availability checker


All times are UTC - 6 hours


Post new topic Reply to topic  [ 3 posts ] 
Author Message
 PostPosted: Fri Dec 07, 2012 6:07 am   

Joined: Fri May 16, 2008 4:58 am
Posts: 94
While looking for a script to check domain availability I came across this one

Code:
#!/bin/bash

clear; echo Checking domains

i=0;
for var in "$@"
do
    tput sc; tput cup 0 0; echo '                      '
    tput cup 0 0; echo Checking $var
    tput rc

    whois $var.org.uk | grep "No match"
    whois $var.co.uk | grep "No match"

    let i++;

    if [ $i == 2 ]; then
      tput sc; tput cup 0 25; echo 'Waiting politely...'
      sleep 1;
      tput cup 0 25; echo '                   '
      tput rc
      i=0;
    fi

done


What i'd like to be able to do is if it returns

No match for "$var.co.uk" that it will send me an email ie

if status = no match then sendEmail


Top
 Profile  
 PostPosted: Fri Dec 07, 2012 9:09 am   

Joined: Mon Mar 02, 2009 3:03 am
Posts: 534
hi,

more or less:
Code:
var="watael"
for v in "$var".{co,org}.uk
do
   whois "$v" | grep -q "No match for \"$v\"." && mail -s "available domain" watael@localhost <<<"$v"
done
do you plan to pass multiple arguments to the script?


Top
 Profile  
 PostPosted: Fri Dec 07, 2012 10:43 am   

Joined: Fri May 16, 2008 4:58 am
Posts: 94
no it's only for a single domain to check to see if it's been dropped thanks for your help


Top
 Profile  
Display posts from previous:  Sort by  
Post new topic Reply to topic  [ 3 posts ] 

All times are UTC - 6 hours


Who is online

Users browsing this forum: No registered users and 6 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
cron


BashScripts | Promote Your Page Too
Powered by phpBB © 2011 phpBB Group
© 2003 - 2011 USA LINUX USERS GROUP