|
@@ -55,7 +55,7 @@ OSInfo() {
|
|
ID_LIKE=""
|
|
ID_LIKE=""
|
|
fi
|
|
fi
|
|
else
|
|
else
|
|
- #UNIX, OS X, ... (No Soportado)
|
|
|
|
|
|
+ # UNIX, OS X, ... (No Soportado)
|
|
DIST=$OS
|
|
DIST=$OS
|
|
REV=""
|
|
REV=""
|
|
fi
|
|
fi
|
|
@@ -159,7 +159,8 @@ mostrarComponentes() {
|
|
printf " OK.\n"
|
|
printf " OK.\n"
|
|
;;
|
|
;;
|
|
\"Database\")
|
|
\"Database\")
|
|
- printf "Instalando Servidor Database..."
|
|
|
|
|
|
+ printf "Instalando Servidor Database"
|
|
|
|
+ instalarDatabase
|
|
printf " OK.\n"
|
|
printf " OK.\n"
|
|
;;
|
|
;;
|
|
\"PHP\")
|
|
\"PHP\")
|
|
@@ -187,6 +188,10 @@ instalarWebServer() {
|
|
"Apache" "Instalar el servidor web Apache2" ON \
|
|
"Apache" "Instalar el servidor web Apache2" ON \
|
|
"Nginx" "Instalar el servidor web Nginx" OFF \
|
|
"Nginx" "Instalar el servidor web Nginx" OFF \
|
|
--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3)
|
|
--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3)
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tInstalación interrumpida por el usuario.\n"
|
|
|
|
+ exit 2
|
|
|
|
+ fi
|
|
# Preguntar otras opciones de configuración
|
|
# Preguntar otras opciones de configuración
|
|
comprobarHostname
|
|
comprobarHostname
|
|
case $webServer in
|
|
case $webServer in
|
|
@@ -248,6 +253,86 @@ instalarNginx() {
|
|
fi
|
|
fi
|
|
}
|
|
}
|
|
|
|
|
|
|
|
+instalarDatabase() {
|
|
|
|
+ if [ $debianOS = true ]; then
|
|
|
|
+ database=$(whiptail --title "Base de Datos" --radiolist "<ESPACIO>: seleccionar <TAB>: cambiar <FLECHAS>: moverse\n\nEscoge la base de datos que quieres usar:" 20 70 2 \
|
|
|
|
+ "MySQL" "Instalar la base de datos MySQL (no uso comercial)" ON \
|
|
|
|
+ "MariaDB" "Instalar la base de datos MariaDB (fork de MySQL)" OFF \
|
|
|
|
+ --ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3)
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tInstalación interrumpida por el usuario.\n"
|
|
|
|
+ exit 2
|
|
|
|
+ fi
|
|
|
|
+ # Preguntar otras opciones de configuración
|
|
|
|
+ case $database in
|
|
|
|
+ MySQL)
|
|
|
|
+ printf " MySQL..."
|
|
|
|
+ instalarMySQL
|
|
|
|
+ ;;
|
|
|
|
+ MariaDB)
|
|
|
|
+ printf " MariaDB..."
|
|
|
|
+ instalarMariaDB
|
|
|
|
+ ;;
|
|
|
|
+ *)
|
|
|
|
+ printf "\nERROR:\tError interno (selección de base de datos).\n"
|
|
|
|
+ exit 1
|
|
|
|
+ ;;
|
|
|
|
+ esac
|
|
|
|
+ elif [ $rhelOS = true ]; then
|
|
|
|
+ whiptail --title "Base de Datos" --yesno "Para su distribucion $OS $DIST $REV, sólo está disponible la base de datos MariaDB." --yes-button "Continuar" --no-button "Salir" 20 70
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tInstalación interrumpida por el usuario.\n"
|
|
|
|
+ exit 2
|
|
|
|
+ fi
|
|
|
|
+ printf " MariaDB.."
|
|
|
|
+ instalarMariaDB
|
|
|
|
+ else
|
|
|
|
+ printf "\nERROR:\tError interno (instalación Base de Datos).\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+instalarMySQL() {
|
|
|
|
+ if [ $debianOS = true ];then
|
|
|
|
+ result=$(apt-get -q -y install mysql-server mysql-client 2>&1)
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tError al instalar MySQL.\n"
|
|
|
|
+ printf "Detalles:\n$result\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ elif [ $rhelOS = true ]; then
|
|
|
|
+ # MySQL no disponible en RHEL. 2 opciones_
|
|
|
|
+ # 1) Instalar un repositorio adicional
|
|
|
|
+ # 2) No instalar MySQL no distribuciones RHEL
|
|
|
|
+ printf "\nERROR:\tRHEL no incluye MySQL en sus repositorios.\n"
|
|
|
|
+ exit 1
|
|
|
|
+ else
|
|
|
|
+ printf "\nERROR:\tError interno (instalación MySQL).\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+instalarMariaDB() {
|
|
|
|
+ if [ $debianOS = true ];then
|
|
|
|
+ result=$(apt-get -q -y install mariadb-server mariadb-client 2>&1)
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tError al instalar MariaDB.\n"
|
|
|
|
+ printf "Detalles:\n$result\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ elif [ $rhelOS = true ]; then
|
|
|
|
+ result=$(yum -y install mariadb-server 2>&1)
|
|
|
|
+ if [ $? -ne 0 ]; then
|
|
|
|
+ printf "\nERROR:\tError al instalar MariaDB.\n"
|
|
|
|
+ printf "Detalles:\n$result\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+ else
|
|
|
|
+ printf "\nERROR:\tError interno (instalación MariaDB).\n"
|
|
|
|
+ exit 1
|
|
|
|
+ fi
|
|
|
|
+}
|
|
|
|
+
|
|
# Comprobamos
|
|
# Comprobamos
|
|
comprobarRoot
|
|
comprobarRoot
|
|
OSInfo
|
|
OSInfo
|