From 506c6708cd59e98dfad67a76f08afa83a09fdc72 Mon Sep 17 00:00:00 2001 From: "Ramón M. Gómez" Date: Tue, 1 Oct 2019 14:04:27 +0200 Subject: #914: Installer and updater check HTTP and HTTPS connections to avoid proxy configuration errors. --- installer/opengnsys_installer.sh | 10 ++++++---- installer/opengnsys_update.sh | 6 ++++-- 2 files changed, 10 insertions(+), 6 deletions(-) (limited to 'installer') diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 89c94082..f359f369 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -838,10 +838,12 @@ function checkNetworkConnection() { echoAndLog "${FUNCNAME}(): Checking OpenGnsys server connectivity." OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"opengnsys.es"} - if which wget &>/dev/null; then - wget --spider -q $OPENGNSYS_SERVER - elif which curl &>/dev/null; then - curl --connect-timeout 10 -s $OPENGNSYS_SERVER -o /dev/null + if which curl &>/dev/null; then + curl --connect-timeout 10 -s "https://$OPENGNSYS_SERVER/" -o /dev/null && \ + curl --connect-timeout 10 -s "http://$OPENGNSYS_SERVER/" -o /dev/null + elif which wget &>/dev/null; then + wget --spider -q "https://$OPENGNSYS_SERVER/" && \ + wget --spider -q "http://$OPENGNSYS_SERVER/" else echoAndLog "${FUNCNAME}(): Cannot execute \"wget\" nor \"curl\"." return 1 diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index a59e1d99..5aed44de 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -452,9 +452,11 @@ function checkNetworkConnection() { OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"opengnsys.es"} if which curl &>/dev/null; then - curl --connect-timeout 10 -s $OPENGNSYS_SERVER -o /dev/null + curl --connect-timeout 10 -s "https://$OPENGNSYS_SERVER" -o /dev/null && \ + curl --connect-timeout 10 -s "http://$OPENGNSYS_SERVER" -o /dev/null elif which wget &>/dev/null; then - wget --spider -q $OPENGNSYS_SERVER + wget --spider -q "https://$OPENGNSYS_SERVER" && \ + wget --spider -q "http://$OPENGNSYS_SERVER" else echoAndLog "${FUNCNAME}(): Cannot execute \"wget\" nor \"curl\"." return 1 -- cgit v1.2.3-18-g5258