| 
					
				 | 
			
			
				@@ -94,19 +94,19 @@ comprobarError() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			error="$type $codeNum:\tImposible recargar base de datos.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		300) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			error="$type $codeNum:\tError interno (instalación PHP).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			error="\n$type $codeNum:\tError interno (instalación PHP).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		301) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			error="$type $codeNum:\tError interno (Web Server no seleccionado).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			error="\n$type $codeNum:\tError interno (Web Server no seleccionado).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		302) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			error="$type $codeNum:\tError al instalar PHP.\nDetalles:\n$extraInfo\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			error="\n$type $codeNum:\tError al instalar PHP.\nDetalles:\n$extraInfo\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		303) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			error="$type $codeNum:\tError al instalar Repositorio Remi.\nDetalles:\n$extraInfo\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			error="\n$type $codeNum:\tError al instalar Repositorio Remi.\nDetalles:\n$extraInfo\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		304) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			error="$type $codeNum:\tSistema Operativo no compatible con PHP-7.2 ($OS $DIST $REV).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			error="\n$type $codeNum:\tSistema Operativo no compatible con PHP-7.2 ($OS $DIST $REV).\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		800) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			error="$type $codeNum:\tEs necesario ser root ('sudo $0').\n" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -151,7 +151,7 @@ comprobarError() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	esac 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $exitNum -ne 0 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "$error" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "$error" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $type = "ERROR" ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			exit $codeNum 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -160,7 +160,7 @@ comprobarError() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 OSInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#printf "Detectando SO..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Detectando SO..." >> $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	OS=$(uname -s) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $OS = "Linux" ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		OS="GNU/Linux" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -214,8 +214,9 @@ OSInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		ID_LIKE="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		VERSION="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#printf " $OS $DIST $REV\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " $OS $DIST $REV\n" >> $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	HDInfo=$(df -h | head -1)"\n"$(df -h | grep ^/dev/sd)"\n"$(df -h | grep ^/dev/mapper) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "$HDInfo\n" >> $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 comprobarRoot() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -237,10 +238,10 @@ comprobarDependencias() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		which apt-get > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 803 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Actualizamos base de datos del repositorio 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Actualizando repositorio APT..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Actualizando repositorio APT..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y update) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 805 $result 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Comprobamos Firewall (ufw) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		which ufw > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 806 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -273,6 +274,7 @@ inicializarVariables() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	actualizacionesOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	progreso=0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	progresoTotal=0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	logFile="./."$(basename $0)".log" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalacionExpress() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -320,32 +322,43 @@ mostrarExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarAvanzada() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	componentes=$(whiptail --title "INSTALACION AVANZADA" --checklist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nEscoge los componentes que quieres instalar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 6 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"LAMP" "Linux + Apache + MySQL/MariaDB + PHP" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"LEMP" "Linux + Nginx + MySQL/MariaDB + PHP" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"SSL/TLS" "Instalar certificados para activar HTTPS" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"MediaWiki" "Instalar wiki con MediaWiki" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"Moodle" "Instalar campus virtual con Moodle" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"Actualizaciones" "Programar actualizaciones automáticas" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	webServer=$(whiptail --title "INSTALACION AVANZADA" --radiolist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nEscoge el tipo de Servidor Web que quieres instalar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"LAMP" "GNU/Linux + Apache + MySQL/MariaDB + PHP-7" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"LEMP" "GNU/Linux + Nginx + MySQL/MariaDB + PHP-7" OFF \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	comprobarError $? 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Mejora: autodetección de componentes ya instalados 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	for i in $componentes; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	for i in $webServer; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		case $i in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			\"LAMP\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				apacheOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				establecerFQDN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				mostrarDatabase 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				phpOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				progresoTotal=$((progresoTotal + 6)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			\"LEMP\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				nginxOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				establecerFQDN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				mostrarDatabase 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				phpOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				progresoTotal=$((progresoTotal + 6)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				comprobarError 1 100 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		esac 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	done 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# Opciones comunes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	establecerFQDN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	mostrarDatabase 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	phpOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	progresoTotal=$((progresoTotal + 6)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	mostrarComponentes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+mostrarComponentes() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	componentes=$(whiptail --title "INSTALACION AVANZADA" --checklist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nEscoge los componentes que quieres instalar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 4 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"SSL/TLS" "Instalar certificados para activar HTTPS" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"MediaWiki" "Instalar wiki con MediaWiki" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"Moodle" "Instalar campus virtual con Moodle" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"Actualizaciones" "Programar actualizaciones automáticas" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	comprobarError $? 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	# Mejora: autodetección de componentes ya instalados 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	for i in $componentes; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		case $i in 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			\"SSL/TLS\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				# 2 Opciones: Let's Encrypt o Autofirmado 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				progresoTotal=$((progresoTotal + 2)) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -379,7 +392,7 @@ establecerFQDN() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			hostname=$(hostname) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	done 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#printf "\nHostname: $hostname\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Hostname: $hostname\n" >> $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarApache() { 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -464,25 +477,25 @@ leerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 establecerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Establecemos SQL root passwd y securizamos BD (mysql_secure_installation) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Mejora: ¿Si ya tiene una contraseña asignada? 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	mysql -e "FLUSH PRIVILEGES" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	mysql -e "FLUSH PRIVILEGES" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $? -eq 0 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Establecemos contraseña del usuario root 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "UPDATE mysql.user SET Password = PASSWORD('$sqlPasswd') WHERE User = 'root'" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "UPDATE mysql.user SET Password = PASSWORD('$sqlPasswd') WHERE User = 'root'" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 207 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Desactivamos acceso root desde el exterior (solo localhost) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "DELETE FROM mysql.user WHERE User='root' AND Host NOT IN ('localhost', '127.0.0.1', '::1')" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 208 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Eliminamos todos los usuarios anónimos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "DELETE FROM mysql.user WHERE User=''" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "DELETE FROM mysql.user WHERE User=''" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 209 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Eliminamos bases de datos 'test' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "DROP DATABASE IF EXISTS test" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "DROP DATABASE IF EXISTS test" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 210 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Eliminamos privilegios de la base de datos 'test' 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "DELETE FROM mysql.db WHERE Db='test' OR Db='test\\_%'" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 211 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Aplicamos los cambios 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		mysql -e "FLUSH PRIVILEGES" > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		mysql -e "FLUSH PRIVILEGES" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 212 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 206 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -559,13 +572,13 @@ instalarPHP() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 habilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Arrancamos y habilitamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Intentamos con systemctl (SystemD) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf "Habilitando servicio $1" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Habilitando servicio $1" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $# -le 0 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError 1 900 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	which systemctl > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $? -eq 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " (SystemD)..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " (SystemD)..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		systemctl start $1 > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError $? 901 $1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		systemctl enable $1 > /dev/null 2>&1 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -574,12 +587,12 @@ habilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Intentamos con service (Upstart) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		which service > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $? -eq 0 ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf " (Upstart)..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf " (Upstart)..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			service $1 start > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			comprobarError $? 901 $1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		else 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			# Intentamos con init.d (SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf " (SystemV)..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf " (SystemV)..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			/etc/init.d/$1 start > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			comprobarError $? 901 $1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -601,12 +614,12 @@ habilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Mejora: comprobar si el servicio está funcionando 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # Comprobación del sistema e inicialización 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-comprobarRoot 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 inicializarVariables 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+comprobarRoot 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 OSInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 comprobarDependencias 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -622,49 +635,49 @@ mostrarExpress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# FALTA: whiptail --gauge -> Más bonito 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Servidor Web 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $apacheOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando Web Server Apache..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando Web Server Apache..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			instalarApache 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando Web Server Apache..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	elif [ $nginxOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando Web Server Nginx..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando Web Server Nginx..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			instalarNginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando Web Server Nginx..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Base de Datos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $mySQLOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando Base de Datos MySQL..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando Base de Datos MySQL..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			instalarMySQL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	elif [ $mariaDBOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando Base de Datos MariaDB..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando Base de Datos MariaDB..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			instalarMariaDB 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando Base de Datos MariaDB..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# PHP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $phpOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando PHP-7..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando PHP-7..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			instalarPHP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando PHP-7..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# SSL/TLS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Falta por implementar 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -675,23 +688,23 @@ mostrarExpress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando SSL/TLS..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $mediaWikiOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando MediaWiki..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando MediaWiki..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando MediaWiki..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $moodleOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Instalando Moodle..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Instalando Moodle..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Instalando Moodle..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # PRECAUCION!!!! Hay que habilitar algunos servicios antes de configurarlos 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -700,69 +713,69 @@ mostrarExpress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 # Configuración 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración Apache 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Virtual Hosts 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Configurando Servidor Web..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Configurando Servidor Web..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Configurando Servidor Web..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración Database 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Arrancar Base de Datos, establecer contraseña y configuración segura 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $mySQLOn = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf "Configurando Base de Datos MySQL..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			habilitarServicio mysql 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf "Configurando Base de Datos MySQL..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #				printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				habilitarServicio mysql 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				establecerSQLPasswd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			} > >(whiptail --gauge "Configurando Base de Datos MySQL..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $mariaDBOn = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf "Configurando Base de Datos MAriaDB..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			habilitarServicio mariadb 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf "Configurando Base de Datos MariaDB..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #				printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				habilitarServicio mariadb 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				establecerSQLPasswd 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			} > >(whiptail --gauge "Configurando Base de Datos MariaDB..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración PHP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# cgi.fix_pathinfo=0 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Configurar máximo de subida de archivos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Configurando PHP-7..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Configurando PHP-7..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Configurando PHP-7..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración MediWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf "Configurando MediaWiki..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Configurando MediaWiki..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	} > >(whiptail --gauge "Configurando MediaWiki..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf "Configurando Moodle..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Configurando Moodle..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	} > >(whiptail --gauge "Configurando Moodle..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Arrancar y habilitar todos los servicios (SystemD, Service o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf "Arrancando Servicios..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf "Arrancando Servicios..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	} > >(whiptail --gauge "Arrancando Servicios..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Añadir reglas del cortafuegos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	printf "Configurando Cortafuegos..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	{ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -770,25 +783,25 @@ mostrarExpress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #	} > >(whiptail --gauge "Configurando Cortafuegos..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configuración SSL/TLS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Generar certificados 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Configurar certificados 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Configurando SSL/TLS..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Configurando SSL/TLS..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Configurando SSL/TLS..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configurar actualizaciones 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $actualizacionesOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf "Configurando actualizaciones automáticas..." 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf "Configurando actualizaciones automáticas..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		{ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #			printf "%s\n" $((100 * progreso / progresoTotal)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			progreso=$((progreso + 1)) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 #		} > >(whiptail --gauge "Configurando actualizaciones automáticas..." $((ALTO * 4 / 10)) $((ANCHO * 9 / 10)) $((100 * progreso / progresoTotal))) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		printf " OK.\n" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		printf " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 |