Compare commits
No commits in common. "7bb290ef20147a6cd6a57554b0f38020ddb627e1" and "28c95aab40158fd6ae1d389ec296c80974f4a262" have entirely different histories.
7bb290ef20
...
28c95aab40
3 changed files with 12 additions and 119 deletions
|
@ -39,8 +39,6 @@ bin/update.sh
|
||||||
| Comando | Descripción |
|
| Comando | Descripción |
|
||||||
|---------|-------------|
|
|---------|-------------|
|
||||||
| `bin/bootstrap.sh` | Instala herramientas básicas y configura la gestión de contenedores |
|
| `bin/bootstrap.sh` | Instala herramientas básicas y configura la gestión de contenedores |
|
||||||
| `bin/bootstrap.sh --oathtool` | Instala únicamente oathtool (herramienta para TOTP/HOTP) |
|
|
||||||
| `bin/bootstrap.sh --zbar` | Instala únicamente zbar (herramienta para lectura de códigos QR) |
|
|
||||||
| `bin/update.sh` | Actualiza el entorno de desarrollo con las últimas funcionalidades |
|
| `bin/update.sh` | Actualiza el entorno de desarrollo con las últimas funcionalidades |
|
||||||
| `bin/npm_install.sh` | Instala NodeJS y npm de forma interactiva |
|
| `bin/npm_install.sh` | Instala NodeJS y npm de forma interactiva |
|
||||||
| `bin/project_new.sh` | Crea un nuevo proyecto con estructura estandarizada según el tipo seleccionado |
|
| `bin/project_new.sh` | Crea un nuevo proyecto con estructura estandarizada según el tipo seleccionado |
|
||||||
|
|
|
@ -1,8 +1,8 @@
|
||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
#
|
#
|
||||||
# bootstrap.sh
|
# bootstrap.sh
|
||||||
# Modified: 2025/03/15 16:30:00
|
# Modified: 2024/12/01 15:27:00
|
||||||
# Derechos de Autor (C) [2025] [Mauro Rosero P. <mauro@roser.one>]
|
# Derechos de Autor (C) [2024] [Mauro Rosero P. <mauro@roser.one>]
|
||||||
#
|
#
|
||||||
# Este programa es software libre: usted puede redistribuirlo y/o modificarlo
|
# Este programa es software libre: usted puede redistribuirlo y/o modificarlo
|
||||||
# bajo los términos de la Licencia Pública Affero General de GNU tal como
|
# bajo los términos de la Licencia Pública Affero General de GNU tal como
|
||||||
|
@ -48,7 +48,6 @@ install() {
|
||||||
local LIBRARY=$2
|
local LIBRARY=$2
|
||||||
local MESSAGES=$3
|
local MESSAGES=$3
|
||||||
local INSTALL_LANG=$4
|
local INSTALL_LANG=$4
|
||||||
local PACKAGE_ONLY=$5 # Paquete específico a instalar (opcional)
|
|
||||||
|
|
||||||
local PYTHON_PACKAGE=python3
|
local PYTHON_PACKAGE=python3
|
||||||
local GIT_PACKAGE=git
|
local GIT_PACKAGE=git
|
||||||
|
@ -62,8 +61,6 @@ install() {
|
||||||
local SQLITE_PACKAGE="$SQLITE_COMMAND libsqlite3-dev"
|
local SQLITE_PACKAGE="$SQLITE_COMMAND libsqlite3-dev"
|
||||||
local ANSIBLE_COMMAND=ansible
|
local ANSIBLE_COMMAND=ansible
|
||||||
local ANSIBLE_PACKAGE="$ANSIBLE_COMMAND"
|
local ANSIBLE_PACKAGE="$ANSIBLE_COMMAND"
|
||||||
local OATHTOOL_PACKAGE=oathtool
|
|
||||||
local ZBAR_PACKAGE=zbar
|
|
||||||
|
|
||||||
# Load base bash library
|
# Load base bash library
|
||||||
BIN_HOME=$BIN_PATH
|
BIN_HOME=$BIN_PATH
|
||||||
|
@ -75,32 +72,6 @@ install() {
|
||||||
# Load bootstrap messages
|
# Load bootstrap messages
|
||||||
load_bootstrap_msg $BIN_PATH $MESSAGES $INSTALL_LANG
|
load_bootstrap_msg $BIN_PATH $MESSAGES $INSTALL_LANG
|
||||||
|
|
||||||
# Si se especificó un paquete específico, instalar solo ese
|
|
||||||
if [ -n "$PACKAGE_ONLY" ]; then
|
|
||||||
case "$PACKAGE_ONLY" in
|
|
||||||
"oathtool")
|
|
||||||
# Instalar oathtool
|
|
||||||
command_installed $OATHTOOL_PACKAGE
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
oathtool_install
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
"zbar")
|
|
||||||
# Instalar zbar
|
|
||||||
command_installed $ZBAR_PACKAGE
|
|
||||||
if [ $? -ne 0 ]; then
|
|
||||||
zbar_install
|
|
||||||
fi
|
|
||||||
return 0
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
echo "Paquete '$PACKAGE_ONLY' no reconocido o no soportado."
|
|
||||||
return 1
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
fi
|
|
||||||
|
|
||||||
# Install wget from OS Packages
|
# Install wget from OS Packages
|
||||||
command_installed $WGET_PACKAGE
|
command_installed $WGET_PACKAGE
|
||||||
if [ $? -ne 0 ]
|
if [ $? -ne 0 ]
|
||||||
|
@ -194,29 +165,11 @@ install() {
|
||||||
# Load messages
|
# Load messages
|
||||||
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
|
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
|
||||||
|
|
||||||
# Procesar argumentos
|
# Display Headers
|
||||||
PACKAGE_TO_INSTALL=""
|
display_devstools_header "- $bomsg_000"
|
||||||
|
|
||||||
if [ $# -ge 1 ]; then
|
|
||||||
case "$1" in
|
|
||||||
"--oathtool")
|
|
||||||
PACKAGE_TO_INSTALL="oathtool"
|
|
||||||
display_devstools_header "- Instalación de oathtool"
|
|
||||||
;;
|
|
||||||
"--zbar")
|
|
||||||
PACKAGE_TO_INSTALL="zbar"
|
|
||||||
display_devstools_header "- Instalación de zbar"
|
|
||||||
;;
|
|
||||||
*)
|
|
||||||
display_devstools_header "- $bomsg_000"
|
|
||||||
;;
|
|
||||||
esac
|
|
||||||
else
|
|
||||||
display_devstools_header "- $bomsg_000"
|
|
||||||
fi
|
|
||||||
|
|
||||||
# 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 '$PACKAGE_TO_INSTALL'"
|
sudo bash -c "$(declare -f load_bootstrap_msg; declare -f install); install $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"
|
||||||
result=$?
|
result=$?
|
||||||
|
|
||||||
# Run install ansible with regular user
|
# Run install ansible with regular user
|
||||||
|
|
|
@ -358,61 +358,3 @@ function unprivileged_port53() {
|
||||||
return $?
|
return $?
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
# Install oathtool package
|
|
||||||
function oathtool_install() {
|
|
||||||
echo "Instalando oathtool (herramienta para TOTP/HOTP)..."
|
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
|
||||||
# En macOS, instalamos a través de Homebrew
|
|
||||||
brew install oath-toolkit
|
|
||||||
elif [ -f /etc/debian_version ] || [ -f /etc/os-release ]; then
|
|
||||||
# En sistemas Debian y derivados
|
|
||||||
apt update
|
|
||||||
apt install -y oathtool
|
|
||||||
elif [ -f /etc/redhat-release ]; then
|
|
||||||
# En sistemas Red Hat
|
|
||||||
dnf install -y oath-toolkit
|
|
||||||
elif [ -f /etc/arch-release ]; then
|
|
||||||
# En Arch Linux
|
|
||||||
pacman -Sy --noconfirm oath-toolkit
|
|
||||||
elif [ -f /etc/rc.conf ]; then
|
|
||||||
# En BSD
|
|
||||||
pkg install -y oath-toolkit
|
|
||||||
else
|
|
||||||
echo "${os_nofound}"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "oathtool instalado correctamente."
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
||||||
# Install zbar package
|
|
||||||
function zbar_install() {
|
|
||||||
echo "Instalando zbar (herramienta para lectura de códigos QR)..."
|
|
||||||
|
|
||||||
if [ "$(uname)" == "Darwin" ]; then
|
|
||||||
# En macOS, instalamos a través de Homebrew
|
|
||||||
brew install zbar
|
|
||||||
elif [ -f /etc/debian_version ] || [ -f /etc/os-release ]; then
|
|
||||||
# En sistemas Debian y derivados
|
|
||||||
apt update
|
|
||||||
apt install -y zbar-tools
|
|
||||||
elif [ -f /etc/redhat-release ]; then
|
|
||||||
# En sistemas Red Hat
|
|
||||||
dnf install -y zbar
|
|
||||||
elif [ -f /etc/arch-release ]; then
|
|
||||||
# En Arch Linux
|
|
||||||
pacman -Sy --noconfirm zbar
|
|
||||||
elif [ -f /etc/rc.conf ]; then
|
|
||||||
# En BSD
|
|
||||||
pkg install -y zbar
|
|
||||||
else
|
|
||||||
echo "${os_nofound}"
|
|
||||||
return 1
|
|
||||||
fi
|
|
||||||
|
|
||||||
echo "zbar instalado correctamente."
|
|
||||||
return 0
|
|
||||||
}
|
|
||||||
|
|
Loading…
Reference in a new issue