diff options
author | ramon <ramongomez@us.es> | 2011-04-12 18:13:54 +0000 |
---|---|---|
committer | ramon <ramongomez@us.es> | 2011-04-12 18:13:54 +0000 |
commit | 07c3a59dc8d1e46f6f1a865cb3fd33074ed669c5 (patch) | |
tree | f9e031bc40f6769d7b0baca3a94b30407eb1ad6a /installer/opengnsys_installer.sh | |
parent | 42e31fd63a9edf304b6cefb86a3c78b85dd6bc13 (diff) |
Versión 1.0: Detectar conectividad de red en instalador y actualizador (modificar #365).
git-svn-id: https://opengnsys.es/svn/branches/version1.0@1832 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/opengnsys_installer.sh')
-rwxr-xr-x | installer/opengnsys_installer.sh | 21 |
1 files changed, 19 insertions, 2 deletions
diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index 944f9c84..2e74c8ec 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -39,11 +39,12 @@ esac # Comprobar si se ha descargado el paquete comprimido (USESVN=0) o sólo el instalador (USESVN=1). PROGRAMDIR=$(readlink -e $(dirname "$0")) +OPENGNSYS_SERVER="www.opengnsys.es" if [ -d "$PROGRAMDIR/../installer" ]; then USESVN=0 else USESVN=1 - SVN_URL=http://www.opengnsys.es/svn/branches/version1.0 + SVN_URL=http://$OPENGNSYS_SERVER/svn/branches/version1.0 fi WORKDIR=/tmp/opengnsys_installer @@ -496,6 +497,14 @@ function svnExportCode() ### Detectar red ############################################################ +# Comprobar si existe conexión. +function checkNetworkConnection() +{ + OPENGNSYS_SERVER=${OPENGNSYS_SERVER:-"www.opengnsys.es"} + wget --spider -q $OPENGNSYS_SERVER +} + +# Obtener los parámetros de red de la interfaz por defecto. function getNetworkSettings() { # Variables globales definidas: @@ -1157,7 +1166,15 @@ pushd $WORKDIR # Detener servicios de OpenGnSys, si están activos previamente. [ -f /etc/init.d/opengnsys ] && /etc/init.d/opengnsys stop -# Detectar parámetros de red por defecto +# Comprobar si hay conexión y detectar parámetros de red por defecto. +checkNetworkConnection +if [ $? -ne 0 ]; then + errorAndLog "Error connecting to server. Causes:" + errorAndLog " - Network is unreachable, review devices parameters." + errorAndLog " - You are inside a private network, configure the proxy service." + errorAndLog " - Server is temporally down, try agian later." + exit 1 +fi getNetworkSettings if [ $? -ne 0 ]; then errorAndLog "Error reading default network settings." |