From e05cf0963b769b75d99edc1fd44d5c2af0e4479e Mon Sep 17 00:00:00 2001 From: darnix Date: Sat, 22 Nov 2025 12:58:21 +0000 Subject: [PATCH] Subir archivos a "/" --- LATAM | 468 +++++++++++++++++++++++++++------------------------------- 1 file changed, 220 insertions(+), 248 deletions(-) diff --git a/LATAM b/LATAM index f2cb54a..9afd501 100644 --- a/LATAM +++ b/LATAM @@ -1,27 +1,35 @@ #!/bin/bash -# INSTALADO --- ACTULIZADO EL 12-01-2023 --By @Kalix1 -rm -f $HOME/setup* -rm -f $HOME/install* +##-->> INSTALADOR --- ACTUALIZADO EL 16-03-2023 -- >> By @Kalix1 << --- clear && clear colores="$(pwd)/colores" rm -rf ${colores} -wget -O ${colores} "https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/colores" &>/dev/null +wget -O ${colores} "https://raw.githubusercontent.com/darnix1/license/refs/heads/main/colores" &>/dev/null [[ ! -e ${colores} ]] && exit chmod +x ${colores} &>/dev/null -source ${colores} +##-->> CARGAR SC EXTERNO +source $(pwd)/colores CTRL_C() { rm -rf ${colores} - rm -rf /root/LATAM + rm -rf $(pwd)/LATAM exit } +##-->> DETECTAR CANCELAR Y ELIMINAR ARCHIVO trap "CTRL_C" INT TERM EXIT -#rm $(pwd)/$0 &>/dev/null -#-- VERIFICAR ROOT +rm $(pwd)/$0 &>/dev/null +#-->> DETECTAR ROOT if [ $(whoami) != 'root' ]; then echo "" echo -e "\033[1;31m NECESITAS SER USER ROOT PARA EJECUTAR EL SCRIPT \n\n\033[97m DIGITE: \033[1;32m sudo su\n" exit fi +if fuser /var/lib/dpkg/lock >/dev/null 2>&1; then + echo -e "\033[1;31mEl sistema de actualización está siendo utilizado por otro proceso. Deteniendo el proceso..." + pid=$(fuser /var/lib/dpkg/lock 2>/dev/null) + if [ ! -z "$pid" ]; then + echo -e "\033[1;31mDeteniendo el proceso $pid..." + kill -9 $pid >/dev/null 2>&1 + fi +fi os_system() { system=$(cat -n /etc/issue | grep 1 | cut -d ' ' -f6,7,8 | sed 's/1//' | sed 's/ //') distro=$(echo "$system" | awk '{print $1}') @@ -37,7 +45,7 @@ repo() { 8 | 9 | 10 | 11 | 16.04 | 18.04 | 20.04 | 20.10 | 21.04 | 21.10 | 22.04) wget -O /etc/apt/sources.list ${link} &>/dev/null ;; esac } -## PRIMER PASO DE INSTALACION +##-->> PREPARAR PAQUETERIAS Y DIRECTORIOS install_inicial() { clear && clear #CARPETAS PRINCIPALES @@ -66,6 +74,7 @@ install_inicial() { return $stat } if val_ip $IP; then + mkdir -p /root/.ssh echo "$IP" >/root/.ssh/authrized_key.reg else echo "" @@ -92,11 +101,37 @@ install_inicial() { echo -e "\033[1;97m TU CONTRASEÑA ROOT AHORA ES: \e[41m $pass \033[0;37m" } + ##-->>AGREGAR NOTIFICADOR ROOT + avi_login() { + for i in {1..4}; do tput cuu 1 && tput el; done + wget -O /etc/profile.d/notify-lroot.sh https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/notify-lroot.sh >/dev/null 2>&1 + chmod +x /etc/profile.d/notify-lroot.sh + msgi -bar + echo -e "\033[1;97m NOTIFICADOR VIA PUSH DE LOGINS ROOT" + msgi -bar + echo -e "\033[1;97mEsta es una herramianta que te Notificara mediante\nuna apk cuando alguien ingrese ssh root en la VPS" + echo -e "\033[1;97m Descarge la Aplicasion directo de Play Store" + echo -e "\033[1;96m https://play.google.com/store/apps/details?id=net.xdroid.pn" + msgi -bar + echo -ne "\033[1;97m DIGITE SU KEY: \033[1;32m" && read keyapk + echo "$keyapk" >/etc/SCRIPT-LATAM/temp/keyapk + echo -ne "\033[1;97m INGRESE ALGUN NOMBRE PARA SU VPS: \033[1;32m" && read nomvpsapk + echo "$nomvpsapk" >/etc/SCRIPT-LATAM/temp/nomvpsapk + KEY=$(cat /etc/SCRIPT-LATAM/temp/keyapk) + IP=$(cat /root/.ssh/authrized_key.reg) + NOMBREVPS=$(cat /etc/SCRIPT-LATAM/temp/nomvpsapk | tr '[:space:]' '+' | tr -d 'ñ' | sed '/^$/d') + curl -s "http://xdroid.net/api/message?k=$KEY&t=%F0%9F%98%8E+Mensaje+de+Prueba%E2%9C%8C%EF%B8%8F&c=%F0%9F%96%A5%EF%B8%8F+VPS%3A+$NOMBREVPS%0A%F0%9F%8C%90+IP%3A+$IP&u=" >/dev/null 2>&1 + msgi -bar + echo -e "\033[1;97mSe envio un mensaje de prueba si no le llevo contacte @Kalix1" + sleep 10s + for i in {1..8}; do tput cuu 1 && tput el; done + } #-- VERIFICAR VERSION v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version") echo "$v1" >/etc/SCRIPT-LATAM/temp/version_instalacion v22=$(cat /etc/SCRIPT-LATAM/temp/version_instalacion) vesaoSCT="\033[1;31m [ \033[1;32m($v22)\033[1;97m\033[1;31m ]" + echo "not_banned" >/etc/SCRIPT-LATAM/temp/ban_status #-- CONFIGURACION BASICA os_system repo "${vercion}" @@ -120,7 +155,7 @@ password required pam_permit.so' >/etc/pam.d/common-password && chmod +x /etc/pa echo "" msgi -bar2 fun_ip() { - TUIP=$(curl -sSL https://ipinfo.io/ip) + TUIP=$(wget -qO- ipinfo.io/ip || wget -qO- ifconfig.me) echo "$TUIP" >/root/.ssh/authrized_key.reg echo -e "\033[1;97m ESTA ES TU IP PUBLICA? \033[32m$TUIP" msgi -bar2 @@ -129,6 +164,7 @@ password required pam_permit.so' >/etc/pam.d/common-password && chmod +x /etc/pa [[ "$tu_ip" = "n" || "$tu_ip" = "N" ]] && tu_ip } fun_ip + for i in {1..4}; do tput cuu 1 && tput el; done msgi -bar2 echo -e "\033[1;93m AGREGAR Y EDITAR PASS ROOT\033[1;97m" msgi -bar @@ -137,6 +173,16 @@ password required pam_permit.so' >/etc/pam.d/common-password && chmod +x /etc/pa echo -ne "\033[1;97m Seleccione \033[1;31m[\033[1;93m S \033[1;31m/\033[1;93m N \033[1;31m]\033[1;97m: \033[1;93m" && read pass_root #read -p " Seleccione [ S / N ]: " tu_ip [[ "$pass_root" = "s" || "$pass_root" = "S" ]] && pass_root + for i in {1..6}; do tput cuu 1 && tput el; done + msgi -bar2 + echo -e "\033[1;93m AGREGAR NOTIFY \033[1;97m" + msgi -bar + echo -e "\033[1;97m AGREGAR REGISTRO DE NOTYFY? \033[32m" + msgi -bar2 + echo -ne "\033[1;97m Seleccione \033[1;31m[\033[1;93m S \033[1;31m/\033[1;93m N \033[1;31m]\033[1;97m: \033[1;93m" && read avi_login + #read -p " Seleccione [ S / N ]: " tu_ip + [[ "$avi_login" = "s" || "$avi_login" = "S" ]] && avi_login + for i in {1..6}; do tput cuu 1 && tput el; done msgi -bar2 echo -e "\033[1;93m\a\a\a SE PROCEDERA A INSTALAR LAS ACTULIZACIONES\n PERTINENTES DEL SISTEMA, ESTE PROCESO PUEDE TARDAR\n VARIOS MINUTOS Y PUEDE PEDIR ALGUNAS CONFIRMACIONES \033[0;37m" msgi -bar @@ -144,7 +190,7 @@ password required pam_permit.so' >/etc/pam.d/common-password && chmod +x /etc/pa clear && clear apt update apt upgrade -y - wget /root/LATAM https://raw.githubusercontent.com/darnix1/Botcgh/refs/heads/main/LATAM -O /usr/bin/LATAM &>/dev/null + wget -O /usr/bin/LATAM https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Instalador/LATAM &>/dev/null chmod +x /usr/bin/LATAM } @@ -171,40 +217,29 @@ time_reboot() { dependencias() { dpkg --configure -a >/dev/null 2>&1 apt -f install -y >/dev/null 2>&1 - soft="sudo bsdmainutils zip unzip ufw curl python python3 python3-pip openssl cron iptables lsof pv boxes at mlocate gawk bc jq curl npm nodejs socat netcat netcat-traditional net-tools cowsay figlet lolcat apache2" - for i in $soft; do + packages="zip unzip python python3 python3-pip openssl iptables lsof pv boxes at mlocate gawk bc jq npm nodejs socat net-tools cowsay figlet lolcat" + for i in $packages; do paquete="$i" - echo -e "\033[1;97m INSTALANDO PAQUETE \e[93m >>> \e[36m $i" + echo -e "\033[1;97m INSTALANDO PAQUETE \e[93m >>> \e[36m $i" barra_intall "apt-get install $i -y" done } install_paquetes() { - wget /root/LATAM https://raw.githubusercontent.com/darnix1/Botcgh/refs/heads/main/LATAM -O /usr/bin/LATAM &>/dev/null - chmod +x /usr/bin/LATAM clear && clear - #------- BARRA DE ESPERA msgi -bar2 - echo -e " \e[5m\033[1;100m =====>> ►► 🖥 SCRIPT | LATAM 🖥 ◄◄ <<===== \033[1;37m" + echo -e " \e[33m\e[5m\033[1;100m =====>> ►► 🖥 SCRIPT | LATAM 🖥 ◄◄ <<===== \033[1;37m" msgi -bar echo -e " \033[1;41m -- INSTALACION DE PAQUETES PARA LATAM -- \e[49m" msgi -bar - [[ -e dp.ok ]] && echo "DEPENDENCIAS YA INSTALADAS " || dependencias - sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf >/dev/null 2>&1 - service apache2 restart >/dev/null 2>&1 - [[ $(sudo lsof -i :81) ]] || ESTATUSP=$(echo -e "\033[1;91m >>> FALLO DE INSTALACION EN APACHE <<<") &>/dev/null - [[ $(sudo lsof -i :81) ]] && ESTATUSP=$(echo -e "\033[1;92m PUERTO APACHE ACTIVO CON EXITO") &>/dev/null - echo "" - echo -e "$ESTATUSP" - echo "" - echo -e "\e[1;97m REMOVIENDO PAQUETES OBSOLETOS - \e[1;32m OK" - apt autoremove -y &>/dev/null + dependencias + echo -e "\e[1;97m REMOVIENDO PAQUETES OBSOLETOS \e[1;32m" + barra_intallb "apt autoremove -y " echo iptables-persistent iptables-persistent/autosave_v4 boolean true | sudo debconf-set-selections echo iptables-persistent iptables-persistent/autosave_v6 boolean true | sudo debconf-set-selections msgi -bar2 read -t 30 -n 1 -rsp $'\033[1;97m Preciona Enter Para continuar\n' } - #SELECTOR DE INSTALACION while :; do case $1 in @@ -222,241 +257,178 @@ while :; do esac done -## PASO DOS -Install_key() { - wget /root/LATAM https://raw.githubusercontent.com/darnix1/Botcgh/refs/heads/main/LATAM -O /usr/bin/LATAM &>/dev/null +instalador_final() { + tput cuu1 && tput dl1 + tput cuu1 && tput dl1 + echo -e " \033[1;4;32mLA KEY ES VALIDA FINALIZANDO INSTALACION \033[0;39m" + ##-->> ACOPLANDO INSTALL EN /BIN + wget /root/LATAM https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Instalador/LATAM -O /usr/bin/LATAM &>/dev/null chmod +x /usr/bin/LATAM + ##-->> LIMPIAR BASHRC /bin/cp /etc/skel/.bashrc ~/ - clear && clear + ##-->> DESCARGAR FICHEROS + cd /etc + wget https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/SCRIPT-LATAM.tar.gz >/dev/null 2>&1 + tar -xf SCRIPT-LATAM.tar.gz >/dev/null 2>&1 + chmod +x SCRIPT-LATAM.tar.gz >/dev/null 2>&1 + rm -rf SCRIPT-LATAM.tar.gz + cd + ##-->> ADPTAR SLOGAN + wget -O /etc/SCRIPT-LATAM/message.txt http://155.138.245.13:81/Slogan/message.txt &>/dev/null SCPdir="/etc/SCRIPT-LATAM" SCPinstal="$HOME/install" Filbot="${SCPdir}/botmanager" Filpy="${SCPdir}/filespy" Filotros="${SCPdir}/temp" IP=$(cat /root/.ssh/authrized_key.reg) - function_verify() { - permited=$(curl -sSL "https://raw.githubusercontent.com/darnix1/permission/refs/heads/main/ipmini") - [[ $(echo $permited | grep "${IP}") = "" ]] && { - clear && clear - echo -e "\n\n\n\033[1;91m————————————————————————————————————————————————————\n ¡ESTA KEY NO CONCUERDA CON EL INSTALADOR! \n CONATACTE A @Kalix1\n————————————————————————————————————————————————————\n\n\n" - # [[ -d /etc/SCRIPT-LATAM ]] && rm -rf /etc/SCRIPT-LATAM - exit 1 - } || { - ### INSTALAR VERSION DE SCRIPT - v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version") - echo "$v1" >/etc/SCRIPT-LATAM/temp/version_instalacion - FIns=$(printf '%(%D-%H:%M:%S)T') - echo "$FIns" >/etc/SCRIPT-LATAM/F-Instalacion - } - } - fun_idi() { - clear && clear - msgi -bar2 - echo -e "\033[1;32m————————————————————————————————————————————————————" - figlet -w 85 -f smslant " SCRIPT - LATAM " | lolcat - msgi -ama " [ ----- \033[1;97m 🐲 By @ChumoGH 🐲\033[1;33m ----- ]" - echo -e "\033[1;32m————————————————————————————————————————————————————" - pv="$(echo es)" - [[ ${#id} -gt 2 ]] && id="es" || id="$pv" - byinst="true" - } - - install_fim() { - echo -e " \033[1;4;32mFinalizando Instalacion\033[0;39m" - wget -O /bin/rebootnb https://www.dropbox.com/s/d77e1vaknc0hhqi/rebootnb.sh &>/dev/null - chmod +x /bin/rebootnb - wget -O /etc/SCRIPT-LATAM/temp/version_actual https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version &>/dev/null - msgi -bar2 - echo '#!/bin/sh -e' >/etc/rc.local + ### INSTALAR VERSION DE SCRIPT + v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version") + echo "$v1" >/etc/SCRIPT-LATAM/temp/version_instalacion + FIns=$(printf '%(%D-%H:%M:%S)T') + echo "$FIns" >/etc/SCRIPT-LATAM/F-Instalacion + last_check_file="/etc/SCRIPT-LATAM/temp/last_check" + date "+%Y-%m-%d %H:%M:%S" >"$last_check_file" + wget -O /bin/rebootnb https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/rebootnb.sh &>/dev/null + chmod +x /bin/rebootnb + wget -O /bin/autoinicios https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/autoinicios &>/dev/null + chmod +rwx /bin/autoinicios + wget -O /etc/systemd/system/iniciolatam.service https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/iniciolatam.service &>/dev/null + sudo systemctl enable -q iniciolatam.service + wget -O /bin/check-update https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Ejecutables/check-update &>/dev/null + chmod +rwx /bin/check-update + wget -O /etc/SCRIPT-LATAM/temp/version_actual https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version &>/dev/null + echo '#!/bin/sh -e' >/etc/rc.local sudo chmod +x /etc/rc.local echo "sudo rebootnb reboot" >>/etc/rc.local echo "sleep 2s" >>/etc/rc.local echo "exit 0" >>/etc/rc.local - echo 'clear && clear' >>.bashrc - echo 'rebootnb login >/dev/null 2>&1' >>.bashrc - echo 'echo -e "\033[1;31m————————————————————————————————————————————————————" ' >>.bashrc - echo 'echo -e "\033[1;93m════════════════════════════════════════════════════" ' >>.bashrc - echo 'sudo figlet -w 85 -f smslant " SCRIPT + msgi -bar2 + echo 'clear && clear' >>.bashrc + echo 'rebootnb login >/dev/null 2>&1' >>.bashrc + echo 'echo -e "\033[1;31m————————————————————————————————————————————————————" ' >>.bashrc + echo 'echo -e "\033[1;93m════════════════════════════════════════════════════" ' >>.bashrc + echo 'sudo figlet -w 85 -f smslant " SCRIPT LATAM" | lolcat' >>.bashrc - echo 'echo -e "\033[1;93m════════════════════════════════════════════════════" ' >>.bashrc - echo 'echo -e "\033[1;31m————————————————————————————————————————————————————" ' >>.bashrc - echo 'mess1="$(less -f /etc/SCRIPT-LATAM/message.txt | head -1)" ' >>.bashrc - echo 'echo "" ' >>.bashrc - echo 'echo -e "\033[92m -->> SLOGAN:\033[93m $mess1 "' >>.bashrc - echo 'echo "" ' >>.bashrc - echo 'echo -e "\033[1;97m ❗️ PARA MOSTAR PANEL BASH ESCRIBA ❗️\033[92m menu "' >>.bashrc - echo 'wget -O /etc/SCRIPT-LATAM/temp/version_actual https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version &>/dev/null' >>.bashrc - echo 'echo ""' >>.bashrc - #-BASH SOPORTE ONLINE - wget https://www.dropbox.com/s/np0ycjehuiequ2m/SPR.sh -O /usr/bin/SPR >/dev/null 2>&1 - chmod +x /usr/bin/SPR - SPR >/dev/null 2>&1 - timeespera="1" - times="10" - if [ "$timeespera" = "1" ]; then - echo -e "\033[1;97m ❗️ REGISTRANDO IP y KEY EN LA BASE ❗️ " - msgi -bar2 - while [ $times -gt 0 ]; do - echo -ne " -$times-\033[0K\r" - sleep 1 - : $((times--)) - done - tput cuu1 && tput dl1 - tput cuu1 && tput dl1 - tput cuu1 && tput dl1 - msgi -bar2 - echo -e " \033[1;92m LISTO REGISTRO COMPLETO " - echo -e " \033[1;97m COMANDO PRINCIPAL PARA ENTRAR AL PANEL " - echo -e " \033[1;41m menu o MENU \033[0;37m" && msgi -bar2 - fi - meu_ip() { - if [[ -e /tmp/IP ]]; then - echo "$(cat /tmp/IP)" - else - MEU_IP=$(curl -sSL ifconfig.me) - echo "$MEU_IP" >/tmp/IP - fi - } - meu_ip - exit - } - ofus() { - unset server - #server=$(echo ${txt_ofuscatw} | cut -d':' -f1) - unset txtofus - number=$(expr length $1) - for ((i = 1; i < $number + 1; i++)); do - txt[$i]=$(echo "$1" | cut -b $i) - case ${txt[$i]} in - ".") txt[$i]="v" ;; - "v") txt[$i]="." ;; - "1") txt[$i]="@" ;; - "@") txt[$i]="1" ;; - "2") txt[$i]="?" ;; - "?") txt[$i]="2" ;; - "4") txt[$i]="p" ;; - "p") txt[$i]="4" ;; - "-") txt[$i]="L" ;; - "L") txt[$i]="-" ;; - esac - txtofus+="${txt[$i]}" - done - echo "$txtofus" | rev - } - verificar_arq() { - case $1 in - "menu.sh" | "message.txt") ARQ="${SCPdir}/" ;; - "LATAMbot.sh") ARQ="${Filbot}/" ;; - "PDirect.py" | "PPub.py" | "PPriv.py" | "POpen.py" | "PGet.py") ARQ="${Filpy}/" ;; - *) ARQ="${Filotros}/" ;; - esac - mv -f ${SCPinstal}/$1 ${ARQ}/$1 - chmod +x ${ARQ}/$1 - } - #fun_ip - [[ $1 = "" ]] && fun_idi || { - [[ ${#1} -gt 2 ]] && fun_idi || id="$1" - } - error_fun() { + echo 'echo -e "\033[1;93m════════════════════════════════════════════════════" ' >>.bashrc + echo 'echo -e "\033[1;31m————————————————————————————————————————————————————" ' >>.bashrc + echo 'mess1="$(less -f /etc/SCRIPT-LATAM/message.txt)" ' >>.bashrc + echo 'echo "" ' >>.bashrc + echo 'echo -e "\033[92m -->> SLOGAN:\033[93m $mess1 "' >>.bashrc + echo 'echo "" ' >>.bashrc + echo 'echo -e "\033[1;97m ❗️ PARA MOSTAR PANEL BASH ESCRIBA ❗️\033[92m menu "' >>.bashrc + echo 'wget -O /etc/SCRIPT-LATAM/temp/version_actual https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Version &>/dev/null' >>.bashrc + echo 'echo ""' >>.bashrc + echo "${SCPdir}/menu.sh" >/usr/bin/menu && chmod +x /usr/bin/menu + echo "${SCPdir}/menu.sh" >/usr/bin/MENU && chmod +x /usr/bin/MENU + echo "$Key" >${SCPdir}/key.txt + #-BASH SOPORTE ONLINE + wget https://raw.githubusercontent.com/NetVPS/LATAM_Oficial/main/Fixs%20Remotos/SPR.sh -O /usr/bin/SPR >/dev/null 2>&1 + chmod +x /usr/bin/SPR + SPR >/dev/null 2>&1 + timeespera="1" + times="10" + if [ "$timeespera" = "1" ]; then + echo -e "\033[1;97m ❗️ REGISTRANDO IP y KEY EN LA BASE ❗️ " msgi -bar2 - msgi -bar2 - sleep 3s - clear && clear - echo "Codificacion Incorrecta" >/etc/SCRIPT-LATAM/errorkey - msgi -bar2 - [[ $1 = "" ]] && fun_idi || { - [[ ${#1} -gt 2 ]] && fun_idi || id="$1" - } - echo -e "\033[1;31m ¡# ERROR INESPERADO #¡\n ESTA KEY YA FUE USADA O EXPIRO " - echo -e "\033[0;93m -SI EL ERROR PERCISTE REVISAR PUERTO 81 TCP -" - msgi -bar2 - echo -ne "\033[1;97m DESEAS REINTENTAR CON OTRA KEY \033[1;31m[\033[1;93m S \033[1;31m/\033[1;93m N \033[1;31m]\033[1;97m: \033[1;93m" && read incertar_key - service apache2 restart >/dev/null 2>&1 - [[ "$incertar_key" = "s" || "$incertar_key" = "S" ]] && incertar_key - clear && clear - msgi -bar2 - msgi -bar2 - rm -rf lista-arq - echo -e "\033[1;97m ---- INSTALACION CANCELADA -----" - msgi -bar2 - msgi -bar2 - exit 1 - } - invalid_key() { - msgi -bar2 - msgi -bar2 - sleep 3s - clear && clear - echo "Codificacion Incorrecta" >/etc/SCRIPT-LATAM/errorkey - msgi -bar2 - [[ $1 = "" ]] && fun_idi || { - [[ ${#1} -gt 2 ]] && fun_idi || id="$1" - } - echo -e "\033[1;31m CIFRADO INVALIDO -- #¡La Key fue Invalida#! " - msgi -bar2 - echo -ne "\033[1;97m DESEAS REINTENTAR CON OTRA KEY \033[1;31m[\033[1;93m S \033[1;31m/\033[1;93m N \033[1;31m]\033[1;93m: \033[1;93m" && read incertar_key - [[ "$incertar_key" = "s" || "$incertar_key" = "S" ]] && incertar_key - clear && clear - msgi -bar2 - msgi -bar2 - echo -e "\033[1;97m ---- INSTALACION CANCELADA -----" - msgi -bar2 - msgi -bar2 - exit 1 - } - - incertar_key() { - - [[ -d /etc/SCRIPT-LATAM/errorkey ]] && rm -rf /etc/SCRIPT-LATAM/errorkey >/dev/null 2>&1 - echo "By Kalix1" >/etc/SCRIPT-LATAM/errorkey - msgi -bar2 - echo -ne "\033[1;96m >>> INTRODUZCA LA KEY ABAJO <<<\n\033[1;31m " && read Key - [[ -z "$Key" ]] && Key="NULL" + while [ $times -gt 0 ]; do + echo -ne " -$times-\033[0K\r" + sleep 1 + : $((times--)) + done tput cuu1 && tput dl1 - msgi -ne " \033[1;93m# Verificando Key # : " - cd $HOME - IPL=$(cat /root/.ssh/authrized_key.reg) - wget -O $HOME/lista-arq $(ofus "$Key")/$IPL/LATAM >/dev/null 2>&1 && echo -e "\033[1;32m Codificacion Correcta" || { - echo -e "\033[1;31m Codificacion Incorrecta" - invalid_key - exit - } - IP=$(ofus "$Key" | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -o -E '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}') && echo "$IP" >/usr/bin/vendor_code - sleep 1s - function_verify - updatedb - if [[ -e $HOME/lista-arq ]] && [[ ! $(cat /etc/SCRIPT-LATAM/errorkey | grep "Codificacion Incorrecta") ]]; then - msgi -bar2 - msgi -verd " Ficheros Copiados \e[97m[\e[93m Key By @Panel_NetVPS_bot \e[97m]" - REQUEST=$(ofus "$Key" | cut -d'/' -f2) - [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal} - pontos="." - stopping="Configurando Directorios" - for arqx in $(cat $HOME/lista-arq); do - msgi -verm "${stopping}${pontos}" - wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} >/dev/null 2>&1 && verificar_arq "${arqx}" || { - error_fun - exit - } - tput cuu1 && tput dl1 - pontos+="." - done - sleep 1s - msgi -bar2 - listaarqs="$(locate "lista-arq" | head -1)" && [[ -e ${listaarqs} ]] && rm $listaarqs - cat /etc/bash.bashrc | grep -v '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >/etc/bash.bashrc.2 - echo -e '[[ $UID != 0 ]] && TMOUT=15 && export TMOUT' >>/etc/bash.bashrc.2 - mv -f /etc/bash.bashrc.2 /etc/bash.bashrc - echo "${SCPdir}/menu.sh" >/usr/bin/menu && chmod +x /usr/bin/menu - echo "${SCPdir}/menu.sh" >/usr/bin/MENU && chmod +x /usr/bin/MENU - echo "$Key" >${SCPdir}/key.txt - [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal} - [[ ${byinst} = "true" ]] && install_fim + tput cuu1 && tput dl1 + tput cuu1 && tput dl1 + msgi -bar2 + echo -e " \033[1;93m LISTO REGISTRO COMPLETO " + echo -e " \033[1;97m COMANDO PRINCIPAL PARA ENTRAR AL PANEL " + echo -e " \033[1;41m menu o MENU \033[0;37m " && msgi -bar2 + fi + meu_ip() { + if [[ -e /tmp/IP ]]; then + echo "$(cat /tmp/IP)" else - invalid_key + MEU_IP=$(wget -qO- ipinfo.io/ip || wget -qO- ifconfig.me) + echo "$MEU_IP" >/tmp/IP fi } - incertar_key + meu_ip &>/dev/null + exit } -Install_key + +error_fun() { + tput cuu 2 + tput el + tput el + echo -e "\033[1;31m ¡# ERROR INESPERADO #¡" + echo -e "\033[1;31m ESTA KEY YA FUE USADA O EXPIRO " + msgi -bar2 + echo -ne "\033[1;97m DESEAS REINTENTAR CON OTRA KEY \033[1;31m[\033[1;93m S \033[1;31m/\033[1;93m N \033[1;31m]\033[1;97m: \033[1;93m" && read incertar_key + [[ "$incertar_key" = "s" || "$incertar_key" = "S" ]] && check_key + clear && clear + msgi -bar2 + echo -e "\033[1;97m ---- INSTALACION CANCELADA -----" + msgi -bar2 + exit +} + +check_key() { + clear && clear + msgi -bar2 + echo -e "\033[1;32m————————————————————————————————————————————————————" + figlet -w 85 -f smslant " SCRIPT + LATAM " | lolcat + msgi -ama " [ ----- \033[1;97m 🐲 By @Kalix1 🐲\033[1;33m ----- ]" + echo -e "\033[1;32m————————————————————————————————————————————————————" + msgi -bar2 + + echo -ne "\033[1;96m >>> INTRODUZCA LA KEY ABAJO <<<\n\033[1;31m " && read Key + + # TU IP AQUI + IP_SERVIDOR="50.116.47.166" + + # 1. Validar la Key + respuesta=$(curl -s --data "clave=$Key" http://${IP_SERVIDOR}:81/CheckPHP/CheckKey.php) + + # Limpiar respuesta + respuesta=$(echo $respuesta | tr -d '[:space:]') + + if [[ "$respuesta" == "clave_valida" ]]; then + echo -e "\n\033[1;92m ✅ ¡KEY VALIDA! ACCESO CONCEDIDO.\033[0m" + + # --- NUEVO: Descargar y GUARDAR en /var/local/ --- + + # 1. Definimos la ruta de destino + DESTINO="/var/local/message.txt" + + # 2. Descargamos el archivo y lo guardamos en esa ruta (-O mayúscula) + wget -q -O "$DESTINO" http://${IP_SERVIDOR}:81/CheckPHP/message.txt + + # 3. Leemos el archivo recién guardado para mostrar el nombre + if [[ -e "$DESTINO" ]]; then + NOMBRE_USUARIO=$(cat "$DESTINO") + else + NOMBRE_USUARIO="Usuario" + fi + + echo -e "\033[1;97m Bienvenido: \033[1;93m$NOMBRE_USUARIO\033[0m" + #echo -e "\033[1;97m Archivo guardado en: \033[1;90m$DESTINO\033[0m" + echo -e "\033[1;32m————————————————————————————————————————————————————\033[0m" + # ------------------------------------------------- + + sleep 2 + # INICIAR INSTALACIÓN + instalador_final + + elif [[ "$respuesta" == "clave_expirada" ]]; then + echo -e "\n\033[1;93m ⚠️ LA KEY HA EXPIRADO.\033[0m" + sleep 5 + exit 1 + else + #echo -e "\n\033[1;91m ❌ KEY INVALIDA O NO EXISTE.\033[0m" + #sleep 5 + error_fun + #exit 1 + fi + +} +check_key