purge-stale-projects.sh: Add safeguard against non-functional SSH executable

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-25 17:08:39 +00:00
commit 9fd198bca2

View file

@ -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%/[^/]*%%'`