| 
					
				 | 
			
			
				@@ -151,24 +151,12 @@ instalacionExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	actualizacionesOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-comprobarHostname() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	while [ -z $hostname ]; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		hostname=$(whiptail --title "HOSTNAME" --inputbox "El nombre de dominio de este servidor es:\n"$(hostname)"\n\nQuieres cambiarlo por otro?" --ok-button "Cambiar" --cancel-button "No Cambiar" 20 70 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		if [ $? -eq 0 ] && [ ! -z $hostname ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			hostnamectl set-hostname $hostname 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			hostname=$(hostname) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	done 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#printf "\nHostname: $hostname\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				- 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarBienvenida() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = false ] && [ $rhelOS = false ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		whiptail --title "ERROR S.O. NO SOPORTADO" --msgbox "Este script automatiza la creación de una web MediaWiki SOLO para distribuciones Linux de la familia Debian (Ubuntu, Linux Mint, ...) y de la familia Red-Hat (CentOS, Fedora, ...).\n\nInformación del sistema:\nOS: $OS $DIST $REV\n$HDInfo" --ok-button "Salir" 20 70 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		whiptail --title "ERROR S.O. NO SOPORTADO" --msgbox "Este script automatiza la creación de una web MediaWiki SOLO para distribuciones Linux de la familia Debian (Ubuntu, Linux Mint, ...) y de la familia Red-Hat (CentOS, Fedora, ...).\n\nInformación del sistema:\nOS: $OS $DIST $REV\n$HDInfo" 20 70 --ok-button "Salir" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		exit 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	whiptail --title "INSTALACION MEDIAWIKI" --yesno "Este script automatiza completamente la instalación de una wiki.\nPara ello instala un servidor LAMP, el software MediaWiki y lo configura todo.\n\nInformación del sistema:\nOS: $OS $DIST $REV\n$HDInfo" --yes-button "Continuar" --no-button "Salir" 20 70 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	whiptail --title "INSTALACION MEDIAWIKI" --yesno "Este script automatiza completamente la instalación de una wiki.\nPara ello instala un servidor LAMP, el software MediaWiki y lo configura todo.\n\nInformación del sistema:\nOS: $OS $DIST $REV\n$HDInfo" 20 70 --yes-button "Continuar" --no-button "Salir" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $? -ne 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		printf "ERROR:\tInstalación interrumpida por el usuario.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		exit 2 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -255,7 +243,7 @@ mostrarWebServer() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		exit 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Preguntar otras opciones de configuración 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	comprobarHostname 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	establecerFQDN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	case $webServer in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		Apache) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			apacheOn=true 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -270,6 +258,18 @@ mostrarWebServer() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	esac 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+establecerFQDN() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	while [ -z $hostname ]; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		hostname=$(whiptail --title "FQDN" --inputbox "El nombre de dominio principal (FQDN) de este servidor es:\n"$(hostname)"\n\nQuieres cambiarlo por otro?" 20 70 --ok-button "Cambiar" --cancel-button "No Cambiar" 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if [ $? -eq 0 ] && [ ! -z $hostname ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			hostnamectl set-hostname $hostname 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			hostname=$(hostname) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	done 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	#printf "\nHostname: $hostname\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarApache() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install apache2 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -343,7 +343,7 @@ mostrarDatabase() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		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 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		whiptail --title "BASE DE DATOS" --yesno "Para su distribucion $OS $DIST $REV, sólo está disponible la base de datos MariaDB." 20 70 --yes-button "Continuar" --no-button "Salir" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $? -ne 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			printf "ERROR:\tInstalación interrumpida por el usuario.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			exit 2 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -355,6 +355,28 @@ mostrarDatabase() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+establecerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	control=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# Leemos la contreseña (stdin) y confirmamos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	while [ $control = false ]; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		sqlPasswd=$(whiptail --title "CONTRASEÑA SQL" --passwordbox "Introduzca la contraseña para el usuario 'root' de la base de datos:" 20 70 --ok-button "Continuar" --nocancel 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if [ $? -ne 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf "ERROR:\tInstalación interrumpida por el usuario.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			exit 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		sqlPasswd2=$(whiptail --title "CONTRASEÑA SQL" --passwordbox "Confirme la contraseña:" 20 70 --ok-button "Continuar" --nocancel 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if [ $? -ne 0 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf "ERROR:\tInstalación interrumpida por el usuario.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			exit 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		if [ $sqlPasswd = $sqlPasswd2 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			control=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	done 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# Establecemos contraseña y segurizamos la BD 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	unset control sqlPasswd2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarMySQL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install mysql-server mysql-client 2>&1) 
			 |