diff options
author | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:48:39 +0200 |
---|---|---|
committer | Ramón M. Gómez <ramongomez@us.es> | 2018-06-14 10:59:34 +0200 |
commit | b60d6b807c580e58f06a337def9a1a83b1f3bcfc (patch) | |
tree | 7ee39403eb4f70a9f7120eb8168d6317b339bf1e /installer/opengnsys_import.sh | |
parent | 5367fb5e61f2e89797bfe7df0e4811a1ff890f08 (diff) | |
parent | e0e4c021382f2c8a66402c545229aa8e528750f9 (diff) |
#794: Applying new commits from {{{devel}}} branch to {{{pjlink}}} branch.
Diffstat (limited to 'installer/opengnsys_import.sh')
-rwxr-xr-x | installer/opengnsys_import.sh | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/installer/opengnsys_import.sh b/installer/opengnsys_import.sh index 6f15ed90..c3b343ee 100755 --- a/installer/opengnsys_import.sh +++ b/installer/opengnsys_import.sh @@ -33,7 +33,8 @@ MYSQLFILE="$TMPDIR/$CATALOG.sql" MYSQLBCK="$OPENGNSYS/doc/$CATALOG.sql-$DATE" LOG_FILE=$OPENGNSYS/log/${PROG%.sh}.log -OPENGNSYS_SERVER="opengnsys.es" +BRANCH="branches/devel" +SVN_URL="https://github.com/opengnsys/OpenGnsys/$BRANCH/admin/Database" DEFAULT_MYSQL_ROOT_PASSWORD="passwordroot" # Clave por defecto root de MySQL # Si se solicita, mostrar ayuda. @@ -219,19 +220,19 @@ if [ $? -ne 0 ]; then fi # Comprobamos si es la misma versión -OLDVERSION=$(awk '{print $2}' $TMPDIR/VERSION.txt) -NEWVERSION=$(awk '{print $2}' $OPENGNSYS/doc/VERSION.txt) +[ -f $TMPDIR/VERSION.txt ] && OLDVERSION=$(awk '{print $2}' $TMPDIR/VERSION.txt) +[ -f $TMPDIR/VERSION.json ] && OLDVERSION=$(jq -r '.version' $TMPDIR/VERSION.json) +NEWVERSION=$(jq -r '.version' $OPENGNSYS/doc/VERSION.json) # FALTA: Comprobar que la versión OLD es menor que la NEW if [ $OLDVERSION != $NEWVERSION ] ; then echo "La versión del servidor no coincide con la del backup." - cat $OPENGNSYS/doc/VERSION.txt $TMPDIR/VERSION.txt + jq -r '[.project, .version, .codename] | join(" ")' $OPENGNSYS/doc/VERSION.json $TMPDIR/VERSION.json read -p "¿Quiere continuar? (y/n): " ANSWER if [ "${ANSWER^^}" != "Y" ]; then echo "Operación cancelada." exit 0 fi # Nos bajamos los archivos de actualización de la base de datos - SVN_URL="https://$OPENGNSYS_SERVER/svn/branches/version${NEWVERSION%.*}/admin/Database" svn checkout "$SVN_URL" $TMPDIR/Database [ $? -ne 0 ] && errorAndLog "$PROG: Error getting code from $SVN_URL" && exit 6 |