From 6561f32622e5cfeeb68707f32e30010e5aa42f72 Mon Sep 17 00:00:00 2001 From: ramon Date: Wed, 18 Jan 2012 18:04:40 +0000 Subject: Versión 1.0.2a, #000478, #000410: Actualizador de 1.0.2 a 1.0.2a corrige error de IP vacía en servidores con varias interfaces de red. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/trunk@2444 a21b9725-9963-47de-94b9-378ad31fedc9 --- admin/Database/ogAdmBD-1.0.2-1.0.2a.sql | 2 ++ installer/opengnsys_update.sh | 17 +++++++++++++++++ 2 files changed, 19 insertions(+) create mode 100644 admin/Database/ogAdmBD-1.0.2-1.0.2a.sql diff --git a/admin/Database/ogAdmBD-1.0.2-1.0.2a.sql b/admin/Database/ogAdmBD-1.0.2-1.0.2a.sql new file mode 100644 index 00000000..256f39ac --- /dev/null +++ b/admin/Database/ogAdmBD-1.0.2-1.0.2a.sql @@ -0,0 +1,2 @@ +UPDATE ogAdmBD.entornos SET ipserveradm = 'SERVERIP' WHERE ipserveradm = ''; + diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh index ad376290..787d6710 100755 --- a/installer/opengnsys_update.sh +++ b/installer/opengnsys_update.sh @@ -259,6 +259,22 @@ function checkNetworkConnection() wget --spider -q $OPENGNSYS_SERVER } +# Obtener los parámetros de red del servidor. +function getNetworkSettings() +{ + # Variables globales definidas: + # - SERVERIP: IP local de la interfaz por defecto. + + local DEVICES + local dev + + echoAndLog "${FUNCNAME}(): Detecting network parameters." + DEVICES="$(ip -o link show up | awk '!/loopback/ {sub(/:.*/,"",$2); print $2}')" + for dev in $DEVICES; do + [ -z "$SERVERIP" ] && SERVERIP=$(ip -o addr show dev $dev | awk '$3~/inet$/ {sub (/\/.*/, ""); print ($4)}') + done +} + ##################################################################### ####### Funciones específicas de la instalación de Opengnsys @@ -625,6 +641,7 @@ if [ $? -ne 0 ]; then errorAndLog " - Server is temporally down, try agian later." exit 1 fi +getNetworkSettings # Comprobar auto-actualización del programa. if [ "$PROGRAMDIR" != "$INSTALL_TARGET/bin" ]; then -- cgit v1.2.3-18-g5258