summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2020-01-07 12:33:22 +0100
committerRamón M. Gómez <ramongomez@us.es>2020-01-09 14:04:18 +0100
commit663363a1d39ac4d4055ade483c600aeafef8c8ac (patch)
tree158d6675b9d0ba266b0d94f45a803dd4d3e4eefc
parentfd45e9a0abe480db7a7d83b774b12d73e0f5fec9 (diff)
#943: Fix GitHub API URL to check branch update date.
-rwxr-xr-xinstaller/opengnsys_update.sh14
1 files changed, 8 insertions, 6 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index a00b31e2..76da7d10 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -534,7 +534,6 @@ function getNetworkSettings()
local DEVICES
local dev
- echoAndLog "${FUNCNAME}(): Detecting network parameters"
SERVERIP="$ServidorAdm"
DEVICES="$(ip -o link show up | awk '!/loopback/ {sub(/:.*/,"",$2); print $2}')"
for dev in $DEVICES; do
@@ -1150,7 +1149,11 @@ function updateSummary()
# Obtener revisión.
if [ $REMOTE -eq 1 ]; then
# Revisión: rAñoMesDía.Gitcommit (8 caracteres de fecha y 7 primeros de commit).
- REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.commit.committer.date | split("-") | join("")[:8]) + "." + (.commit.sha[:7])')
+ if [ "$BRANCH" = "master" ]; then
+ REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.commit.committer.date | split("-") | join("")[:8]) + "." + (.commit.sha[:7])')
+ else
+ REVISION=$(curl -s "$API_URL" | jq '"r" + (.commit.committer.date | split("-") | join("")[:8]) + "." + (.sha[:7])')
+ fi
else
# Parámetro "release" del fichero JSON.
REVISION=$(jq -r '.release' $PROGRAMDIR/../doc/VERSION.json 2>/dev/null)
@@ -1202,10 +1205,6 @@ function updateSummary()
#####################################################################
-echoAndLog "OpenGnsys update begins at $(date)"
-
-pushd $WORKDIR
-
# Comprobar si hay conexión y detectar parámetros de red por defecto.
checkNetworkConnection
if [ $? -ne 0 ]; then
@@ -1226,6 +1225,9 @@ if [ $? -ne 0 ]; then
exit 1
fi
+echoAndLog "OpenGnsys update begins at $(date)"
+pushd $WORKDIR
+
# Comprobar auto-actualización del programa.
if [ "$PROGRAMDIR" != "$INSTALL_TARGET/bin" ]; then
checkAutoUpdate