1
0
mirror of https://github.com/AAAAAEXQOSyIpN2JZ0ehUQ/SSHPLUS-MANAGER-FREE.git synced 2025-07-05 16:33:04 +00:00
Files
AAAAAEXQOSyIpN2JZ0ehUQ e745079f36 Update Script
2025-05-31 00:16:58 -04:00

36 lines
924 B
Bash

#!/bin/bash
# Colores
yellow='\033[01;33m'
green='\033[1;32m'
red='\033[1;31m'
white='\033[1;37m'
reset='\033[0m'
# Obtener IP local válida (excluye loopback)
IP=$(ip -4 addr show | grep -oP '(?<=inet\s)\d+(\.\d+){3}' | grep -v '^127\.' | head -n 1)
# Si no hay IP local válida, intenta obtener la IP pública
if [[ -z "$IP" ]]; then
IP=$(wget -qO- ipv4.icanhazip.com)
fi
clear
echo -e "${yellow}Capturador de IP${reset}\n"
# Confirmar IP con el usuario
read -e -i "$IP" -p "$(echo -e "${green}Confirma tu IP: ${white}")" ipdovps
# Guardar la IP en rutas necesarias
for path in /etc/IP /etc/MEUIPADM /usr/bin/vendor_code; do
echo "$ipdovps" > "$path"
done
# Mensajes de confirmación
echo -e "\n${green}IP capturada:${white} $ipdovps"
echo -e "${green}Ruta guardada:${reset} /etc/IP"
echo -e "${green}Ruta guardada:${reset} /etc/MEUIPADM"
echo -e "${green}Ruta guardada:${reset} /usr/bin/vendor_code\n"
exit 0