aboutsummaryrefslogtreecommitdiffstats
path: root/commands
diff options
context:
space:
mode:
authormakefu <root@pigstarter.de>2014-06-16 17:25:08 +0200
committermakefu <root@pigstarter.de>2014-06-16 17:25:08 +0200
commitd31fe67cd498d63751e4163c642c7683f3d86bd1 (patch)
tree910f92ea4a0c0197859ffad2ebb1a1db029643ed /commands
parent6bad25925c16d3061f5409e07f72636284bb373f (diff)
add stolen domain lookup shitz
Diffstat (limited to 'commands')
-rw-r--r--commands/taken28
1 files changed, 28 insertions, 0 deletions
diff --git a/commands/taken b/commands/taken
new file mode 100644
index 0000000..0b7424e
--- /dev/null
+++ b/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
+
+trap 'exit 1' INT TERM EXIT
+
+for d in $@;
+do
+if host $d | grep "NXDOMAIN" >&/dev/null; then
+ if whois $d | grep -Ei "(No match|NOT FOUND|Status: free)" >&/dev/null; then
+ echo "$d available";
+ else
+ if whois $d >&/dev/null;then
+ echo "$d taken";
+ else
+ echo "$d - whois not available"
+ fi
+ fi
+else
+ echo "$d taken";
+fi
+done