This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| # Función para verificar si un paquete está instalado | |
| check_and_install() { | |
| if ! command -v "$1" &> /dev/null; then | |
| echo "$1 no está instalado. Instalando..." | |
| sudo apt-get install "$1" -y | |
| else | |
| echo "$1 ya está instalado. Se salta la instalación." | |
| fi |