- Actualizada la versión en los siguientes scripts: - nodered.sh - ollama.sh - ollama_up.sh - ollama_down.sh - vpn_check.sh - Consistencia de versión entre todos los componentes del proyecto 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <noreply@anthropic.com>
68 lines
2.3 KiB
Bash
Executable file
68 lines
2.3 KiB
Bash
Executable file
#!/bin/bash
|
|
#Script : vpn_check.sh
|
|
#Apps : MRDEVS TOOLS
|
|
#Description : Verifica conexión a VPN
|
|
#Author : Mauro Rosero Pérez
|
|
#Company Email : mauro@rosero.one
|
|
#Personal Email : mauro.rosero@gmail.com
|
|
#Created : 2025/03/22 14:57:08
|
|
#Modified : 2025/03/22 14:57:08
|
|
#Version : 1.3.0
|
|
#==============================================================================
|
|
# Derechos de Autor [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/config/devspath.dat" ]; then
|
|
DEVSPATH=$(cat "$SCRIPT_DIR/$BIN_CFGS/devspath.dat")
|
|
else
|
|
DEVSPATH="devs"
|
|
fi
|
|
|
|
BIN_HOME="$HOME/$DEVSPATH"
|
|
BIN_PATH=$BIN_HOME/$BIN_BASE
|
|
VERSION=$(cat "$BIN_HOME/$BIN_BASE/$BIN_CFGS/version")
|
|
|
|
# CHECK SHELL LANGUAGE
|
|
BIN_LANG=${LANG:0:2}
|
|
|
|
# Importar bibliotecas necesarias
|
|
if [ -f "${BIN_HOME}/${BIN_BASE}/${BIN_LIBS}/base.lib" ]; then
|
|
source "${BIN_HOME}/${BIN_BASE}/${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"
|
|
title="${head_000} ${head_002}"
|
|
fi
|
|
|
|
# Verificar tipo de VPN conectado
|
|
vpn_type=$(get_vpn_type)
|
|
vpn_result=$?
|
|
if [ $vpn_result -eq 0 ]; then
|
|
echo "$head_vpn_type: $vpn_type"
|
|
else
|
|
if [ $vpn_result -eq 1 ]; then
|
|
echo "$head_vpn_no_connected"
|
|
else
|
|
echo "$head_vpn_unknown"
|
|
fi
|
|
fi
|