Friday, July 6, 2012

Simple bash script for checking pendingDeleted

Back when I really wanted to snag Qweex.com, it was in a pendingDeleted status for quite some time and I wasn't exactly sure when it would expire and I was uber paranoid, so I wrote a little bash script. All it requires is bash (or some other shell), whois, and mail.

#!/bin/bash
COUNTER=1
GOTIME=1
while [ $GOTIME != 0 ]; do
    whois qweex.com | grep --quiet pendingDeleted
    GOTIME=$?
    echo "($COUNTER) $( date +%r)"
    COUNTER=$((COUNTER+1))
    sleep 500
done
echo "IT IS TIME" | mail freewarewire@gmail.com

(The e-mail actually sent to my phone so I would essentially be text-notified, but I changed it for obvious reasons.) I'm certainly not proficient in bash scripting yet, but I ran across this when moving my files over to Arch (a post is forthcoming) and I just thought "Aww, how cute". And maybe one day, when Qweex has inevitably made me a million dollars, people will look back at this as to how it all started.

If I recall correctly, this didn't work.

-Bry

No comments:

Post a Comment