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"