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