diff --git a/test.sh b/test.sh index c09aa21..b0edba5 100755 --- a/test.sh +++ b/test.sh @@ -19,22 +19,13 @@ if [ "`git log --pretty=%H ...refs/heads/master^ | head -n 1`" != "`git ls-remot exit 0 fi - -if [ ! -z ${LOCAL_SERVICES+x} ]; - then NCMD='ssh root@10.5.10.51' - else NCMD='' -fi -echo "HERE: (${NODE_HOSTNAME})" -for rcheck in "${REPL_CHECK[@]}"; do - ${NCMD} rm -f ${FOLDER}/test.repl - daterun=`date +%Y-%m-%d-%H-%M-%S` - if [ "${NCMD}" = "" ]; then - echo -e "iDS-Node${nid} (${nip})\n${daterun}" > ${FOLDER}/test.repl - yes | cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl - else - ${NCMD} "echo -e \"Status-Check (${NODE_HOSTNAME})\n${daterun}\" > ${FOLDER}/test.repl" - yes | ${NCMD} "cp -rfH ${FOLDER}/test.repl ${REPL_CHECKS[${rcheck}]}/test.repl" +CHECK_HOST(){ + ping -c 3 ${1} > /dev/null 2>&1 + if [ $? -ne 0 ]; then + echo false + else echo true fi - echo "${FOLDER}/test.repl" - ${NCMD} "cat ${REPL_CHECKS[${rcheck}]}/test.repl" -done +} + + +echo CHECK_HOST \ No newline at end of file