From b97bf7ed14ff71d10ccc5ab9e54cdf4068e64cbe Mon Sep 17 00:00:00 2001 From: Matteo Cypriani Date: Sat, 22 Mar 2014 12:22:46 -0400 Subject: [PATCH] [cluster] cluster-deploy: check cluster-ping dep. Make sure cluster-ping is present along with cluster-deploy. --- cluster/cluster-deploy.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/cluster/cluster-deploy.sh b/cluster/cluster-deploy.sh index 76aaee3..9775c65 100755 --- a/cluster/cluster-deploy.sh +++ b/cluster/cluster-deploy.sh @@ -81,12 +81,17 @@ fi # Check dependencies PSCP=$(command -v parallel-scp || command -v pscp.pssh || command -v pscp) PRSYNC=$(command -v parallel-rsync || command -v prsync) +CLUSTERPING=$(command -v cluster-ping) if [ "$RSYNC" = "" -a "$PSCP" = "" ] ; then echo "Parallel SSH (pssh) is required for this script to work." exit 4 elif [ "$PRSYNC" = "" ] ; then echo "Parallel rsync (prsync) is required for this script to work." exit 5 +elif [ "$CLUSTERPING" = "" ] ; then + echo "cluster-ping (which should have been provided along with this" + echo "script) is required for this script to work." + exit 6 fi # Hosts' list file @@ -108,10 +113,10 @@ fi # Test the connection to the first host and get the destination # directory (home directory of the remote user) -FIRST_HOST=$(cluster-ping "$HOSTS_LIST_NAME" 2>/dev/null | sed -n "s/ is alive$//p" | head -n1) +FIRST_HOST=$($CLUSTERPING "$HOSTS_LIST_NAME" 2>/dev/null | sed -n "s/ is alive$//p" | head -n1) if [ "$FIRST_HOST" = "" ] ; then echo "None of the remote hosts is alive." - exit 6 + exit 7 fi echo "Testing connection to $FIRST_HOST..." DEST_DIR="$(ssh ${SSH_LOGIN}${FIRST_HOST} 'echo $HOME' 2>/dev/null)"