summaryrefslogtreecommitdiffstats
path: root/Reaktor/commands
diff options
context:
space:
mode:
Diffstat (limited to 'Reaktor/commands')
-rwxr-xr-xReaktor/commands/taken28
-rwxr-xr-xReaktor/commands/whois4
2 files changed, 32 insertions, 0 deletions
diff --git a/Reaktor/commands/taken b/Reaktor/commands/taken
new file mode 100755
index 00000000..b8beba68
--- /dev/null
+++ b/Reaktor/commands/taken
@@ -0,0 +1,28 @@
+#!/bin/sh
+#!/bin/bash
+
+# domainavailable
+# Fast, domain name checker to use from the shell
+# Use globs for real fun:
+# domainavailable blah{1..3}.{com,net,org,co.uk}
+# Inspired by foca / giles:
+# http://gilesbowkett.blogspot.com/2009/02/simple-bash-domain-availability.html
+
+for d in $@;
+do
+if host "$d" | grep "NXDOMAIN" >&/dev/null; then
+ w=$(whois "$d")
+ if ! test "$?" -eq 0 ;then
+ echo "$d - whois not available"
+ elif echo "$w" | grep -Ei "(No match|NOT FOUND|Status: free)" >&/dev/null; then
+ echo "$d available";
+ elif echo "$w"| grep -Ei "(Status: invalid)" >&/dev/null ;then
+ echo "$d invalid"
+ else
+ echo "$d taken";
+ fi
+else
+ echo "$d taken";
+fi
+done
+exit 0
diff --git a/Reaktor/commands/whois b/Reaktor/commands/whois
new file mode 100755
index 00000000..b0733891
--- /dev/null
+++ b/Reaktor/commands/whois
@@ -0,0 +1,4 @@
+#!/bin/sh
+(! type whois >/dev/null 2>/dev/null) && echo "whois does not exist" && exit 0
+
+whois "${1?usage: $0 domain}" | sed -e '/^$/d' -e '/^%/d' -e '/^Nserver/d' -e 's/^\[.*/---/' -e '/^Changed/d' -e '/^Status/d' -e '/^Type/d' -e '/^PostalCode/d' -e '/^Phone/d' -e '/^Fax/d' -e '/Last update of WHOIS database/Q' -e '/ID:/d'