diff --git a/bin/bootstrap.sh b/bin/bootstrap.sh index 559c88f..c9ff08d 100755 --- a/bin/bootstrap.sh +++ b/bin/bootstrap.sh @@ -55,6 +55,7 @@ install() { local WGET_PACKAGE=wget local DIALOG_PACKAGE=dialog local SOPS_PACKAGE=sops + local GNUPG_PACKAGE=gnupg # Load base bash library source $BIN_PATH/$LIBRARY/base.lib @@ -86,6 +87,13 @@ install() { os_pkgs_install $GIT_PACKAGE fi + # Install gnupg from OS Packages + command_installed $GNUPG_PACKAGE + if [ $? -ne 0 ] + then + os_pkgs_install $GNUGP_PACKAGE + fi + # Install dialog from OS Packages command_installed $DIALOG_PACKAGE if [ $? -ne 0 ] diff --git a/bin/lib/bootstrap.lib b/bin/lib/bootstrap.lib index 6332b2a..04317dd 100755 --- a/bin/lib/bootstrap.lib +++ b/bin/lib/bootstrap.lib @@ -19,6 +19,42 @@ SOPS_VERSION=3.9.2 +PRITUNL_SIGN=7568D9BB55FF9E5287D586017AE645C0CF8E292A +UBUNTU_LIST=("jammy" "noble" "oracular") + +# Install pritunl vpn package +function install_pritunl() { + + if [ "$(uname)" == "Darwin" ]; then + # En macOS, instalamos o actualizamos Python a través de Homebrew + brew install git go node + bash <(curl -s https://raw.githubusercontent.com/pritunl/pritunl-client-electron/master/tools/install_macos.sh) + return $? + fi + + OS_INFO=$(lsb_release -a 2>/dev/null) + if [ $? -eq 0 ]; then + OS_VERSION=$(echo "$OS_INFO" | grep "Codename" | awk '{print $2}' | tr -d ' ') + else + OS_INFO=$(cat /etc/os-release 2>/dev/null) + OS_VERSION=$(echo "$OS_INFO" | grep "VERSION_CODENAME" | awk -F ': +' '{print $2}') + fi + + if echo "$OS_INFO" | grep -q "Ubuntu"; then + if printf "%s\n" "${UBUNTU_LIST[@]}" | grep -q "^${OS_VERSION}$" + then + echo "deb https://repo.pritunl.com/stable/apt $OS_VERSION main" > /etc/apt/sources.list.d/pritunl.list + gpg --keyserver hkp://keyserver.ubuntu.com --recv-keys $PRITUNL_SIGN + gpg --armor --export $PRITUNL_SIGN | tee /etc/apt/trusted.gpg.d/pritunl.asc + apt update + apt install pritunl-client-electron -y + return $? + fi + fi + + return 10 + +} # Install python3 package function python3_install() { diff --git a/bin/msg/bootstrap.es b/bin/msg/bootstrap.es index 0810567..2e2fb39 100644 --- a/bin/msg/bootstrap.es +++ b/bin/msg/bootstrap.es @@ -21,6 +21,11 @@ bomsg_006="Instalando Mozilla SOPS..." bomsg_007="Instalación de Mozilla SOPS completada..." bomsg_008_1="Carpeta" bomsg_008_2="no es del ambiente de desarrollo!" +bomsg_010="INSTALAR VPN" +bomsg_011="Instalando cliente VPN (pritunl)" +bomsg_012="No se completo la instalación del cliente VPN (pritunl)" +bomsg_013="Cliente VPN (pritunl) instalado satisfactoriamente!" +bomsg_014="Sistema Operativo no soportado por pritunl" pymsg_001="Instalando python3" pymsg_002="Instalando dialog" diff --git a/bin/set_port53.sh b/bin/vpn_install.sh similarity index 86% rename from bin/set_port53.sh rename to bin/vpn_install.sh index 692ca8d..c8b89b6 100755 --- a/bin/set_port53.sh +++ b/bin/vpn_install.sh @@ -1,6 +1,6 @@ #!/bin/bash # -# set_port53.sh +# vpn_install.sh # Modified: 2024/12/01 15:27:00 # Derechos de Autor (C) [2024] [Mauro Rosero P. ] # @@ -58,22 +58,26 @@ install() { # Load bootstrap messages load_bootstrap_msg $BIN_PATH $MESSAGES $INSTALL_LANG - # Set port 53 (dns) tu unprivileged - unprivileged_port53 - if [ $? -ne 0 ] - then - echo "$bomsg_003" - else - echo "$bomsg_004" - fi - + # Install pritunl vpn client (gui) + install_pritunl + case $? in + 0) + echo "$bomsg_013" + ;; + 10) + echo "$bomsg_014" + ;; + *) + echo "$bomsg_012" + ;; + esac } # Load messages load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG # Display Headers -display_devstools_header "- $bomsg_002" +display_devstools_header "- $bomsg_010" # Run install with sudo sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"