[IMPROVED] vpn_install.sh - Se agrega la funcionalidad para instalar cliente vpn pritunl
This commit is contained in:
parent
d6b4014e1c
commit
7062e1b2fb
4 changed files with 64 additions and 11 deletions
|
@ -55,6 +55,7 @@ install() {
|
||||||
local WGET_PACKAGE=wget
|
local WGET_PACKAGE=wget
|
||||||
local DIALOG_PACKAGE=dialog
|
local DIALOG_PACKAGE=dialog
|
||||||
local SOPS_PACKAGE=sops
|
local SOPS_PACKAGE=sops
|
||||||
|
local GNUPG_PACKAGE=gnupg
|
||||||
|
|
||||||
# Load base bash library
|
# Load base bash library
|
||||||
source $BIN_PATH/$LIBRARY/base.lib
|
source $BIN_PATH/$LIBRARY/base.lib
|
||||||
|
@ -86,6 +87,13 @@ install() {
|
||||||
os_pkgs_install $GIT_PACKAGE
|
os_pkgs_install $GIT_PACKAGE
|
||||||
fi
|
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
|
# Install dialog from OS Packages
|
||||||
command_installed $DIALOG_PACKAGE
|
command_installed $DIALOG_PACKAGE
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
|
|
|
@ -19,6 +19,42 @@
|
||||||
|
|
||||||
|
|
||||||
SOPS_VERSION=3.9.2
|
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
|
# Install python3 package
|
||||||
function python3_install() {
|
function python3_install() {
|
||||||
|
|
|
@ -21,6 +21,11 @@ bomsg_006="Instalando Mozilla SOPS..."
|
||||||
bomsg_007="Instalación de Mozilla SOPS completada..."
|
bomsg_007="Instalación de Mozilla SOPS completada..."
|
||||||
bomsg_008_1="Carpeta"
|
bomsg_008_1="Carpeta"
|
||||||
bomsg_008_2="no es del ambiente de desarrollo!"
|
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_001="Instalando python3"
|
||||||
pymsg_002="Instalando dialog"
|
pymsg_002="Instalando dialog"
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# set_port53.sh
|
# vpn_install.sh
|
||||||
# Modified: 2024/12/01 15:27:00
|
# Modified: 2024/12/01 15:27:00
|
||||||
# Derechos de Autor (C) [2024] [Mauro Rosero P. <mauro@roser.one>]
|
# Derechos de Autor (C) [2024] [Mauro Rosero P. <mauro@roser.one>]
|
||||||
#
|
#
|
||||||
|
@ -58,22 +58,26 @@ install() {
|
||||||
# Load bootstrap messages
|
# Load bootstrap messages
|
||||||
load_bootstrap_msg $BIN_PATH $MESSAGES $INSTALL_LANG
|
load_bootstrap_msg $BIN_PATH $MESSAGES $INSTALL_LANG
|
||||||
|
|
||||||
# Set port 53 (dns) tu unprivileged
|
# Install pritunl vpn client (gui)
|
||||||
unprivileged_port53
|
install_pritunl
|
||||||
if [ $? -ne 0 ]
|
case $? in
|
||||||
then
|
0)
|
||||||
echo "$bomsg_003"
|
echo "$bomsg_013"
|
||||||
else
|
;;
|
||||||
echo "$bomsg_004"
|
10)
|
||||||
fi
|
echo "$bomsg_014"
|
||||||
|
;;
|
||||||
|
*)
|
||||||
|
echo "$bomsg_012"
|
||||||
|
;;
|
||||||
|
esac
|
||||||
}
|
}
|
||||||
|
|
||||||
# Load messages
|
# Load messages
|
||||||
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
|
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
|
||||||
|
|
||||||
# Display Headers
|
# Display Headers
|
||||||
display_devstools_header "- $bomsg_002"
|
display_devstools_header "- $bomsg_010"
|
||||||
|
|
||||||
# Run install with sudo
|
# Run install with sudo
|
||||||
sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"
|
sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"
|
Loading…
Reference in a new issue