summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_uninstall.sh
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2014-01-31 08:46:49 +0000
committerramon <ramongomez@us.es>2014-01-31 08:46:49 +0000
commit00829fada60a7a934cce383bb2a0fe185ae971df (patch)
treee3e56a9be1505984f241e7b17f3807fd60cb811e /installer/opengnsys_uninstall.sh
parent957d1a195f467035057db33281d1213de1ad7867 (diff)
#627: Corregida errata en desinstalador para eliminar correctamente la BD.
git-svn-id: https://opengnsys.es/svn/branches/version1.0@4124 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/opengnsys_uninstall.sh')
-rwxr-xr-xinstaller/opengnsys_uninstall.sh6
1 files changed, 4 insertions, 2 deletions
diff --git a/installer/opengnsys_uninstall.sh b/installer/opengnsys_uninstall.sh
index 123da0f1..8c206db1 100755
--- a/installer/opengnsys_uninstall.sh
+++ b/installer/opengnsys_uninstall.sh
@@ -75,10 +75,12 @@ if test $DROP; then
user=root
password=$MYSQL_ROOT_PASSWORD
EOT
+ # Borrar fichero de credenciales si se corta el proceso de acceso a la BD.
+ trap "rm -f $MYCNF" 0 1 2 3 6 9 15
# Eliminar bases de datos.
mysql --defaults-extra-file=$MYCNF 2> /dev/null << EOT
-DROP DATABASE $OPENGNSYS_OLDDATABASE;
-DROP DATABASE $OPENGNSYS_DATABASE;
+DROP DATABASE IF EXISTS $OPENGNSYS_OLDDATABASE;
+DROP DATABASE IF EXISTS $OPENGNSYS_DATABASE;
DROP USER '$OPENGNSYS_DB_USER';
DROP USER '$OPENGNSYS_DB_USER'@'localhost';
EOT