add connection testing early in install script

This commit is contained in:
Trevor Batley 2023-09-28 21:39:57 +10:00
parent c48b42b5f2
commit 1dd0bf5f77

View File

@ -32,6 +32,7 @@ fi
SCRIPT_GIT="https://src.koozali.org/smedev/smeserver-koji/raw/branch/master/koji-setup" SCRIPT_GIT="https://src.koozali.org/smedev/smeserver-koji/raw/branch/master/koji-setup"
SCRIPT_DIR="$(echo ~)/bin" SCRIPT_DIR="$(echo ~)/bin"
echo "Loading required scripts and packages...." ; fi
mkdir -p $SCRIPT_DIR mkdir -p $SCRIPT_DIR
curl $SILENT $SCRIPT_GIT/koji-deploy-hub.sh > $SCRIPT_DIR/koji-deploy-hub.sh curl $SILENT $SCRIPT_GIT/koji-deploy-hub.sh > $SCRIPT_DIR/koji-deploy-hub.sh
curl $SILENT $SCRIPT_GIT/koji-deploy-web.sh > $SCRIPT_DIR/koji-deploy-web.sh curl $SILENT $SCRIPT_GIT/koji-deploy-web.sh > $SCRIPT_DIR/koji-deploy-web.sh
@ -48,6 +49,27 @@ if [[ -z $(dnf list installed | grep netcat) ]] ; then
dnf install -y netcat $QUIET dnf install -y netcat $QUIET
fi 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
echo "I cannot connect to the web server at $KOJI_WEB_FQDN! Is it online? "
echo "Options:"
echo "- turn on the server"
echo "- add this server into the /etc/hosts file on this server"
exit 1
fi
fi
for FQDN in ${KOJI_BUILD_FQDNS} ; do
# check that I can conmnect
if [ ! nc -z $FQDN 22 2>/dev/null ] ; then
echo "I cannot connect to builder at $FQDN! Is it online? "
echo "Options:"
echo "- turn on the server"
echo "- add this server into the /etc/hosts file on this server"
exit 1
fi
done
# ask for required parameters (ssh settings and build server FQDN) # ask for required parameters (ssh settings and build server FQDN)
echo "Please enter the following details for generating your SSL keys" echo "Please enter the following details for generating your SSL keys"
while true ; do while true ; do