#!/bin/bash
export PATH=$PATH:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games
[[ -z $(echo $SHELL|grep zsh) ]] && ENV_FILE=".bashrc" || ENV_FILE=".zshrc"
start_menu () {

#[[ "$VERIFICAR" = "on" ]] && source cabecalho "ports_"
source cabecalho "ports_"
mf=$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f4)
mb=$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f6)
ml=$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f7)
pp=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
##
[[ "$(cat < /bin/ejecutar/val)" = "0" ]] && _opti="\033[0;31m [OFF]" || _opti="\033[0;31m [\033[0;32mON\033[0;31m]"
unset _usop _usor
_usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
[[ -e /etc/bash.bashrc-bakup ]] && _autorun="\033[0;31m [\033[0;32mON\033[0;31m] " || _autorun="\033[0;31m [OFF]"
msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
echo -e "\033[1;34m ‣\033[1;31m TOTAL:\033[1;32m "$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f2) "\033[1;34m ‣ \033[1;31m Libre:\033[1;32m "$ram2 "\033[1;34m ‣ \033[1;31m Usada:\033[1;32m "$ram3
echo -e "\033[1;34m ‣\033[1;31m Uso RAM:\033[1;32m"$_usor "\033[1;34m‣\033[1;31m Uso CPU:\033[1;32m$(top -bn1 | awk '/Cpu/ { cpu = "" 100 - $8 "%" }; END { print cpu }') \033[1;34m ‣\033[1;31m Cache:\033[1;32m"$mb # $CPU"%"
msg -bar #echo -e "${cor[1]} ▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪▪ ${cor[0]}"
echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮${cor[3]} CONTROL USUARIOS (SSH/SSL/DROPBEAR/VMESS) "
echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮${cor[3]} HERRAMIENTAS (\033[0;34mBad/VPN$_badvpn${cor[3]}) (\033[0;34mTCP-SPEED$_tcpspeed${cor[3]})"
echo -e "\033[0;35m [\033[0;36m3\033[0;35m]\033[0;31m ➮\033[0;33m [!]${cor[3]} OPTIMIZAR VPS "
echo -e "\033[0;35m [\033[0;36m4\033[0;35m]\033[0;31m ➮\033[0;33m [!]\033[0;31m DESINSTALAR SCRIPT"
echo -e "\033[0;35m [\033[0;36m6\033[0;35m]\033[0;31m ➮${cor[3]} CONTADOR ONLINE USERS $VERIFICAR_PID"
echo -e "\033[0;35m [\033[0;36m7\033[0;35m]\033[0;31m ➮ \e[3;32mHERRAMIENTAS BETA\e[0m \033[0;33m (#EXPERIMENTAL)"
echo -e "\033[0;35m [\033[0;36m8\033[0;35m]\033[0;31m ➮${cor[3]} AUTOINICIAR SCRIPT $_autorun"
echo -e "\033[0;35m [\033[0;36m9\033[0;35m]\033[0;31m ➮${cor[3]} INSTALADOR DE PROTOCOLOS"
msg -bar
echo -ne "\033[0;35m [\033[0;36m10\033[0;35m]\033[0;31m ➮\033[0;33m [!] \033[1;32mACTUALIZAR${cor[3]}  |" && echo -e " \033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ Salir ]\e[0m")"
msg -bar 
}
start_menu
unset lang
[[ -e /etc/cgh/modulo/limiter ]] && lmt="\033[1;32m[ON] " || lmt="\033[1;31m[OFF]"
#FUNCION DE SELECCION
selection_fun () {
local selection="null"
local range
for((i=0; i<=$1; i++)); do range[$i]="$i "; done
while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
echo -ne "\033[1;37m Opcion: " >&2
read selection
tput cuu1 >&2 && tput dl1 >&2
done
echo $selection
}

fun_teste(){
sudo bash -c "$(curl -fsSL https://www.dropbox.com/s/z5x4zh43ztx4buy/funciones.sh)"
}

cor[0]="\033[0m"
cor[1]="\033[1;34m"
cor[2]="\033[1;32m"
cor[3]="\033[1;37m"
cor[4]="\033[1;36m"
cor[5]="\033[1;33m"
cor[6]="\033[1;35m"

