From 9fd198bca253b022e941b1cb3bc0f5f844d3dbaf Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Tue, 25 Apr 2017 17:08:39 +0000 Subject: [PATCH] purge-stale-projects.sh: Add safeguard against non-functional SSH executable Signed-off-by: Jan Lindemann --- scripts/purge-stale-projects.sh | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/scripts/purge-stale-projects.sh b/scripts/purge-stale-projects.sh index 016a6310..44f880bd 100644 --- a/scripts/purge-stale-projects.sh +++ b/scripts/purge-stale-projects.sh @@ -45,6 +45,13 @@ ssh=ssh [ "$CVS_RSH" ] && ssh="$CVS_RSH" [ "$GIT_SSH" ] && ssh="$GIT_SSH" [ "$JANWARE_USER" ] || JANWARE_USER=`whoami` +ssh=`which $ssh` + +[ -x "$ssh" ] || { + echo "SSH executable \"$ssh\" not found" + exit 1 +} + ssh="$ssh -l $JANWARE_USER" local_cvs_proj=`ls -d */CVS 2>/dev/null | sed 's%/[^/]*%%'` local_git_proj=`ls -d */.git 2>/dev/null | sed 's%/[^/]*%%'`