From 85fa51e123a01307c92ad4843528fa02451fbe4a Mon Sep 17 00:00:00 2001 From: ramon Date: Thu, 28 Oct 2010 17:00:06 +0000 Subject: Script básico para la desinstalación de OpenGnSys. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit git-svn-id: https://opengnsys.es/svn/trunk@1328 a21b9725-9963-47de-94b9-378ad31fedc9 --- installer/opengnsys_installer.sh | 9 ++------- installer/opengnsys_uninstall.sh | 37 +++++++++++++++++++++++++++++++++++++ 2 files changed, 39 insertions(+), 7 deletions(-) create mode 100644 installer/opengnsys_uninstall.sh (limited to 'installer') diff --git a/installer/opengnsys_installer.sh b/installer/opengnsys_installer.sh index b6a00661..cf48d0f4 100755 --- a/installer/opengnsys_installer.sh +++ b/installer/opengnsys_installer.sh @@ -40,8 +40,6 @@ MYSQL_ROOT_PASSWORD="passwordroot" OPENGNSYS_DATABASE=ogAdmBD OPENGNSYS_DB_USER=usuog OPENGNSYS_DB_PASSWD=passusuog -OPENGNSYS_DB_DEFAULTUSER=opengnsys -OPENGNSYS_DB_DEFAULTPASSWD=opengnsys OPENGNSYS_DB_CREATION_FILE=opengnsys/admin/Database/ogAdmBD.sql ##################################################################### @@ -362,7 +360,6 @@ function mysqlImportSqlFileToDb() fi echoAndLog "${FUNCNAME}(): importing sql file to ${database}..." - perl -pi -e "s/SERVERIP/$SERVERIP/g; s/DEFAULTUSER/$OPENGNSYS_DB_DEFAULTUSER/g; s/DEFAULTPASSWD/$OPENGNSYS_DB_DEFAULTPASSWD/g" $sqlfile mysql -uroot -p"${root_password}" --default-character-set=utf8 "${database}" < $sqlfile if [ $? -ne 0 ]; then errorAndLog "${FUNCNAME}(): error while importing $sqlfile in database $database" @@ -1016,17 +1013,15 @@ function installationSummary(){ echoAndLog "Web Console URL: $OPENGNSYS_CONSOLEURL" echoAndLog "Web Console admin user: $OPENGNSYS_DB_USER" echoAndLog "Web Console admin password: $OPENGNSYS_DB_PASSWD" - echoAndLog "Web Console default user: $OPENGNSYS_DB_DEFAULTUSER" - echoAndLog "Web Console default password: $OPENGNSYS_DB_DEFAULTPASSWD" echo echoAndLog "Post-Installation Instructions:" echo "===============================" echoAndLog "Review or edit all configuration files." echoAndLog "Insert DHCP configuration data and restart service." echoAndLog "Log-in as Web Console admin user." - echoAndLog " - Review default Organization data and default user." + echoAndLog " - Review default Organization data and assign default user." echoAndLog "Log-in as Web Console organization user." - echoAndLog " - Insert OpenGnSys data (rooms, computers, etc)." + echoAndLog " - Insert OpenGnSys data (rooms, computers, menus, etc)." echo } 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)." + -- cgit v1.2.3-18-g5258