summaryrefslogtreecommitdiffstats
path: root/installer/opengnsys_uninstall.sh
diff options
context:
space:
mode:
authorramon <ramongomez@us.es>2010-10-28 17:00:06 +0000
committerramon <ramongomez@us.es>2010-10-28 17:00:06 +0000
commit85fa51e123a01307c92ad4843528fa02451fbe4a (patch)
treeb8266e9d6c53a88ae39a5ffe1ad9165101f83788 /installer/opengnsys_uninstall.sh
parentfbd9bccdad5a4fcd243ed7d471508f11826a3815 (diff)
Script básico para la desinstalación de OpenGnSys.
git-svn-id: https://opengnsys.es/svn/trunk@1328 a21b9725-9963-47de-94b9-378ad31fedc9
Diffstat (limited to 'installer/opengnsys_uninstall.sh')
-rw-r--r--installer/opengnsys_uninstall.sh37
1 files changed, 37 insertions, 0 deletions
diff --git a/installer/opengnsys_uninstall.sh b/installer/opengnsys_uninstall.sh
new file mode 100644
index 00000000..a057bc0b
--- /dev/null
+++ b/installer/opengnsys_uninstall.sh
@@ -0,0 +1,37 @@
+#!/bin/bash
+# Desinstalación de OpenGnSys.
+
+
+# Parar servicio.
+echo "Uninstalling OpenGnSys services."
+if [ -x /etc/init.d/opengnsys ]; then
+ /etc/init.d/opengnsys stop
+ update-rc.d -f opengnsys remove
+fi
+# Eliminar bases de datos.
+echo "Erasing OpenGnSys database."
+MYSQLROOT="passwordroot"
+DROP=1
+if ! mysql -u root -p"$MYSQLROOT" <<<"quit" 2>/dev/null; then
+ stty -echo
+ read -p "- Please, insert MySQL root password: " MYSQLROOT
+ echo ""
+ stty echo
+ if ! mysql -u root -p"$MYSQLROOT" <<<"quit" 2>/dev/null; then
+ DROP=0
+ echo "Warning: database not erased."
+ fi
+fi
+if test $DROP; then
+ mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE ogBDAdmin;" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP DATABASE ogAdmBD;" 2>/dev/null
+ mysql -u root -p"$MYSQLROOT" <<<"DROP USER usuog;" 2>/dev/null
+fi
+# Eliminar ficheros.
+echo "Deleting OpenGnSys files."
+rm -fr /opt/opengnsys
+rm -f /etc/init.d/opengnsys /etc/default/opengnsys
+echo "Post-installation tasks:"
+echo "- You may stop or uninstall manually all other services"
+echo " (DHCP, PXE, TFTP, NFS, Apache, MySQL)."
+