- Actualizar scripts con estructura de cabecera estandarizada - Renombrar cortana_install.sh a claude_install.sh - Agregar cortana_unalias.sh para facilitar la gestión de alias - Mejorar manejo de rutas usando SCRIPT_DIR para determinar ubicaciones - Usar variables de configuración consistentes en todos los scripts - Implementar carga de mensajes estandarizada en todos los scripts - Agregar limpieza de consola al finalizar la mayoría de scripts - Eliminar scripts obsoletos y redundantes 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
114 lines
2.9 KiB
Bash
Executable file
114 lines
2.9 KiB
Bash
Executable file
#!/bin/bash
|
|
#
|
|
# Script: gpg_init.sh
|
|
# Description: Script de inicialización de estructura para firma GPG
|
|
# Created: 2024/12/09 10:27:00
|
|
# Modified: 2025/03/19 11:57:08
|
|
# [Author] Mauro Rosero P. <mauro@rosero.one>
|
|
#
|
|
# Derechos de Autor (C) [2025] [Mauro Rosero P. <mauro@rosero.one>]
|
|
#
|
|
# 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
|
|
# lo publica la Free Software Foundation, ya sea la versión 3 de la licencia,
|
|
# o (a su elección) cualquier versión posterior.
|
|
#
|
|
# Este programa se distribuye con la esperanza de que sea útil,
|
|
# pero SIN NINGUNA GARANTÍA; sin siquiera la garantía implícita de
|
|
# COMERCIABILIDAD o IDONEIDAD PARA UN PROPÓSITO PARTICULAR. Consulte la
|
|
# Licencia Pública Affero General de GNU para obtener más detalles.
|
|
#
|
|
# Debería haber recibido una copia de la Licencia Pública Affero General
|
|
# junto con este programa. Si no la recibió, consulte <https://www.gnu.org/licenses/>.
|
|
|
|
# Configuración inicial
|
|
# Usar DEVELOPER_DIR de base.lib
|
|
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
BIN_BASE="bin"
|
|
BIN_LIBS="lib"
|
|
BIN_MESG="msg"
|
|
BIN_CFGS="config"
|
|
|
|
# Leer DEVSPATH desde el archivo de configuración o usar "devs" por defecto
|
|
if [ -f "$SCRIPT_DIR/$BIN_CFGS/devspath.dat" ]; then
|
|
DEVSPATH=$(cat "$SCRIPT_DIR/$BIN_CFGS/devspath.dat")
|
|
else
|
|
DEVSPATH="devs"
|
|
fi
|
|
|
|
BIN_HOME="$HOME/$DEVSPATH"
|
|
VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version")
|
|
|
|
# CHECK SHELL LANGUAGE
|
|
BIN_LANG=${LANG:0:2}
|
|
|
|
# LOAD BASE BASH LIBRARY
|
|
source $BIN_HOME/$BIN_LIBS/base.lib
|
|
#baselib_test
|
|
|
|
# LOAD CONSOLE BASH LIBRARY
|
|
source $BIN_HOME/$BIN_LIBS/console.lib
|
|
#consolelib_test
|
|
|
|
# LOAD GPG BASH LIBRARY
|
|
source $BIN_HOME/$BIN_LIBS/gpg.lib
|
|
#gpglib_test
|
|
|
|
# Load head messages
|
|
load_messages $BIN_HOME $BIN_MESG $BIN_LANG "head"
|
|
|
|
# Load gpg messages
|
|
load_messages $BIN_HOME $BIN_MESG $BIN_LANG "gpg"
|
|
|
|
########### MAIN PROGRAM ###########
|
|
|
|
# Set program title
|
|
title="$head_000 $head_002"
|
|
apps_title="${gpmsg_000}"
|
|
|
|
# Check if dialog is not installed, exited!
|
|
command_installed "dialog"
|
|
if [ $? -ne 0 ]
|
|
then
|
|
display_devstools_header "${gpmsg_000}"
|
|
echo "${head_001}"
|
|
exit 200
|
|
fi
|
|
|
|
# Check if os is valid!
|
|
get_osname
|
|
if [ "${os_name}" == "${head_unknow}" ]
|
|
then
|
|
dialog_error_box "${head_error}" "${head_os_error}"
|
|
exit 3
|
|
fi
|
|
|
|
# Reset gpg configuration to template
|
|
dialog_yesno "${gpmsg_101}"
|
|
case ${result} in
|
|
0)
|
|
gpg_setting "$BIN_HOME" "$GPG_DEFAULT_PATH" "$GPG_DEFAULT_PATH" "$DATEBAK"
|
|
rc=$?
|
|
case $rc in
|
|
0)
|
|
dialog_error_box "${head_info}" "${gpmsg_102}"
|
|
clear
|
|
exit 0
|
|
;;
|
|
1)
|
|
dialog_error_box "${head_error}" "${gpmsg_103}"
|
|
clear
|
|
exit 0
|
|
;;
|
|
*)
|
|
dialog_error_box "${head_error}" "${head_op_error} (${rc})"
|
|
;;
|
|
esac
|
|
;;
|
|
*)
|
|
dialog_error_box "${head_error}" "${head_op_error}"
|
|
;;
|
|
esac
|
|
|
|
# End Main Program
|
|
clear
|