diff options
author | makefu <github@syntax-fehler.de> | 2015-08-28 23:39:37 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-08-28 23:39:37 +0200 |
commit | 7eba4293714b9dce86c07ccf2fdaddaa11a4c3c7 (patch) | |
tree | 28fdc7158cd28e4b25cf5674ab54da8da8b69c1e /reaktor/commands/taken | |
parent | 15026716ab3057998cf2f487742c2dd8e185335c (diff) |
Reaktor: add nix support, packaging
Diffstat (limited to 'reaktor/commands/taken')
-rwxr-xr-x | reaktor/commands/taken | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/reaktor/commands/taken b/reaktor/commands/taken new file mode 100755 index 0000000..b8beba6 --- /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 |