Explorar el Código

* Intentar instalar las dependencias que falten

Guzmán Castanedo Villalba hace 6 años
padre
commit
ae337e491f
Se han modificado 1 ficheros con 106 adiciones y 12 borrados
  1. 106 12
      install

+ 106 - 12
install

@@ -163,13 +163,28 @@ comprobarError() {
 			error="$type $codeNum:\t'firewall-cmd' no instalado.\n"
 			;;
 		808)
-			error="$type $codeNum:\t'tput' no instalado.\n"
+			error="$type $codeNum:\t'tput' no instalado.\nDetalles:\n$extraInfo\n"
 			;;
 		809)
-			error="$type $codeNum:\t'sed' no instalado.\n"
+			error="$type $codeNum:\t'sed' no instalado.\nDetalles:\n$extraInfo\n"
 			;;
 		810)
-			error="$type $codeNum:\t'curl' no instalado.\n"
+			error="$type $codeNum:\t'curl' no instalado.\nDetalles:\n$extraInfo\n"
+			;;
+		811)
+			error="$type $codeNum:\t'tar' no instalado.\nDetalles:\n$extraInfo\n"
+			;;
+		812)
+			error="$type $codeNum:\t'gzip' no instalado.\nDetalles:\n$extraInfo\n"
+			;;
+		813)
+			error="$type $codeNum:\t'bzip2' no instalado.\nDetalles:\n$extraInfo\n"
+			;;
+		814)
+			error="$type $codeNum:\t'xz' no instalado.\nDetalles:\n$extraInfo\n"
+			;;
+		815)
+			error="$type $codeNum:\t'openssl' no instalado.\nDetalles:\n$extraInfo\n"
 			;;
 		900)
 			error="$type $codeNum:\tError interno (habilitar servicio).\n"
@@ -301,15 +316,6 @@ comprobarDependencias() {
 	# Comprobamos hostnamectl
 	which hostnamectl > /dev/null 2>&1
 	comprobarError $? 802
-	# Comprobamos tput
-	which tput > /dev/null 2>&1
-	comprobarError $? 808
-	# Comprobamos sed
-	which sed > /dev/null 2>&1
-	comprobarError $? 809
-	# Comprobamos curl
-	which curl > /dev/null 2>&1
-	comprobarError $? 810
 	if [ $debianOS = true ];then
 		# Comprobamos apt-get
 		which apt-get > /dev/null 2>&1
@@ -322,6 +328,50 @@ comprobarDependencias() {
 		# Comprobamos Firewall (ufw)
 		which ufw > /dev/null 2>&1
 		comprobarError $? 806
+		# Comprobamos tput
+		which tput > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y ncurses-bin 2>&1)
+			comprobarError $? 808 $result
+		fi
+		# Comprobar sed
+		which sed > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y sed 2>&1)
+			comprobarError $? 809 $result
+		fi
+		# Comprobar curl
+		which curl > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y curl 2>&1)
+			comprobarError $? 810 $result
+		fi
+		# Comprobamos tar, gzip, bzip2 y xz
+		which tar > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y install tar 2>&1)
+			comprobarError $? 811 $result
+		fi
+		which gzip > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y install gzip 2>&1)
+			comprobarError $? 812 $result
+		fi
+		which bzip2 > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y install bzip2 2>&1)
+			comprobarError $? 813 $result
+		fi
+		which xz > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y install xz-utils 2>&1)
+			comprobarError $? 814 $result
+		fi
+		which openssl > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(apt-get -q -y install openssl 2>&1)
+			comprobarError $? 815 $result
+		fi
 	fi
 	if [ $rhelOS = true ]; then
 		# Comprobamos yum
@@ -335,6 +385,50 @@ comprobarDependencias() {
 		# Comprobamos Firewall (firewall-cmd)
 		which firewall-cmd > /dev/null 2>&1
 		comprobarError $? 807
+		# Comprobamos tput
+		which tput > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y ncurses 2>&1)
+			comprobarError $? 808 $result
+		fi
+		# Comprobar sed
+		which sed > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y sed 2>&1)
+			comprobarError $? 809 $result
+		fi
+		# Comprobar curl
+		which curl > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y curl 2>&1)
+			comprobarError $? 810 $result
+		fi
+		# Comprobamos tar, gzip, bzip2 y xz
+		which tar > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y install tar 2>&1)
+			comprobarError $? 811 $result
+		fi
+		which gzip > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y install gzip 2>&1)
+			comprobarError $? 812 $result
+		fi
+		which bzip2 > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y install bzip2 2>&1)
+			comprobarError $? 813 $result
+		fi
+		which xz > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y install xz 2>&1)
+			comprobarError $? 814 $result
+		fi
+		which openssl > /dev/null 2>&1
+		if [ $? -ne 0 ];then
+			result=$(yum -y install openssl 2>&1)
+			comprobarError $? 815 $result
+		fi
 	fi
 }