diff options
| author | makefu <root@pigstarter.de> | 2014-06-16 17:43:20 +0200 | 
|---|---|---|
| committer | makefu <root@pigstarter.de> | 2014-06-16 17:43:20 +0200 | 
| commit | 438a8a9f99e72dc9c8ccda3f657f9338220f4c41 (patch) | |
| tree | 334f26e1a4eb7edc0e508addc21e09d67df6908c /Reaktor/commands/taken | |
| parent | 12b9b3c3080ded934425f6eda59de26ec6a103eb (diff) | |
update taken script
Diffstat (limited to 'Reaktor/commands/taken')
| -rwxr-xr-x[-rw-r--r--] | Reaktor/commands/taken | 18 | 
1 files changed, 9 insertions, 9 deletions
| diff --git a/Reaktor/commands/taken b/Reaktor/commands/taken index 0b7424ed..b8beba68 100644..100755 --- a/Reaktor/commands/taken +++ b/Reaktor/commands/taken @@ -8,21 +8,21 @@  # 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 +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 -        if whois $d >&/dev/null;then -            echo "$d taken"; -        else -            echo "$d - whois not available" -        fi +        echo "$d taken";      fi  else      echo "$d taken";  fi  done +exit 0 | 
