Compare commits

...

2 commits

Author SHA1 Message Date
31834d4bed
[FIXED] Corregir rutas en scripts bootstrap.sh y update.sh
Corrección de rutas para que los scripts utilicen SCRIPT_DIR en lugar de BIN_HOME
para resolver problemas al cargar bibliotecas y configuraciones.

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-30 15:46:10 -05:00
b979ef59fd
[IMPROVED] Añadir instalación y actualización de redis-cli
🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-03-30 15:42:50 -05:00
2 changed files with 48 additions and 16 deletions

View file

@ -6,8 +6,8 @@
#Company Email : mauro@rosero.one
#Personal Email : mauro.rosero@gmail.com
#Created : 2025/03/19 11:57:08
#Modified : 2025/03/15 16:30:00
#Version : 1.2.0
#Modified : 2025/03/30 16:30:00
#Version : 1.3.0
#Use Notes :
#==============================================================================
# Derechos de Autor [2025] [Mauro Rosero P. <mauro@rosero.one>]
@ -40,16 +40,16 @@ BIN_BASE="bin"
BIN_LIBS="lib"
BIN_MESG="msg"
BIN_CFGS="config"
VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version")
VERSION=$(cat "$SCRIPT_DIR/$BIN_CFGS/version")
# CHECK SHELL LANGUAGE
BIN_LANG=${LANG:0:2}
# Importar bibliotecas necesarias
source "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib"
source "${SCRIPT_DIR}/${BIN_LIBS}/base.lib"
# Cargar mensajes en el idioma del sistema o español por defecto
load_messages "${BIN_HOME}/${BIN_BASE}" "${BIN_MESG}" "${BIN_LANG}" "head"
load_messages "${SCRIPT_DIR}" "${BIN_MESG}" "${BIN_LANG}" "head"
# Variables globales
title="${head_000} ${head_002}"
@ -88,6 +88,7 @@ install() {
local ANSIBLE_PACKAGE="$ANSIBLE_COMMAND"
local OATHTOOL_PACKAGE=oathtool
local ZBAR_PACKAGE=zbar
local REDIS_CLI_PACKAGE=redis-tools
# Load base bash library
BIN_HOME=$BIN_PATH
@ -202,14 +203,22 @@ install() {
echo "Instalando zbar..."
zbar_install
fi
# Install redis-cli if not already installed
command_installed redis-cli
if [ $? -ne 0 ]
then
echo "Instalando redis-cli..."
os_pkgs_install $REDIS_CLI_PACKAGE
fi
}
# Load messages
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
load_bootstrap_msg $SCRIPT_DIR $BIN_MESG $BIN_LANG
# Display Headers
display_devstools_header "- $bomsg_000"
# Run install with sudo (sin parámetros específicos)
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 $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG"

View file

@ -6,8 +6,8 @@
#Company Email : mauro@rosero.one
#Personal Email : mauro.rosero@gmail.com
#Created : 2024/12/09 10:27:00
#Modified : 2025/03/19 11:57:08
#Version : 1.2.0
#Modified : 2025/03/30 16:30:00
#Version : 1.3.0
#Use Notes :
#==============================================================================
# Derechos de Autor [2025] [Mauro Rosero P. <mauro@rosero.one>]
@ -40,10 +40,10 @@ BIN_BASE="bin"
BIN_LIBS="lib"
BIN_MESG="msg"
BIN_CFGS="config"
VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version")
VERSION=$(cat "$SCRIPT_DIR/$BIN_CFGS/version")
# LOAD BASE BASH LIBRARY
source $BIN_HOME/$BIN_BASE/$BIN_LIBS/base.lib
source $SCRIPT_DIR/$BIN_LIBS/base.lib
#baselib_test
load_bootstrap_msg() {
@ -61,7 +61,7 @@ load_bootstrap_msg() {
}
# Load messages
load_bootstrap_msg $BIN_HOME $BIN_MESG $BIN_LANG
load_bootstrap_msg $SCRIPT_DIR $BIN_MESG $BIN_LANG
# Display Headers
display_devstools_header "- $bomsg_001"
@ -76,7 +76,7 @@ else
fi
# Load bootstrap library for update functions
source $BIN_HOME/$BIN_BASE/$BIN_LIBS/bootstrap.lib
source $SCRIPT_DIR/$BIN_LIBS/bootstrap.lib
# Update sistema operativo y repositorios primero (no requiere privilegios de root)
echo -e "\n${head_info}: Actualizando repositorios locales primero..."
@ -190,7 +190,7 @@ if [ $PYTHON_INSTALLED -eq 0 ] || [ $PIP_INSTALLED -eq 0 ]; then
# Exportar todas las funciones necesarias para que estén disponibles en el subproceso sudo
# Esto incluye command_installed y otras funciones de base.lib que se necesitan
sudo bash -c "$(declare -f command_installed; declare -f update_python_and_pip); update_python_and_pip $BIN_HOME $BIN_LIBS $BIN_MESG $BIN_LANG"
sudo bash -c "$(declare -f command_installed; declare -f update_python_and_pip); update_python_and_pip $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG"
if [ $? -ne 0 ]; then
echo -e "\n${head_error}: No se pudo actualizar Python y pip. Verifique sus privilegios."
fi
@ -207,7 +207,7 @@ update_additional_tools() {
local UPDATE_LANG=$4
# Cargar biblioteca bootstrap para acceder a las funciones de instalación
source "$BIN_PATH/$BIN_BASE/$LIBRARY/bootstrap.lib"
source "$BIN_PATH/$LIBRARY/bootstrap.lib"
# Actualizar oathtool si está instalado
command_installed oathtool
@ -224,11 +224,34 @@ update_additional_tools() {
zbar_install
echo -e "${head_info}: zbar actualizado correctamente."
fi
# Actualizar redis-cli si está instalado
command_installed redis-cli
if [ $? -eq 0 ]; then
echo -e "\n${head_info}: Actualizando redis-cli..."
if [ -f /etc/debian_version ] || [ -f /etc/os-release ]; then
# Para sistemas basados en Debian
apt update
apt install --only-upgrade -y redis-tools
elif [ -f /etc/redhat-release ]; then
# Para sistemas basados en Red Hat
dnf upgrade -y redis
elif [ -f /etc/arch-release ]; then
# Para Arch Linux
pacman -Syu --noconfirm redis
elif [ "$(uname)" == "Darwin" ]; then
# Para macOS con Homebrew
brew upgrade redis
else
echo -e "${head_error}: Sistema operativo no soportado para actualizar redis-cli"
fi
echo -e "${head_info}: redis-cli actualizado correctamente."
fi
}
# Actualizar herramientas adicionales con sudo si están instaladas
echo -e "\n${head_info}: Verificando herramientas adicionales..."
sudo bash -c "$(declare -f command_installed; declare -f update_additional_tools); update_additional_tools $BIN_HOME/$BIN_BASE $BIN_LIBS $BIN_MESG $BIN_LANG"
sudo bash -c "$(declare -f command_installed; declare -f update_additional_tools); update_additional_tools $SCRIPT_DIR $BIN_LIBS $BIN_MESG $BIN_LANG"
echo -e "\n${head_info}: Proceso de actualización completado."