From 8696759799fa36ccaecf92419fd62adcafadeced Mon Sep 17 00:00:00 2001 From: "Kyle J. McKay" Date: Fri, 23 Aug 2013 17:01:01 -0700 Subject: [PATCH] install.sh: verify git_bin exists and is git As part of the initial installation, verify that $Girocco::Config::git_bin actually exists, is executable, and produces a sane '--version' result. --- install.sh | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/install.sh b/install.sh index c8d62ca..302f9fb 100755 --- a/install.sh +++ b/install.sh @@ -37,6 +37,23 @@ if [ ! -f ezcert.git/CACreateCert ]; then fi +echo "*** Checking for git..." +if [ ! -x "$cfg_git_bin" ]; then + echo "ERROR: $cfg_git_bin does not exist or is not executable" >&2 + exit 1 +fi +if ! git_version="$("$cfg_git_bin" --version)"; then + echo "ERROR: $cfg_git_bin --version failed" >&2 + exit 1 +fi +case "$git_version" in + "git version "*) :;; + *) + echo "ERROR: '$cfg_git_bin --version' output does not start with 'git version '" >&2 + exit 1 +esac + + echo "*** Setting up basedir..." rm -fr "$cfg_basedir" mkdir -p "$cfg_basedir" -- 2.11.4.GIT