From a0868b7012b2a8aba33b34b0cf08741ea2b97725 Mon Sep 17 00:00:00 2001 From: Irina Gómez Date: Tue, 19 May 2020 14:36:41 +0200 Subject: #954 opengnsys_import.sh: Fix error when options --exclude-logs or --exclude-users are used --- installer/opengnsys_import.sh | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'installer') diff --git a/installer/opengnsys_import.sh b/installer/opengnsys_import.sh index 9b5a2b00..7dcaad3f 100755 --- a/installer/opengnsys_import.sh +++ b/installer/opengnsys_import.sh @@ -296,7 +296,7 @@ if [ "$CHECK" ]; then fi # Parámetros especiales de restauración. -[ "$NOLOGS" ] && TARPARMS="--exclude=$PREFIX/log/" +[ "$NOLOGS" ] && TARPARAMS="--exclude=$PREFIX/log" # Descomprimimos backup tar -xvzf $BACKUPFILE --directory /tmp $TARPARAMS &>/dev/null @@ -354,11 +354,13 @@ fi # definimos valores adecuados por defecto. # Excluding repository table import, if needed. [ "$NOREPOS" ] && sed -i -e '/Table structure.* `repositorios`/,/Table structure/d' $MYSQLFILE -[ "$NOUSERS" ] && sed -i -e '/Table structure.*`usuarios`/,/CHARSET/d' \ - -e '/usuarios/s/IGNORE//g' \ - -e '/usuarios/s/^INSERT /\nALTER TABLE usuarios ADD UNIQUE (usuario);\n\nINSERT IGNORE /g' \ +[ "$NOUSERS" ] && sed -i -e '/INSERT INTO `usuarios`/s/^/\/*/' \ + -e '/INSERT INTO `usuarios`/s/$/*\//' \ $MYSQLFILE sed -i -e '/Table structure.* `entornos`/,/Table structure/d' \ + -e '/Table structure.*`usuarios`/,/CHARSET/d' \ + -e '/usuarios/s/IGNORE//g' \ + -e '/usuarios/s/^INSERT /\nALTER TABLE usuarios ADD UNIQUE (usuario);\n\nINSERT IGNORE /g' \ -e "s/\(DEFINER=\`\)[^\`]*\(\`.* TRIGGER\)/\1$USUARIO\2/" \ -e "s/\(\` [a-z]*int([0-9]*) NOT NULL\),/\1 DEFAULT 0,/" \ -e "s/\(\` [a-z]*char([0-9]*) NOT NULL\),/\1 DEFAULT '',/" \ -- cgit v1.2.3-18-g5258