From e48700b459486d8bb7ba2dec5d523729b84a919b Mon Sep 17 00:00:00 2001 From: Jan Lindemann Date: Wed, 26 Apr 2017 07:19:17 +0000 Subject: [PATCH] purge-stale-projects.sh: Additional check if ssh works Signed-off-by: Jan Lindemann --- scripts/purge-stale-projects.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/scripts/purge-stale-projects.sh b/scripts/purge-stale-projects.sh index 44f880bd..73aa59e4 100644 --- a/scripts/purge-stale-projects.sh +++ b/scripts/purge-stale-projects.sh @@ -47,12 +47,14 @@ ssh=ssh [ "$JANWARE_USER" ] || JANWARE_USER=`whoami` ssh=`which $ssh` -[ -x "$ssh" ] || { - echo "SSH executable \"$ssh\" not found" - exit 1 -} +[ -x "$ssh" ] || fatal "SSH executable \"$ssh\" not found" ssh="$ssh -l $JANWARE_USER" + +for host in cvs.jannet.de git.jannet.de; do + $ssh $host echo hallo >/dev/null 2>&1 || fatal "Can't ssh into host $host" +done + local_cvs_proj=`ls -d */CVS 2>/dev/null | sed 's%/[^/]*%%'` local_git_proj=`ls -d */.git 2>/dev/null | sed 's%/[^/]*%%'` remote_cvs_proj=`$ssh cvs.jannet.de find /home/jannet/arc/cvs/proj -maxdepth 1 -mindepth 1 -type d -executable -readable | sed 's%.*/%%'`