diff options
author | makefu <github@syntax-fehler.de> | 2015-08-28 08:50:06 +0200 |
---|---|---|
committer | makefu <github@syntax-fehler.de> | 2015-08-28 08:50:06 +0200 |
commit | 31dd24af3e6721d1763b85ace640517024de39f2 (patch) | |
tree | fda76ce29417e71f00b6d76e25b72cf297ef63f9 /Reaktor | |
parent | f1be3f6d1e4e864b195db3527fecdb53eb2f02dd (diff) |
Reaktor/whatweb: also check for path"
Diffstat (limited to 'Reaktor')
-rwxr-xr-x | Reaktor/commands/whatweb | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/Reaktor/commands/whatweb b/Reaktor/commands/whatweb index 68f8aa38..36711efa 100755 --- a/Reaktor/commands/whatweb +++ b/Reaktor/commands/whatweb @@ -1,7 +1,17 @@ #!/bin/sh #wrapper for WhatWeb -here=$(dirname `readlink -f $0`) -whatweb_bin="$here/../repos/whatweb/whatweb" -[ ! -e "$whatweb_bin" ] && echo "!! Whatweb app does not exist" && exit 1 +set -eu + +# whatweb is in path? +whatweb=whatweb +if ! type -p whatweb >/dev/null 2>&1 ;then + here=$(dirname `readlink -f $0`) + whatweb="$here/../repos/whatweb/whatweb" + if ! test -e "$whatweb" then + echo "!! cannot find usable whatweb installation in path or basedir ($whatweb)" + exit 1 + fi +fi + [ -z "${1:-}" ] && echo "!! no host given" && exit 1 exec $whatweb_bin --user-agent="Mozilla/5.0 (Windows NT 6.1; Win64; x64; rv:25.0) Gecko/20100101 Firefox/25.0" -a 3 "$1" 2>&1 |