Files
gvm/scripts/function/tools
T
Matt T. Proud 4e117a3ab8 Provide support for FreeBSD.
FreeBSD does not by default install the Bourne-Again Shell (bash); and
when it is installed, it is most certainly not installed to
``/bin/bash`` due to the nuances of the conventions around local site
packages.  Rather, it is installed to ``/usr/local/bin/bash``.

Golang explicitly supports FreeBSD, so it should only be reasonable for
GVM to support this target, too.  As a fix, the shell script shebang
definitions now use the ``env`` tool that comes from the _coreutils_
standard package, which is installed on all conventions-adhering Linux
distributions, Mac OS X, and FreeBSD.

FreeBSD prerequisites are now listed in the documentation.

I have tested this against FreeBSD 9.0 release branch on the amd64,
and it works satisfactorily now.
2012-11-18 20:10:59 +01:00

12 lines
526 B
Bash

#!/usr/bin/env bash
LS_ERROR="GVM couldn't find ls"
GREP_ERROR="GVM couldn't find grep"
SORT_ERROR="GVM couldn't find sort"
HEAD_ERROR="GVM couldn't find head"
LS_PATH=`unalias ls &> /dev/null; which ls` || display_error "$LS_ERROR" || return 1
GREP_PATH=`unalias grep &> /dev/null; which grep` || display_error "$GREP_ERROR" || return 1
SORT_PATH=`unalias sort &> /dev/null; which sort` || display_error "$SORT_ERROR" || return 1
HEAD_PATH=`unalias head &> /dev/null; which head` || display_error "$HEAD_ERROR" || return 1