From ed1e6c762ef20c5e0ac0b7a8922ed80c79387e59 Mon Sep 17 00:00:00 2001 From: Trevor Batley Date: Mon, 2 Oct 2023 12:30:42 +1100 Subject: [PATCH] fix reducing noise on connectivity testing --- install-koji-farm.sh | 8 +++++--- koji-setup/koji-add-builder.sh | 3 ++- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/install-koji-farm.sh b/install-koji-farm.sh index 83de76c..432e89e 100644 --- a/install-koji-farm.sh +++ b/install-koji-farm.sh @@ -51,7 +51,8 @@ fi if [[ ! $KOJI_WEB_FQDN = $KOJI_HUB_FQDN ]] ; then # check that I can conmnect - if [ ! nc -z $KOJI_WEB_FQDN 22 2>/dev/null ] ; then + RESP=$(nc -z $KOJI_WEB_FQDN 22 2>&1 | grep succeeded) + if [[ -z $RESP ]] ; then echo "I cannot connect to the web server at $KOJI_WEB_FQDN! Is it online? " echo "Options:" echo "- turn on the server" @@ -61,7 +62,8 @@ if [[ ! $KOJI_WEB_FQDN = $KOJI_HUB_FQDN ]] ; then fi for FQDN in ${KOJI_BUILD_FQDNS} ; do # check that I can conmnect - if [ ! nc -z $FQDN 22 2>/dev/null ] ; then + RESP=$(nc -z $FQDN 22 2>&1 | grep succeeded) + if [[ -z $RESP ]] ; then echo "I cannot connect to builder at $FQDN! Is it online? " echo "Options:" echo "- turn on the server" @@ -156,7 +158,7 @@ if [[ $KOJI_WEB_FQDN = $KOJI_HUB_FQDN ]] ; then else # deploy remotely to $KOJI_WEB_FQDN # check that I can conmnect - if [ ! nc -z $KOJI_WEB_FQDN 22 2>/dev/null ] ; then + if [ ! nc -z $KOJI_WEB_FQDN 22 ] ; then echo "I cannot connect to $KOJI_WEB_FQDN! Is it online? " echo "Options:" echo "- turn on the server" diff --git a/koji-setup/koji-add-builder.sh b/koji-setup/koji-add-builder.sh index 8304fa5..31d9e9b 100644 --- a/koji-setup/koji-add-builder.sh +++ b/koji-setup/koji-add-builder.sh @@ -50,7 +50,8 @@ if [ -z $KOJI_BUILD_FQDN ] ; then KOJI_BUILD_FQDN=$KOJI_HUB_FQDN fi -if [ ! nc -z $KOJI_BUILD_FQDN 22 2>/dev/null ] ; then +RESP=$(nc -z $KOJI_BUILD_FQDN 22 2>&1 | grep succeeded) +if [[ -z $RESP ]] ; then echo "I cannot connect to $KOJI_BUILD_FQDN! Is it online? " echo "Options:" echo "- turn on the server"