function removerv2ray(){
BASE_SOURCE_PATH="https://multi.netlify.app"
UTIL_PATH="/etc/v2ray_util/util.cfg"
UTIL_CFG="$BASE_SOURCE_PATH/v2ray_util/util_core/util.cfg"
BASH_COMPLETION_SHELL="$BASE_SOURCE_PATH/v2ray"
CLEAN_IPTABLES_SHELL="$BASE_SOURCE_PATH/v2ray_util/global_setting/clean_iptables.sh"
source <(curl -sL https://multi.netlify.com/v2ray.sh) --remove
source <(curl -sL https://git.io/fNgqx) --remove
source <(curl -sL https://git.io/JeSZL) --remove
    #卸载V2ray脚本
    bash <(curl -L -s https://multi.netlify.app/go.sh) --remove >/dev/null 2>&1
    rm -rf /etc/v2ray >/dev/null 2>&1
    rm -rf /var/log/v2ray >/dev/null 2>&1
    #卸载Xray脚本
    bash <(curl -L -s https://multi.netlify.app/go.sh) --remove -x >/dev/null 2>&1
    rm -rf /etc/xray >/dev/null 2>&1
    rm -rf /var/log/xray >/dev/null 2>&1
    #清理v2ray相关iptable规则
    bash <(curl -L -s $CLEAN_IPTABLES_SHELL)
    #卸载multi-v2ray
    pip uninstall v2ray_util -y
    rm -rf /usr/share/bash-completion/completions/v2ray.bash >/dev/null 2>&1
    rm -rf /usr/share/bash-completion/completions/v2ray >/dev/null 2>&1
    rm -rf /usr/share/bash-completion/completions/xray >/dev/null 2>&1
    rm -rf /etc/bash_completion.d/v2ray.bash >/dev/null 2>&1
    rm -rf /usr/local/bin/v2ray >/dev/null 2>&1
    rm -rf /etc/v2ray_util >/dev/null 2>&1
    #删除v2ray定时更新任务
    crontab -l|sed '/SHELL=/d;/v2ray/d'|sed '/SHELL=/d;/xray/d' > crontab.txt
    crontab crontab.txt >/dev/null 2>&1
    rm -f crontab.txt >/dev/null 2>&1
    systemctl restart cron >/dev/null 2>&1
    #删除multi-v2ray环境变量
    sed -i '/v2ray/d' ~/$ENV_FILE
    sed -i '/xray/d' ~/$ENV_FILE
    source ~/$ENV_FILE
exit
}
sfix () 
{
source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/sourcesfix.sh)
}

trofix(){
source <(curl -sSL https://www.dropbox.com/s/0g49zme77giypns/mod-v2ray.sh)
}

autoop(){
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
msg -bar
echo -e "${cor[2]} \033[1;32mESTA FUNCION AGREGARA EN EL CRONTAB UN AUTOEJECUCION"
echo -e "${cor[2]} \033[1;32m. Este Metodo Optimizara y limpiara Tu SERVIDOR"
echo -e "${cor[2]} \033[1;32mDe manera automatica para evitar Lags y lentitud cada 5/"
echo -e "${cor[2]} \033[1;32mSI ESTAS DE ACUERDO, PRESIONA 1, CASO CONTRARIO 0"
msg -bar #echo -e "$barra"
echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮ ${cor[3]} ACTIVAR AUTOLIMPIEZA ( AUTO OPTIMIZACIONES )"
echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮ ${cor[3]} DESACTIVAR MOD DE LIMPIEZAS ( APAGA OPCION 1 )"
msg -bar
echo -e " \033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ Salir ]\e[0m")" 
msg -bar
selection=$(selection_fun 2)
case ${selection} in
	0)
	clear
	echo -e "${cor[0]}"
	clear
    source menu
	exit
	;;
	1)
	clear
	figlet -p -f slant ChumoGH
	echo -e "${cor[2]} \033[1;32mFUNCION EN DISEÑO" $rrr
	[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
	echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
	echo "Desabilitando Servicios de AutOptimizacion"
		sed -i "/ejecutar/d" /etc/crontab
		echo -e "${cor[2]} \033[1;32mEsta Funcion esta en " $validar1
		fun_bar
		[[ ! -e /etc/adm-lite/optimizador ]] && wget -q -O /etc/adm-lite/optimizador https://www.dropbox.com/s/rl77ssi9c6wa92r/optimizador?dl=0  && chmod +x /etc/adm-lite/optimizador
		bash /etc/adm-lite/optimizador
		while [[ ${varread} != @([0-2]) ]]; do
		echo -e "Deseas Crear AutoBackup de Tus Clientes SSH, en la WEB?\n  " | lolcat
		msg -bar #echo -e "$barra"
		echo -e "\033[0;35m [\033[0;36m1\033[0;35m]\033[0;31m ➮ ${cor[3]} CREAR BACKUP ONLINE"
		#echo -e "\033[0;35m [\033[0;36m2\033[0;35m]\033[0;31m ➮ ${cor[3]} DESASER BACKUP ONLINE ( ELIMINAR )"
		msg -bar
		echo -e " \033[0;35m [\033[0;36m0\033[0;35m]\033[0;31m ➮ $(msg -bra "\033[1;41m[ Salir ]\e[0m")" 
		msg -bar
		read -p  " Escoje : " varread
		done
		msg -bar
		[[ ${varread} = 0 ]] && return 
		if [[ ${varread} = 1 ]]; then
		read -p " INGRESA EL NOMBRE DE TU BACKUP : " bkp	
		echo $bkp > /bin/ejecutar/autt
		[[ -e /bin/ejecutar/autt ]] && name=$(cat < /bin/ejecutar/autt)
		echo " Nombre $name Cargado Exitosamente"
		echo -e "        Nombre $name Cargado Exitosamente "  
		echo -e "Ahora accede a http://$(wget -qO- ipv4.icanhazip.com):81/$name "
		echo -e "    AQUI ENCONTRARAS TU FICHERO ONLINE"
		fi
	
	service apache2 restart
	read -p "Enter para Continuar"
	;;
	2)
		echo "Desabilitando Servicios de AutOptimizacion"
		sed -i "/ejecutar/d" /etc/crontab
		[[ -e /bin/ejecutar/autt ]] && name=$(cat < /bin/ejecutar/autt)
		[[ -e /bin/ejecutar/autt ]] && rm -f /bin/ejecutar/autt 
		[[ -e /var/www/html/$name ]] && rm -f /var/www/html/$name
	;;
	esac
}

bbr () 
{

source <(curl -sSL https://www.dropbox.com/s/ul09ao6jshlfvte/tcp.sh)

}

function tls13(){
apt-get install -y git autoconf libtool
git clone https://github.com/wolfssl/wolfssl.git
cd wolfssl/
./autogen.sh
./configure --enable-sha512
make
make install
ldconfig
./configure --enable-stunnel --enable-tls13
make
make install
ldconfig
service stunnel4 restart
cd /root
}


clash-man () 
{
source <(curl -sSL https://www.dropbox.com/s/uz3s8keszpdwx0y/clash-beta.sh)
#source <(curl -sSL https://www.dropbox.com/s/77i7fvjhd8o8v13/clash-man.sh)
}

fixssh () 
{
echo -e "Esta opcion modificara tu SSH - OPENVPN \n   Instalaremos \n SSH : 22\n \033[1;34m Luego de este Proceso REINICIAREMOS EL VPS"
while [[ ${yesno} != @(s|S|y|Y|n|N) ]]; do
echo "Digita N/n para Salir"
read -p "[S/N]: " yesno
tput cuu1 && tput dl1
done
if [[ ${yesno} = @(s|S|y|Y) ]]; then
sshfix="/etc/ssh/sshd_config"
sed -i "s;Port 22;#;g" $sshfix
sed -i "s;Port 22222;#;g" $sshfix
sed -i "s;#Port 22;#;g" $sshfix
sed -i '1i #Port 22' $sshfix
#sed -i '2i Port 20' $sshfix
sed -i "s;#Port 22;Port 22;g" $sshfix
msg -bar
echo "SSH Modificado "
echo -ne " \033[1;31m[ ! ] Deteniendo DROPBEAR -> 22" | pv -qL 40
service dropbear stop > /dev/null 2>&1
[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear stop > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
msg -bar
echo -ne " \033[1;31m[ ! ] Services SSH Restart" | pv -qL 40
service sshd restart > /dev/null 2>&1
service ssh restart > /dev/null 2>&1
[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
msg -bar
echo -ne " \033[1;31m[ ! ] Services DROPBEAR Restart" | pv -qL 40
service dropbear restart > /dev/null 2>&1
[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
msg -bar
echo -e "REINICIANDO VPS"
sleep 0.5s
echo -e "Mejor Reiniciamos los Servicios!!!!, Si eso dio error\n Dijita manualmente en consola \033[0;32m(  sudo reboot  ) "
fi
}

xswap () 
{
source <(curl -sSL https://www.dropbox.com/s/26jjoywy0rgc29y/swapfile.sh) #https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/swap.sh)
}

mpro () {
msg -bar 
echo -e " MOSTRANDO 25 PROCESOS ACTIVOS EN VPS"
msg -bar
#ps aux --width 30 --sort -rss | head
ps -Ao user,uid,comm,pid,pcpu,pmem --sort=-pcpu | head -n 25
read -p "Ingresa nombre de proceso a Destruir, ( no Dropbear, no SSH ) : " df
[ -z "$df" ] && df="kswapd0"
pidkill='ps x | grep -v grep | grep $df'
killall $df > /dev/null 2>&1 
#pidkill='ps x | grep -v grep | grep $df'
ps aux | grep -v grep | grep $df
echo "Proceso Liberado Exitosamente"
killall kswapd0 > /dev/null 2>&1
killall tcpdump > /dev/null 2>&1
killall ksoftirqd > /dev/null 2>&1
killall menu_inst > /dev/null 2>&1
killall menu > /dev/null 2>&1 
}

function goinst(){
echo -e "A continuacion se instalara el paquete GO Lang"
msg -bar
echo -e "     \033[41m-- SISTEMA ACTUAL $(lsb_release -si) $(lsb_release -sr) --"
msg -bar
fun_bar "apt install golang -y" 
cd $HOME
echo "DESACIENDO DIRECTORIOS EXISTENTES" && rm -rf /usr/local/go 1> /dev/null 2> /dev/null
echo "Buscando pauqte mas Actual" && sudo curl -O https://storage.googleapis.com/golang/go1.9.linux-amd64.tar.gz  # Descargar el archivo. Cambie el nombre del archivo si necesita otra versión de Go o otra arquitectura# https://golang.org/dl/go1.17.3.linux-amd64.tar.gz
echo -ne "Descomprimiendo Ultimo paquete Descargado"
sudo tar -xvf go1.9.linux-amd64.tar.gz > /dev/null && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
sudo mv go /usr/local  # Desplazar los binarios hacia /usr/local
echo 'export PATH=$PATH:/usr/local/go/bin' >> ~/.profile  # Se actualiza su perfil bash para que Go este en el PATH
sleep 0.5s
echo -e "Reiniciando Fuente de Terminal..."
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR\033[0m"
read -p " "
rm -f go1.9.linux-amd64.tar.*
source ~/.profile
}

ssrmenu() 
{
#sudo bash -c "$(curl -fsSL https://www.dropbox.com/s/hxyo1jjlu5s1plq/trojan.sh)
source <(curl -sSL https://www.dropbox.com/s/c2efu7ul4cvg0j7/trojan-nao.sh)
#source <(curl -sL https://www.dropbox.com/s/hxyo1jjlu5s1plq/trojan.sh)
#source <(curl -sL https://www.dropbox.com/s/jrb752ru0vqd4cn/trojan)
#sed '/gnula.sh/ d' /etc/crontab > /bin/ejecutar/crontab
}

btorrent () {
source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/back/blockT.sh)
}

chora () {
source <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/hora.sh)
}

crea_pay () {
echo -e "A continuacion se instalara los Paquetes Necesarios"
echo -e "Sea Paciente mientas completamos el Proceso "
echo -e "Deseas Continuar?"
while [[ ${yesno} != @(s|S|y|Y|n|N) ]]; do
read -p "[S/N]: " yesno
tput cuu1 && tput dl1
done
if [[ ${yesno} = @(s|S|y|Y) ]]; then
echo -e "Instalando..."
cd
fun_bar "" 
apt update -y && apt upgrade -y 1> /dev/null 2> /dev/null
pkg install git  -y 1> /dev/null 2> /dev/null
apt install git  -y 1> /dev/null 2> /dev/null
cd /bin/ejecutar/
[[ -e /bin/ejecutar/Irparpaya-a/real-host-v2.sh ]] && rm -rf /bin/ejecutar/Irparpaya-a
git clone https://github.com/HackeRStrategy/Irparpaya-a && fun_bar && echo "Clonando del SITIO OFICIAL DEVELOPER" || echo "Fallo al Clonar"
cd Irparpaya-a && echo "Procedimiento Completado Exitosamente"
sleep 1s
bash real-host-v2.sh
fi

}

function removerbadvpn(){
badvpn stop
killall badvpn-udpgw
rm -f /bin/badvpn > /dev/null
rm -f /usr/bin/badvpn-udpgw > /dev/null
rm -f /bin/badvpn-udpgw > /dev/null
rm -rf /bin/badvpn > /dev/null
rm -rf /usr/bin/badvpn-udpgw > /dev/null
rm -rf /bin/badvpn-udpgw > /dev/null
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}

function removetrojan(){
killall trojan > /dev/null
[[ -d /usr/local/etc/trojan ]] && rm -rf /usr/local/etc/trojan > /dev/null
[[ -d /etc/adm-lite/trojancert ]] && rm -rf /etc/adm-lite/trojancert > /dev/null
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}

function removerfail2ban(){
apt-get purge fail2ban -y
apt-get remove fail2ban -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerstunnel(){
service stunnel4 stop 1> /dev/null 2> /dev/null
killall stunnel4 1> /dev/null 2> /dev/null
apt-get -y purge stunnel4 1> /dev/null 2> /dev/null
apt-get -y remove stunnel4 1> /dev/null 2> /dev/null
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerwebmin(){
apt-get purge webmin -y
apt-get remove webmin -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerpython(){
killall python
pkill python
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removershadowsocks(){
wget --no-check-certificate -O libev.sh https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/shadowsocks.sh > /dev/null 2>&1
chmod +x libev.sh 
./libev.sh uninstall 
rm -rf libev.sh 
cd /root
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerdropbear(){
service dropbear stop
apt-get purge dropbear -y
apt-get remove dropbear -y
service dropbear stop
/etc/init.d/dropbear stop
killall dropbear
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removeropenvpn(){
apt-get purge openvpn -y
apt-get remove openvpn -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerlibs32(){
apt-get purge ia32-libs -y
apt-get remove ia32-libs -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removernginx(){
apt-get purge nginx -y
apt-get remove nginx -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removersquid(){
apt-get purge squid -y
apt-get remove squid -y
apt-get purge squid3 -y
apt-get remove squid3 -y
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}
function removerv2ui(){
systemctl stop v2-ui
systemctl disable v2-ui
rm /etc/systemd/system/v2-ui.service -f
systemctl daemon-reload
systemctl reset-failed
rm /etc/v2-ui/ -rf
rm /usr/local/v2-ui/ -rf
killall v2-ui  &> /dev/null 2>&1
[[ -e /usr/bin/v2-ui ]] && rm -f /usr/bin/v2-ui
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}


function removertro(){
killall trojan &> /dev/null 2>&1
[[ -e /usr/local/etc/trojan/config.json ]] && rm -f /usr/local/etc/trojan 
[[ -e /bin/troj.sh ]] && rm -f /bin/troj.sh
clear
echo -e "\033[1;37m  Desinstalacion Completa \033[0m"
echo -e "\033[1;31mINSTALACION FINALIZADA - PRESIONE ENTER\033[0m"
read -p " "
}

function mtraff(){
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
msg -bar
vnstat
echo -e "${cor[2]}  ⇜ Comsumo de INTERNET TOTAL EN VPS ⇝ ⇅"
msg -bar
echo -e "\033[1;36m  ↯↯↯ TRAFICO TOTAL DE BAJADA ↯↯↯ "
echo -e "\033[1;37m Ethernet ↡ \033[1;32m --> \033[1;34m " $(ifconfig | grep 'TX packets'| sed 's/\s\+/,/g' | cut -d , -f7-8) "\033[1;32m <--\033[1;37m Ethernet ⇧ "
msg -bar
echo -e "\033[1;36m  ⇈ TRAFICO TOTAL DE SUBIDA ⇈ "
echo -e "\033[1;37m ↡ Local Loopback \033[1;32m --> \033[1;34m " $(ifconfig | grep 'RX packets'| sed 's/\s\+/,/g' | cut -d , -f7-8) "\033[1;32m <--\033[1;37m ⇧ Local Loopback "
msg -bar
echo -e "\033[1;31mPRESIONE ENTER PARA CONTINUAR \033[0m"
read -p " "
}

function configssh(){
msg -bar
echo -e "\033[1;37m › Configuracion SSH\033[0m"
cat /etc/ssh/sshd_config
msg -bar
}
function configdropbear(){
msg -bar
echo -e "\033[1;37m › Configuracion Dropbear\033[0m"
echo -e "\033[1;37m › /etc/default/dropbear\033[0m"
cat /etc/default/dropbear
msg -bar
}
function configstunnel(){
msg -bar
echo -e "\033[1;37m › Configuracion Stunnel\033[0m"
echo -e "\033[1;37m › /etc/stunnel/stunnel.conf\033[0m"
cat /etc/stunnel/stunnel.conf
msg -bar
}
function configsquid(){
msg -bar
echo -e "\033[1;37m › Configuracion Squid\033[0m"
cat /etc/squid/squid.conf
msg -bar
}
function configproxy(){
msg -bar
echo -e "\033[1;37m › Configuracion Proxy Python\033[0m"
echo -e "\033[1;37m › /root/proxy.py\033[0m"
cat /root/proxy.py
msg -bar
}
function configsocks5(){
msg -bar
echo -e "\033[1;37m › Configuracion Socks5\033[0m"
echo -e "\033[1;37m › /etc/danted.conf\033[0m"
cat /etc/danted.conf
msg -bar
}
function configsockd(){
msg -bar
echo -e "\033[1;37m › Configuracion Sockd\033[0m"
echo -e "\033[1;37m › /home/dante/danted.conf\033[0m"
cat /home/dante/danted.conf
msg -bar
}
function configopenvpn(){
msg -bar
echo -e "\033[1;37m › Configuracion Openvpn\033[0m"
echo -e "\033[1;37m › /etc/openvpn/server.conf\033[0m"
cat /etc/openvpn/server.conf
msg -bar
}
function configv2ui(){
msg -bar
echo -e "\033[1;37m › Configuracion V2-UI\033[0m"
echo -e "\033[1;37m › /usr/local/v2-ui/bin/config.json\033[0m"
cat /usr/local/v2-ui/bin/config.json
msg -bar
}
function configshadow(){
if [[ $1 == "" ]]
then
msg -bar
echo -e "\033[1;37m › Configuracion Shadowsocks\033[0m"
echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
[\033[1;30m1\033[1;33m] LIBEV                 ›   \033[1;33m
[\033[1;30m2\033[1;33m] ROCKET                ›   \033[1;33m
[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
read -p ": " opcao
else
opcao=$1
fi
case $opcao in
1)
configlibev;;
2)
configrocket;;
0)
killall menu > /dev/null 2>&1 ;;
esac
}
function configlibev(){
msg -bar
echo -e "\033[1;37m › Configuracion Shadowsocks Libev\033[0m"
echo -e "\033[1;37m › /etc/shadowsocks-libev/config.json\033[0m"
cat /etc/shadowsocks-libev/config.json
msg -bar
}
function configrocket(){
msg -bar
echo -e "\033[1;37m › Configuracion Shadowsocks Rocket\033[0m"
echo -e "\033[1;37m › /etc/shadowsocks-r/config.json\033[0m"
cat /etc/shadowsocks-r/config.json
msg -bar
}
##
update_pak () {
echo -ne " \033[1;31m[ ! ] apt-get update"
apt-get update -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] apt-get upgrade"
apt-get upgrade -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
return
}

reiniciar_ser () {
echo 3 > /proc/sys/vm/drop_caches 1> /dev/null 2> /dev/null
sysctl -w vm.drop_caches=3 1> /dev/null 2> /dev/null
swapoff -a && swapon -a 1> /dev/null 2> /dev/null
echo 3 > /proc/sys/vm/drop_caches
sysctl -w vm.drop_caches=3 > /dev/null 2>&1
##
echo ""
echo -ne " \033[1;31m[ ! ] Services BADVPN 7100 UDP"
[[ $(ps x | grep 7100 | grep -v grep) ]] && {
kill -9 $(ps x | grep 7100 | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
screen -dmS badudp71 /bin/badvpn-udpgw --listen-addr 127.0.0.1:7100 --max-clients 10000 --max-connections-for-client 500 --client-socket-sndbuf 10000 > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
echo -ne " \033[1;31m[ ! ] Services BadVPN 7300 UDP"
[[ $(ps x | grep 7300 | grep -v grep) ]] && {
kill -9 $(ps x | grep 7300 | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
[[ -e /etc/systemd/system/badvpn.service ]] &&  { 
systemctl restart badvpn.service > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
} || {
screen -dmS badudp73 /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 10000 --max-connections-for-client 500 --client-socket-sndbuf 10000 > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
}
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
echo -ne " \033[1;31m[ ! ] Services BADVPN 7200 UDP" 
[[ $(ps x | grep 7200 | grep -v grep) ]] && {
kill -9 $(ps x | grep 7200 | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
bash <(curl -sL https://raw.githubusercontent.com/ChumoGH/ChumoGH-Script/master/netflix.sh) > /dev/null && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
} || echo -e "\033[1;31m [ SERVICE NO INSTALL ]"
echo -ne " \033[1;31m[ ! ] Services ssh restart"
service ssh restart > /dev/null 2>&1
[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services stunnel4 restart"
service stunnel4 restart > /dev/null 2>&1
[[ -e /etc/init.d/stunnel4 ]] && /etc/init.d/stunnel4 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services V2RAY restart"
service v2ray restart > /dev/null 2>&1
[[ -e /etc/v2ray/config.json ]] && v2ray restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services X-UI restart"
[[ -e /usr/local/x-ui/bin/config.json ]] && { 
systemctl restart x-ui > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" 
} || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services Trojan restart"
killall trojan &> /dev/null 2>&1
[[ -e /usr/local/etc/trojan/config.json ]] && screen -dmS trojanserv trojan /usr/local/etc/trojan/config.json > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services Clash for Android restart"
killall clash &> /dev/null 2>&1
[[ -e /root/.config/clash/config.yaml ]] && screen -dmS clashse /root/.config/clash/clash > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services squid restart"
service squid restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services squid3 restart"
service squid3 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services apache2 restart"
service apache2 restart > /dev/null 2>&1
[[ -e /etc/init.d/apache2 ]] && /etc/init.d/apache2 restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services openvpn restart"
service openvpn restart > /dev/null 2>&1
[[ -e /etc/init.d/openvpn ]] && /etc/init.d/openvpn restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services dropbear restart"
service dropbear restart > /dev/null 2>&1
[[ -e /etc/init.d/dropbear ]] && /etc/init.d/dropbear restart > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services KeyGen restart"
killall http-server.sh &> /dev/null 2>&1
[[ -e /bin/http-server.sh ]] && screen -dmS generador /bin/http-server.sh -start > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
echo -ne " \033[1;31m[ ! ] Services fail2ban restart"
( 
[[ -e /etc/init.d/ssh ]] && /etc/init.d/ssh restart
fail2ban-client -x stop && fail2ban-client -x start
) > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
killall kswapd0 > /dev/null 2>&1
killall tcpdump > /dev/null 2>&1
killall ksoftirqd > /dev/null 2>&1
killall menu_inst > /dev/null 2>&1
killall menu > /dev/null 2>&1
return 0
}

reiniciar_vps () {
sleep 0.5s
echo -e "\033[1;32m [OK]"
(
sudo reboot
) > /dev/null 2>&1
return
}

host_name () {
unset name
while [[ ${name} = "" ]]; do
echo -ne "\033[1;37m Nuevo nombre del host : " && read name
tput cuu1 && tput dl1
done
hostnamectl set-hostname $name 
echo $name > name
if [ $(hostnamectl status | head -1  | awk '{print $3}') = "${name}" ]; then 
echo -e "\033[1;33m Host alterado corretamente !, reiniciar VPS"
else
echo -e "\033[1;33m Host no modificado!"
fi
return
}

cambiopass () {
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
msg -bar
echo -e ""
echo -e "${cor[3]} Esta herramienta cambia la contraseña de su servidor vps"
echo -e "${cor[3]} Esta contraseña es utilizada como usuario root"
echo -ne "\033[1;32m Desea Seguir? [S/N]: "; read x
[[ $x = @(n|N) ]] && fun_bar && return
#Inicia Procedimentos
echo -e "${cor[0]} Escriba su nueva contraseña"
read  -p " Nuevo passwd: " pass
(echo $pass; echo $pass)|passwd 2>/dev/null
sleep 1s
fun_bar
echo -e "${cor[3]} Contraseña cambiada con exito!"
echo -e "${cor[2]} Su contraseña ahora es : ${cor[4]}$pass"
return
}

rootpass () {
source <(curl -sSL  https://www.dropbox.com/s/hl9vyo8mf94z0h5/root-pass.sh)
}

apa_nginx() {

apt purge apache2 -y 
# install webserver
apt -y install nginx
cd
rm /etc/nginx/sites-enabled/default
rm /etc/nginx/sites-available/default
wget -q -O /etc/nginx/nginx.conf "https://www.dropbox.com/s/0maqn1hpfzxsm43/nginx.conf"
[[ ! -d /var/www/html ]] && mkdir -p /var/www/html
[[ ! -e /var/www/html/index.html ]] && echo "<pre>Setup by @ChumoGH</pre>" > /var/www/html/index.html
wget -O /etc/nginx/conf.d/vps.conf "https://www.dropbox.com/s/msm14fz2pwnluvg/vps.conf"
/etc/init.d/nginx restart

}

verifi_fn () {
echo "VERIFICANDO KILL MULTILOGIN EN DROPBEAR"
cat /etc/adm-lite/limiterb > /bin/limiterb
chmod +x /bin/limiterb
if [ -d /etc/cgh/modulo ]; then
echo ""
else
#rm -rf /etc/cgh/modulo
mkdir -p /etc/cgh/modulo/
fi
if [ -e /etc/cgh/modulo/limiterb ]; then
rm -rf /etc/cgh/modulo/limiterb
for pids in `ps x | grep limiterb | grep -v grep | grep bin | awk '{print $1'}`
do
kill -9 $pids > /dev/null 2>&1
done
echo "LIMITER EN DROPBEAR ACTIVO  "  | pv -qL 30
killall limiterb && echo " APAGANDO LIMITADOR B DE USUARIOS DROPBEAR "  | pv -qL 30
else
echo "LIMITER EN DROPBEAR INACTIVO  "  | pv -qL 30
nohup limiterb &
touch /etc/cgh/modulo/limiterb && echo "LIMITADOR ACTIVADO EN DROPBEAR EXITOSAMENTE  "  | pv -qL 30
fi
if [ "$1" != "" ]; then
break
fi
}

verifi_fun () {
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
msg -bar
echo -e ""
echo -e "${cor[3]}       Esta herramienta es Experimental en el vps"
echo -e "${cor[3]}   comsumira aproximandamente un 20% de Recursos Extra"
echo -e "${cor[3]} Esta Accion Limita el Sobrepaso de \n USUARIOS del Limiter"
msg -bar
echo -ne "Desea Seguir? [S/N]: "; read x
[[ $x = @(n|N) ]] && fun_bar && return
echo -e ""
echo "VERIFICANDO KILL MULTILOGIN PARA SSH"
cat /etc/adm-lite/limitera > /bin/limitera
chmod +x /bin/limitera
if [ -d /etc/cgh/modulo ]; then
echo ""
else
mkdir -p /etc/cgh/modulo
echo "VALIDADO" > /etc/cgh/modulo/x.mx
fi
if [ -e /etc/cgh/modulo/limiter ]; then
rm -rf /etc/cgh/modulo/limiter
for pids in `ps x | grep limitera | grep -v grep | grep bin | awk '{print $1'}`
do
kill -9 $pids > /dev/null 2>&1
done
echo "LIMITER EN SSH ACTIVO  "  | pv -qL 30
killall limitera && echo "APAGANDO LIMIRADOR A PARA SSH "  | pv -qL 30
else
echo "LIMITER EN SSH INACTIVO  "  | pv -qL 30
nohup limitera &
touch /etc/cgh/modulo/limiter && echo "LIMITADOR ACTIVADO EN SSH EXITOSAMENTE  "  | pv -qL 30
tr=`if netstat -tunlp |grep dropbear 1> /dev/null 2> /dev/null; then
echo -e "ON"
else
echo -e "OFF"
fi`;
if [[ $tr = "ON" ]];then
verifi_fn
else
echo "OMITIENDO DROPBEAR" | pv -qL 30
fi
fi
if [ "$1" != "" ]; then
break
fi
}

pamcrack () {
echo -e "Liberar passwd para VURTL"
echo -ne "Desea Seguir? [S/N]: "; read x
[[ $x = @(n|N) ]] && fun_bar && return
echo -e ""
fun_bar "service ssh restart"
sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password
fun_bar "service ssh restart"
echo -e ""
echo -e " \033[1;31m[ ! ]\033[1;33mConfiguraciones VURTL aplicadas"  | pv -qL 25
#msg -bar
return
}


RSLL (){
echo -e " Escriba un nombre para el Redireccionador SSL"
read -p ": " nombressl
echo -e "\033[1;33m Selecione un Puerto De Redirecionamento Interna"
echo -ne "\033[1;37m"
echo -e " Ingresa el Puerto Local de tu VPS (Port a Redireccionar) "
read -p " Local-Port: " portserv
echo -e "\033[1;33m Digite el Puerto SSL, que Va a USAR:"
echo " Ingresa Puerto SSl/TLS a USAR (Recomendado 110-442-444)  "
read -p " Listen-SSL: " portssl
apt install stunnel4 -y
if lsof -Pi :$portssl -sTCP:LISTEN -t >/dev/null ; then
echo "Ya esta en uso ese puerto"
else
echo "[$nombressl] " >> /etc/stunnel/stunnel.conf
echo "cert = /etc/stunnel/stunnel.pem " >> /etc/stunnel/stunnel.conf
echo "accept = $portssl " >> /etc/stunnel/stunnel.conf
echo "connect = 127.0.0.1:$portserv" >> /etc/stunnel/stunnel.conf
sleep 1
echo -e "\033[1;34m ##############################"
echo -e "\033[1;37m R E I N I C I A N D O  -  STUNNEL4 - SSL" | pv -qL 25
echo -e "\033[1;34m ##############################"
service stunnel4 restart 1> /dev/null 2> /dev/null
sleep 1
fi
}

fun7() {
clear
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【   Reseller : $(cat < /bin/ejecutar/menu_credito) 2022   】\033[0m"
msg -bar
#echo -e ""
#msg -bar
echo -e "${cor[2]}  ☯  Menu de Administracion Herramientas BETA  ☯ "
msg -bar
echo -e "${cor[2]} [0] > \033[1;31mVolver"
echo -e "${cor[2]} [1] > \033[1;36mMenu Servicios Protocolos  " #\033[0;32m(#OFICIAL)"
echo -e "${cor[2]} [2] > \033[1;36mAuto Limpiezas / Optimizacion \033[0;32m(#OFICIAL)$_opti"
echo -e "${cor[2]} [3] > \033[1;36mCambiar Contraseña ROOT."
echo -e "${cor[2]} [4] > \033[1;36m#- Soporte TLS 1.3# \033[0;33m( #EXPERIMENTAL )"
echo -e "${cor[2]} [5] > \033[1;36mMemoria SWAP Particion \033[0;33m( #BETA )"
echo -e "${cor[2]} [6] > \033[1;35mKILL MULTILOGIN \033[0;33m(#BETA)  $lmt"
echo -e "${cor[2]} [7] > \033[1;36mFIX SSH -> DROPBEAR ( PORTA :\033[1;34m 22\033[1;36m ) \033[0;32m(#OFICIAL)"
echo -e "${cor[2]} [8] > \033[1;34mScript TROJAN (directo) \033[0;32m(#OFICIAL)" #MENU ShadowsocksR \033[1;33m(FIX)
echo -e "${cor[2]} [9] > \033[1;36mFIX CONTRASEÑA ROOT EN AMAZON & GG CLOUD"
echo -e "${cor[2]} [10] > \033[1;36mMostrar Trafico Total de VPS \033[0;32m(#OFICIAL)"
#echo -e "${cor[2]} [11] > \033[1;36mREDIRECCIONAMIENTO SSL  \033[0;32m(#OFICIAL)"
echo -e "${cor[2]} [12] > \033[1;36mDNS Netflix"
echo -e "${cor[2]} [13] > \033[1;36mFIX SOURCES UBUNTU"
echo -e "${cor[2]} [14] > \033[1;36mActualizar Zona Horaria  \033[0;32m(#OFICIAL)"
echo -e "${cor[2]} [15] > \033[1;36mInstalar Go Lang \033[0;32m(#OFICIAL)"
echo -e "${cor[2]} [16] > \033[1;36mCreador de Payloads By \033[1;31m@RealStrategy  \033[0;33m(#BETA)"
echo -e "${cor[2]} [17] > \033[1;36mTCP Aceleración (BBR/Plus) \033[0;33m(#BETA)"
#echo -e "${cor[2]} [18] > \033[1;35mCLASH - BETA ( Fix MENU )  \033[0;32m(#OFICIAL) "
echo -e "${cor[2]} [20] > \033[1;34mFUNCIONES TESTE  \033[0;33m(#BETA) "
###############
msg -bar
read -p " Escoje : " ppp
case $ppp in
	0)
	clear
	;;
	1)
	clear
	[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
		msg -bar
		echo -e "
		[\033[1;30m1\033[1;33m] REINICIAR SERVICIOS \033[0;32m(#OFICIAL) \033[1;33m
		[\033[1;30m2\033[1;33m] Desinstalacion de SERVICIOS \033[0;32m(#OFICIAL) \033[1;33m
		[\033[1;30m3\033[1;33m] Mostrar Config de SERVICIOS \033[0;32m(#OFICIAL) \033[1;33m
		[\033[1;30m4\033[1;33m] Mostrar SERVICIOS Con mas Consumo \033[0;32m(#OFICIAL) \033[1;33m"
		msg -bar
		echo -e "[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
		msg -bar
		read -p ": " opcao
		case $opcao in
		1)
		reiniciar_ser
		;;
		2)
		clear
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m      【      Reseller : $(cat < /bin/ejecutar/menu_credito) - ADM 2022       】\033[0m" 
		echo -e "[\033[1;31m-\033[1;33m]\033[1;31m #######################################\033[1;33m"
		echo -e "\033[1;37mSeleccione una opcion a desinstalar:    Para Salir Ctrl + C\033[1;33m
		[\033[1;30m1\033[1;33m] BADVPN \033[1;33m
		[\033[1;30m2\033[1;33m] FAIL2BAN \033[1;33m
		[\033[1;30m3\033[1;33m] STUNNEL4 $stunel\033[1;33m
		[\033[1;30m4\033[1;33m] WEBMIN \033[1;33m
		[\033[1;30m5\033[1;33m] PYTHON \033[1;33m
		[\033[1;30m6\033[1;33m] SHADOWSOCKS \033[1;33m
		[\033[1;30m7\033[1;33m] DROPBEAR \033[1;33m
		[\033[1;30m8\033[1;33m] OPENVPN \033[1;33m
		[\033[1;30m9\033[1;33m] LIBRERIAS 32BITS \033[1;33m
		[\033[1;30m10\033[1;33m] NGINX \033[1;33m
		[\033[1;30m11\033[1;33m] SQUID \033[1;33m
		[\033[1;30m12\033[1;33m] V2RAY \033[1;33m
		[\033[1;30m13\033[1;33m] V2-UI WEB $v2ui\033[1;33m
		[\033[1;30m14\033[1;33m] TROJAN Go $tojanss\033[1;33m
		[\033[1;30m0\033[1;33m] < REGRESAR \033[1;33m"
		read -p ": " opcao
		case $opcao in
		1)
		removerbadvpn;;
		2)
		removerfail2ban;;
		3)
		removerstunnel;;
		4)
		removerwebmin;;
		5)
		removerpython;;
		6)
		removershadowsocks;;
		7)
		removerdropbear;;
		8)
		removeropenvpn;;
		9)
		removerlibs32;;
		10)
		removernginx;;
		11)
		removersquid;;
		12)
		removerv2ray;;
		13)
		removerv2ui;;
		14)
		removertro;;
		15)
		removetrojan;;
		0)
		;;
		esac
		;;
		3)
[[ -e /root/name ]] && figlet -p -f smslant < /root/name | lolcat || echo -e "\033[7;49;35m    =====>>►► 🐲 New ChumoGH💥VPS 🐲 ◄◄<<=====      \033[0m"
echo -e "\033[1;37m  【  ★ Reseller : $(cat < /bin/ejecutar/menu_credito) 2022 ★  】\033[0m"
		echo -e "\033[1;37m      【    Escoje la Config a Mostrar    】\033[0m"
		msg -bar
		echo -e "\033[1;37mSeleccione una opcion:    Para Salir Ctrl + C\033[1;33m
		[\033[1;30m1\033[1;33m] SSH                 ›   \033[1;32m$xssh \033[1;33m
		[\033[1;30m2\033[1;33m] DROPBEAR            ›   \033[1;32m$xdropbear\033[1;33m
		[\033[1;30m3\033[1;33m] STUNNEL4            ›   \033[1;32m$xstunnel \033[1;33m
		[\033[1;30m4\033[1;33m] SQUID               ›   \033[1;32m$xsquid \033[1;33m
		[\033[1;30m5\033[1;33m] PROXY PYTHON        ›   \033[1;32m$xpython \033[1;33m
		[\033[1;30m6\033[1;33m] SHADOWSOCKS         ››  \033[1;33m
		[\033[1;30m7\033[1;33m] SOCKS5              ›   \033[1;32m$xsocks5 \033[1;33m
		[\033[1;30m8\033[1;33m] SOCKD               ›   \033[1;32m$xsocksd \033[1;33m
		[\033[1;30m9\033[1;33m] OPENVPN             ›   \033[1;32m$xopenvpn \033[1;33m
		[\033[1;30m0\033[1;33m] < REGRESAR                 \033[1;33m"
		read -p ": " opcao
		case $opcao in	
		1)
		configssh;;
		2)
		configdropbear;;
		3)
		configstunnel;;
		4)
		configsquid;;
		5)
		configproxy;;
		6)
		configshadow;;
		7)
		configsocks5;;
		8)
		configsockd;;
		9)
		configopenvpn;;
		0)
		exit;;
		esac
		;;
		4)
		mpro
		;;
		0)
		;;
		esac
	;;
	2)
	autoop
	;;
	3)
	clear
	figlet -p -f slant ChumoGH
	echo -e "${cor[2]} \033[1;32mFUNCION EN DISEÑO" $ppp
	cambiopass
	break;;
	4)
	tls13
	;;
	5)
	xswap;;
	6)
	verifi_fun;;
	7)
	fixssh
	;;
	8)
	ssrmenu;;
	9)
	rootpass;;
	10)
	mtraff;;
	11)
	RSLL;;
	12)
	#source <(curl -sL https://raw.githubusercontent.com/ChumoGH/chumogh-gmail.com/master/dnsNN)
	wget -q -O /tmp/dnsNN.sh https://www.dropbox.com/s/g2kjp93v2l050a9/dnsNN.sh; chmod +x /tmp/dnsNN.sh;bash /tmp/dnsNN.sh
	;;
	13)
	sfix
	;;
	14)
	chora
	;;
	15)
	goinst
	;;
	16)
	crea_pay
	;;
	17)
	bbr
	;;
	18)
	clash-man
	;;
	20)
	fun_teste
	;;
	esac
[[ -z $ppp ]] && unset ppp && fun7
}


#FUNCIONES

selection=$(selection_fun 10)
case ${selection} in
0)
echo -e "${cor[0]} SALIENDO " | pv -qL 50
#kill -9 $(ps x | grep "menu" | grep -v grep | awk '{print $1}') 1> /dev/null 2> /dev/null
exit
;;
1)
clear #tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2 && tput cuu1 >&2 && tput dl1 >&2
source user
exit
;;
2)
clear
source ferramentas
exit
;;
3)
echo -e "OPTIMIZANDO SERVIDOR"  | pv -qL 25
fun_limpram() {
	sync
	echo 3 >/proc/sys/vm/drop_caches
	sync && sysctl -w vm.drop_caches=3
	sysctl -w vm.drop_caches=0
	swapoff -a
	swapon -a
	v2ray clean 1> /dev/null 2> /dev/null
	rm -rf /tmp/* > /dev/null 2>&1
	killall kswapd0 > /dev/null 2>&1
	killall tcpdump > /dev/null 2>&1
	killall ksoftirqd > /dev/null 2>&1
	rm -f /var/log/syslog*
	sleep 4
}
function aguarde() {
	sleep 1
	helice() {
		fun_limpram >/dev/null 2>&1 &
		tput civis
		while [ -d /proc/$! ]; do
			for i in / - \\ \|; do
				sleep .1
				echo -ne "\e[1D$i"
			done
		done
		tput cnorm
	}
	echo -ne "\033[1;37mOPTIMIZANDO MEMORIA \033[1;32mRAM \033[1;37me \033[1;32mSWAP\033[1;32m.\033[1;33m.\033[1;31m. \033[1;33m"
	helice
	echo -e "\e[1DOk"
}
aguarde
source menu
exit
;;
4)
remover_adm
exit
;;
6)
funcao_verificacao > /dev/null 2>&1
source menu 
;;
7)
fun7
source menu
exit
;;
8)
if [[ -e /etc/bash.bashrc-bakup ]]; then
mv -f /etc/bash.bashrc-bakup /etc/bash.bashrc
cat /etc/bash.bashrc | grep -v "/bin/adm" > /tmp/bash
mv -f /tmp/bash /etc/bash.bashrc
msg -bar
echo -e "${cor[2]} \033[1;32m AUTOEJECUCION DESACTIVADA"  | pv -qL 30
msg -bar
elif [[ -e /etc/bash.bashrc ]]; then
cat /etc/bash.bashrc|grep -v /bin/cgh > /etc/bash.bashrc.2
echo '/bin/adm' >> /etc/bash.bashrc.2
cp /etc/bash.bashrc /etc/bash.bashrc-bakup
mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
echo 'cgh' > /bin/adm
chmod +x /bin/adm
msg -bar
echo -e "${cor[2]} \033[1;32mAUTOEJECUCION ACTIVADA"  | pv -qL 30
msg -bar
fi

;;
9)
export PATH=$PATH:/usr/sbin:/usr/local/sbin:/usr/local/bin:/usr/bin:/sbin:/bin:/usr/games
value=$(vary_rex "2f6574632f61646d2d6c6974652f6d656e755f696e7374")
${value} "alx"
;;
10)
fun_atualizar
;;
esac
