summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--admin/Database/ogAdmBD-1.0.2-1.0.2a.sql2
-rwxr-xr-xinstaller/opengnsys_update.sh17
2 files changed, 19 insertions, 0 deletions
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