| 
					
				 | 
			
			
				@@ -9,16 +9,18 @@ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 ################################################################# 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 comprobarError() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# comprobarError exitNum codeNum extraInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	1xx: Servidor Web 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	2xx: Base de Datos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	3xx: PHP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	4xx: SSL/TLS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	5xx: MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	6xx: Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	7xx: Actualizaciones automáticas 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	8xx: Dependencias 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	#	9xx: Servicios & Firewall 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Permite comprobar si se ha producido un error y de serlo devuelve un código de error 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# comprobarError exitNum codeNum extraInfo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	1xx: Servidor Web 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	2xx: Base de Datos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	3xx: PHP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	4xx: SSL/TLS 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	5xx: MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	6xx: Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	7xx: Backup automático 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	8xx: Dependencias 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+#	9xx: Servicios & Firewall 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	type="ERROR" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	exitNum=$1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	shift 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -276,6 +278,7 @@ comprobarError() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 OSInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Detecta el OS en el que se está ejecutando el programa, así como su versión 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	echo -en "Detectando SO..." >> $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	OS=$(uname -s) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $OS = "Linux" ]; then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -336,10 +339,13 @@ OSInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 comprobarRoot() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Comprueba si se está ejecutando con privilegios de root 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	comprobarError $(id -u) 800 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 comprobarDependencias() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Comprueba si están instalados todos los programas necesarios. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# En la mayoría de los casos, trata de instalarlos. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Comprobamos whiptail 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	which whiptail > /dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	comprobarError $? 801 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -465,6 +471,7 @@ comprobarDependencias() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 inicializarVariables() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Inicializa las variables que necesitan de un estado previo 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	debianOS=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	rhelOS=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	apacheOn=false 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -477,7 +484,7 @@ inicializarVariables() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	mediaWikiOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	moodleOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	infoPHPOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	actualizacionesOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	backupOn=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	hostname="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	logFile="./."$(basename $0)".log" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	maxUpload="100M" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -496,6 +503,7 @@ inicializarVariables() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalacionExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Permite una instalación rápida, haciendo el menor número de preguntas 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	apacheOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	mariaDBOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	phpOn=true 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -503,7 +511,7 @@ instalacionExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	letsEncryptOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	mediaWikiOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	moodleOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	actualizacionesOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	backupOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Preguntas mínimas 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	establecerFQDN 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	leerSQLPasswd 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -512,6 +520,7 @@ instalacionExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarBienvenida() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla de bienvenida y muestra SO y estado de los discos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	ANCHO=$(tput cols) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	ALTO=$(tput lines) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = false ] && [ $rhelOS = false ]; then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -523,7 +532,8 @@ mostrarBienvenida() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	express=$(whiptail --title "INSTALACION EXPRESS" --radiolist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nLa instalación express instala Apache2, MariaDB, PHP-7, Let's Encrypt, MediaWiki, Moodle y actualizaciones automáticas.\nSeleccione el tipo de instalación que desee:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla de elección entre instalación express o avanzada 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	express=$(whiptail --title "INSTALACION EXPRESS" --radiolist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nLa instalación express instala Apache2, MariaDB, PHP-7, Let's Encrypt, MediaWiki, Moodle y backups automático.\nSeleccione el tipo de instalación que desee:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"Express" "Instalación rápida" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"Avanzada" "Permite escoger todas las opciones disponibles" OFF \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -544,6 +554,7 @@ mostrarExpress() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarAvanzada() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que permite instalar un servidor LAMP o LEMP 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	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 \ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -568,16 +579,18 @@ mostrarAvanzada() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	phpOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	establecerMaxUpload 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	mostrarComponentes 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	mostrarConfirmacion 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	unset webServer 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarComponentes() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla de elección de componentes (SSL/TLS, MediaWiki, Moodle, InfoPHP y Backup) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	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)) 5 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"SSL/TLS" "Instalar certificados para activar HTTPS" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"MediaWiki" "Instalar wiki con MediaWiki" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"Moodle" "Instalar campus virtual con Moodle" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"InfoPHP" "Instalar info.php (sólo para pruebas)" OFF \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	"Actualizaciones" "Programar actualizaciones automáticas" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	"Backup" "Programar backups automáticos" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	--ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	comprobarError $? 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Mejora: autodetección de componentes ya instalados 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -598,8 +611,8 @@ mostrarComponentes() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			\"InfoPHP\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				infoPHPOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-			\"Actualizaciones\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-				actualizacionesOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+			\"Backup\") 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+				BackupOn=true 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				;; 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			*) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 				comprobarError 1 3 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -610,6 +623,7 @@ mostrarComponentes() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarSSL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que permite seleccionar el tipo de certificados 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	ssl=$(whiptail --title "INSTALACION SSL/TLS" --radiolist "<ESPACIO>: seleccionar   <TAB>: cambiar   <FLECHAS>: moverse\n\nEscoge el tipo de Certificado SSL/TLS que quieres instalar:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"LetsEncrypt" "Compatible con todos los navegadores" ON \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	"Auto-Firmado" "Certificados auto-firmados (sólo para pruebas)" OFF \ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -633,6 +647,7 @@ mostrarSSL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarMediaWiki(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que pregunta sobre las opciones necesarias para configurar MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Introducir nombre wiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	while [ -z "$nombreMediaWiki" ]; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		nombreMediaWiki=$(whiptail --title "CONFIGURACION MEDIAWIKI" --inputbox "Introduzca el nombre de la Wiki:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -677,6 +692,7 @@ mostrarMediaWiki(){ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que pregunta sobre las opciones necesarias para configurar Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Introducir Nombre Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	while [ -z "$nombreMoodle" ]; do 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		nombreMoodle=$(whiptail --title "CONFIGURACION MOODLE" --inputbox "Introduzca el NOMBRE COMPLETO del campus virtual.\nPor ejemplo: 'Campus Virtual Ejemplo'." $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --ok-button "Continuar" --cancel-button "Salir" 3>&1 1>&2 2>&3) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -725,7 +741,14 @@ mostrarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	unset control error passwdMoodle2 dominio cont serverName aliasMoodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+mostrarConfirmacion() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que presenta una confirmación antes de realizar la instalación 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	whiptail --title "INSTALACION" --yesno "ESTA TODO LISTO PARA LA INSTALACION.\n¿DESEA CONTINUAR?" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --yes-button "Instalar" --no-button "Salir" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	comprobarError $? 1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 establecerFQDN() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configura el FQDN (dominio principal del servidor) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	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?" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) --ok-button "Cambiar" --cancel-button "No Cambiar" 3>&1 1>&2 2>&3) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $? -eq 0 ] && [ ! -z "$hostname" ]; then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -738,6 +761,7 @@ establecerFQDN() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarApache() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instala Apache2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		webServerName="apache2" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install apache2 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -753,6 +777,7 @@ instalarApache() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarApache() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configura Apache2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		apacheConfFile="./etc/apache2/apache2.conf" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ ! -f $apacheConfFile ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -801,6 +826,7 @@ configurarApache() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarNginx() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instala Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	webServerName="nginx" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install nginx 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -818,8 +844,8 @@ instalarNginx() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarNginx() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configuramos Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	rm -Rf /etc/$webServerName/* 2>/dev/null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configura Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	rm -Rf /etc/$webServerName/!(sites-available|sites-enabled) 2>/dev/null 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	comprobarError $? 107 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	nginxConfFile="./etc/$webServerName" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ -d "$nginxConfFile" ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -850,8 +876,8 @@ configurarNginx() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarVirtualHost() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configuramos un Virtual Host para Apache o Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Uso: instalarVirtualHost $root $virtualHost $dominio $alias 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configuramos un Virtual Host para Apache o Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Uso: instalarVirtualHost $root $virtualHost $dominio $alias 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $# -ge 3 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		rootVirtualHost=$(realpath $1) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		shift 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -904,6 +930,7 @@ instalarVirtualHost() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 mostrarDatabase() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla que permite escoger entre instalar MariaDB o MySQL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	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:" $((ALTO * 9 / 10)) $((ANCHO * 9 / 10)) 2 \ 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		"MariaDB" "Instalar la base de datos MariaDB (fork de MySQL)" ON \ 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -934,6 +961,7 @@ mostrarDatabase() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 leerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla para leer la contraseña para el usuario root de SQL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	control=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	error="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Leemos la contreseña (stdin) y confirmamos 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -957,7 +985,7 @@ leerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 establecerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Establecemos SQL root passwd y securizamos BD (mysql_secure_installation) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Establecemos SQL root passwd y securizamos BD (mysql_secure_installation) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Comprobamos si ya tiene una contraseña asignada 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	mysql -e "FLUSH PRIVILEGES" >> $logFile 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $? -eq 0 ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -991,6 +1019,7 @@ establecerSQLPasswd() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarMySQL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instala MySQL (sólo para Debian) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	sqlServerName="mysql" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install mysql-server mysql-client 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1007,6 +1036,7 @@ instalarMySQL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarMariaDB() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instala MariaDB 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	sqlServerName="mariadb" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(apt-get -q -y install mariadb-server mariadb-client 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1021,6 +1051,7 @@ instalarMariaDB() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarSQL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configura BarracudaFS en mysql (necesario para Moodle) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Configura MariaDB o MySQL 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $mariaDBOn = true ] && [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sqlConfFile="/etc/mysql/my.cnf" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1056,7 +1087,7 @@ configurarSQL() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarPHP() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Instalamos PHP-7 de forma diferente si es junto a Apache o con Nginx 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instalamos PHP-7 y los módulos PHP que necesitan MediaWiki y Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ $apacheOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 			result=$(apt-get -q -y install php libapache2-mod-php php-mysql php-intl php-mbstring php-xml php-apcu php-gd php-curl php-zip php-soap php-xmlrpc 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1112,7 +1143,7 @@ instalarPHP() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarPHP() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configura PHP para segurizarlo y establecer máximo de subida. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configura PHP para segurizarlo y establecer máximo de subida. 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		phpConfFile="./etc/php/php.ini.debian" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		phpDest="/etc/php/7.2/cli/php.ini" 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1153,6 +1184,7 @@ configurarPHP() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 establecerMaxUpload() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Pantalla para establecer el máximo de subida al servidor (vía PHP) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	control=false 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	error="" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	while [ $control = false ];do 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1169,7 +1201,7 @@ establecerMaxUpload() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 instalarPHPInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Instalar fichero php 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Instalar fichero info.php y su VirtualHost 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -f /etc/$webServerName/sites-enabled/phpinfo.conf ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		infoFile="./var/www/info.php" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		if [ ! -f $infoFile ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1203,7 +1235,7 @@ instalarPHPInfo() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 habilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Arrancamos y habilitamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Arrancamos y habilitamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Intentamos con systemctl (SystemD) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	#echo -en "Habilitando Servicio '$1'" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $# -le 0 ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1251,7 +1283,7 @@ habilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 deshabilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Paramos y deshabilitamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Paramos y deshabilitamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Intentamos con systemctl (SystemD) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	#echo -en "Deshabilitando Servicio '$1'" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $# -le 0 ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1299,7 +1331,7 @@ deshabilitarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 recargarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Recargamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Recargamos el servicio (con SystemD, Upstart o SystemV) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Intentamos con systemctl (SystemD) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	#echo -en "Recargando Servicio '$1'" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $# -le 0 ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1329,7 +1361,7 @@ recargarServicio() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarCortafuegos() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configuramos cortafuegos (añadir reglas y encender) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configuramos cortafuegos (añadir reglas y encender) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	# Comprobamos si estamos usando SSH 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	esSSH $PPID 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $debianOS = true ];then 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1365,6 +1397,7 @@ configurarCortafuegos() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 esSSH() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Comprobamos si nuestro terminal usa SSH 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	p=${1:-$PPID} 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	#read pid name x ppid y < <( cat /proc/$p/stat ) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	read pid name ppid < <( ps -o pid= -o comm= -o ppid= -p $p) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1374,7 +1407,7 @@ esSSH() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 descargarMediaWiki() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Descargar la versión 1.31.0 de MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Descargar la versión 1.31.0 de MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -d ./var ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError 1 5 "./var" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1383,7 +1416,7 @@ descargarMediaWiki() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarMediaWiki() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configuramos MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configuramos MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -f /var/www/$dominioMediaWiki/LocalSettings.php ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Copiamos archivos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		cp -fR ./var/mediawiki-1.31.0/ /var/www/$dominioMediaWiki 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1431,7 +1464,7 @@ configurarMediaWiki() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 descargarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Descargar la versión 1.31.0 de MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Descargar la versión 1.31.0 de MediaWiki 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -d ./var ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		comprobarError 1 5 "./var" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1443,7 +1476,7 @@ descargarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configurar Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configurar Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -f /var/www/$dominioMoodle/config.php ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		# Copiamos archivos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		cp -Rf ./var/moodle/ /var/www/$dominioMoodle 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1510,7 +1543,7 @@ configurarMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 crearDBMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Creamos una base de datos para Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Crear base de datos para Moodle 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	dbDir="./etc/db" 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ ! -d $dbDir ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		mkdir $dbDir 2>/dev/null 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1528,7 +1561,7 @@ crearDBMoodle() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 } 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				  
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 configurarSELinux() { 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	# Configura SELinux (Sólo para RHEL) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configurar SELinux (Sólo para RHEL) 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	which semanage >/dev/null 2>&1 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	if [ $? -ne 0 ];then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		result=$(yum -y install policycoreutils-python 2>&1) 
			 | 
		
	
	
		
			
				| 
					
				 | 
			
			
				@@ -1665,9 +1698,9 @@ mostrarExpress 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	echo -en "Configurando Cortafuegos..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	configurarCortafuegos 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	echo -en " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-# Configurar actualizaciones 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-	if [ $actualizacionesOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				-		echo -en "Configurando Actualizaciones Automáticas..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+# Configurar Backup 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+	if [ $backupOn = true ]; then 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				+		echo -en "Configurando Backup Automático..." | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		sleep 2 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 		echo -en " OK.\n" | tee -a $logFile 
			 | 
		
	
		
			
				 | 
				 | 
			
			
				 	fi 
			 |