blob: a057bc0b62a28321af230d802f9f28ef326c5cdb (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
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)."
|