purge-stale-projects.sh: Additional check if ssh works

Signed-off-by: Jan Lindemann <jan@janware.com>
This commit is contained in:
Jan Lindemann 2017-04-26 07:19:17 +00:00
commit e48700b459

View file

@ -47,12 +47,14 @@ ssh=ssh
[ "$JANWARE_USER" ] || JANWARE_USER=`whoami` [ "$JANWARE_USER" ] || JANWARE_USER=`whoami`
ssh=`which $ssh` ssh=`which $ssh`
[ -x "$ssh" ] || { [ -x "$ssh" ] || fatal "SSH executable \"$ssh\" not found"
echo "SSH executable \"$ssh\" not found"
exit 1
}
ssh="$ssh -l $JANWARE_USER" 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_cvs_proj=`ls -d */CVS 2>/dev/null | sed 's%/[^/]*%%'`
local_git_proj=`ls -d */.git 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%.*/%%'` remote_cvs_proj=`$ssh cvs.jannet.de find /home/jannet/arc/cvs/proj -maxdepth 1 -mindepth 1 -type d -executable -readable | sed 's%.*/%%'`