summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_update.sh
diff options
context:
space:
mode:
authorRamón M. Gómez <ramongomez@us.es>2018-06-12 13:08:52 +0200
committerRamón M. Gómez <ramongomez@us.es>2018-06-12 13:08:52 +0200
commit9815cac93139ec0a4a155934819a887b6436081a (patch)
tree2885c6adab639d6ca71f1a6e87d077024e583ed8 /installer/opengnsys_update.sh
parentc00832504a4a2d0c569850525ed95214a1cffbaa (diff)
#843: Scripts in in^Caller directory use new version file.
Diffstat (limited to 'installer/opengnsys_update.sh')
-rwxr-xr-xinstaller/opengnsys_update.sh7
1 files changed, 4 insertions, 3 deletions
diff --git a/installer/opengnsys_update.sh b/installer/opengnsys_update.sh
index 642d948d..3635f3d8 100755
--- a/installer/opengnsys_update.sh
+++ b/installer/opengnsys_update.sh
@@ -446,11 +446,12 @@ function checkVersion()
local PRE
# Obtener versión actual y versión a actualizar.
- OLDVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null)
+ [ -f $INSTALL_TARGET/doc/VERSION.txt ] && OLDVERSION=$(awk '{print $2}' $INSTALL_TARGET/doc/VERSION.txt 2>/dev/null)
+ [ -f $INSTALL_TARGET/doc/VERSION.json ] && OLDVERSION=$(jq -r '.version' $INSTALL_TARGET/doc/VERSION.json 2>/dev/null)
if [ $REMOTE -eq 1 ]; then
- NEWVERSION=$(curl -s $RAW_URL/doc/VERSION.txt 2>/dev/null | awk '{print $2}')
+ NEWVERSION=$(curl -s $RAW_URL/doc/VERSION.json 2>/dev/null | jq -r '.version')
else
- NEWVERSION=$(awk '{print $2}' $PROGRAMDIR/doc/VERSION.txt 2>/dev/null)
+ NEWVERSION=$(jq -r '.version' $PROGRAMDIR/doc/VERSION.json 2>/dev/null)
fi
[[ "$NEWVERSION" =~ pre ]] && PRE=1