1
0

v2ray.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500
  1. #!/bin/bash
  2. #25/01/2021 by @Kalix1
  3. clear
  4. clear
  5. SCPdir="/etc/VPS-MX"
  6. SCPfrm="${SCPdir}/herramientas" && [[ ! -d ${SCPfrm} ]] && exit
  7. SCPinst="${SCPdir}/protocolos"&& [[ ! -d ${SCPinst} ]] && exit
  8. declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
  9. err_fun () {
  10. case $1 in
  11. 1)msg -verm "$(fun_trans "Usuario Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  12. 2)msg -verm "$(fun_trans "Nombre muy corto (MIN: 2 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  13. 3)msg -verm "$(fun_trans "Nombre muy grande (MAX: 5 CARACTERES)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  14. 4)msg -verm "$(fun_trans "Contraseña Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  15. 5)msg -verm "$(fun_trans "Contraseña muy corta")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  16. 6)msg -verm "$(fun_trans "Contraseña muy grande")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  17. 7)msg -verm "$(fun_trans "Duracion Nula")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  18. 8)msg -verm "$(fun_trans "Duracion invalida utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  19. 9)msg -verm "$(fun_trans "Duracion maxima y de un año")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  20. 11)msg -verm "$(fun_trans "Limite Nulo")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  21. 12)msg -verm "$(fun_trans "Limite invalido utilize numeros")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  22. 13)msg -verm "$(fun_trans "Limite maximo de 999")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  23. 14)msg -verm "$(fun_trans "Usuario Ya Existe")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  24. 15)msg -verm "$(fun_trans "(Solo numeros) GB = Min: 1gb Max: 1000gb")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  25. 16)msg -verm "$(fun_trans "(Solo numeros)")"; sleep 2s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  26. 17)msg -verm "$(fun_trans "(Sin Informacion - Para Cancelar Digite CRTL + C)")"; sleep 4s; tput cuu1; tput dl1; tput cuu1; tput dl1;;
  27. esac
  28. }
  29. intallv2ray () {
  30. apt install python3-pip -y
  31. source <(curl -sL https://multi.netlify.app/v2ray.sh)
  32. msg -ama "$(fun_trans "Intalado con Exito")!"
  33. USRdatabase="/etc/VPS-MX/RegV2ray"
  34. [[ ! -e ${USRdatabase} ]] && touch ${USRdatabase}
  35. sort ${USRdatabase} | uniq > ${USRdatabase}tmp
  36. mv -f ${USRdatabase}tmp ${USRdatabase}
  37. msg -bar
  38. msg -ne "Enter Para Continuar" && read enter
  39. ${SCPinst}/v2ray.sh
  40. }
  41. protocolv2ray () {
  42. msg -ama "$(fun_trans "Escojer opcion 3 y poner el dominio de nuestra IP")!"
  43. msg -bar
  44. v2ray stream
  45. msg -bar
  46. msg -ne "Enter Para Continuar" && read enter
  47. ${SCPinst}/v2ray.sh
  48. }
  49. tls () {
  50. msg -ama "$(fun_trans "Activar o Desactivar TLS")!"
  51. msg -bar
  52. v2ray tls
  53. msg -bar
  54. msg -ne "Enter Para Continuar" && read enter
  55. ${SCPinst}/v2ray.sh
  56. }
  57. portv () {
  58. msg -ama "$(fun_trans "Cambiar Puerto v2ray")!"
  59. msg -bar
  60. v2ray port
  61. msg -bar
  62. msg -ne "Enter Para Continuar" && read enter
  63. ${SCPinst}/v2ray.sh
  64. }
  65. stats () {
  66. msg -ama "$(fun_trans "Estadisticas de Consumo")!"
  67. msg -bar
  68. v2ray stats
  69. msg -bar
  70. msg -ne "Enter Para Continuar" && read enter
  71. ${SCPinst}/v2ray.sh
  72. }
  73. unistallv2 () {
  74. source <(curl -sL https://multi.netlify.app/v2ray.sh) --remove > /dev/null 2>&1
  75. rm -rf /etc/VPS-MX/RegV2ray > /dev/null 2>&1
  76. echo -e "\033[1;92m V2RAY REMOVIDO OK "
  77. msg -bar
  78. msg -ne "Enter Para Continuar" && read enter
  79. ${SCPinst}/v2ray.sh
  80. }
  81. infocuenta () {
  82. v2ray info
  83. msg -bar
  84. msg -ne "Enter Para Continuar" && read enter
  85. ${SCPinst}/v2ray.sh
  86. }
  87. addusr () {
  88. clear
  89. clear
  90. msg -bar
  91. msg -tit
  92. msg -ama " AGREGAR USUARIO | UUID V2RAY"
  93. msg -bar
  94. ##DAIS
  95. valid=$(date '+%C%y-%m-%d' -d " +31 days")
  96. ##CORREO
  97. MAILITO=$(cat /dev/urandom | tr -dc '[:alnum:]' | head -c 10)
  98. ##ADDUSERV2RAY
  99. UUID=`uuidgen`
  100. sed -i '13i\ \{' /etc/v2ray/config.json
  101. sed -i '14i\ \"alterId": 0,' /etc/v2ray/config.json
  102. sed -i '15i\ \"id": "'$UUID'",' /etc/v2ray/config.json
  103. sed -i '16i\ \"email": "'$MAILITO'@gmail.com"' /etc/v2ray/config.json
  104. sed -i '17i\ \},' /etc/v2ray/config.json
  105. echo ""
  106. while true; do
  107. echo -ne "\e[91m >> Digita un Nombre: \033[1;92m"
  108. read -p ": " nick
  109. nick="$(echo $nick|sed -e 's/[^a-z0-9 -]//ig')"
  110. if [[ -z $nick ]]; then
  111. err_fun 17 && continue
  112. elif [[ "${#nick}" -lt "2" ]]; then
  113. err_fun 2 && continue
  114. elif [[ "${#nick}" -gt "5" ]]; then
  115. err_fun 3 && continue
  116. fi
  117. break
  118. done
  119. echo -e "\e[91m >> Agregado UUID: \e[92m$UUID "
  120. while true; do
  121. echo -ne "\e[91m >> Duracion de UUID (Dias):\033[1;92m " && read diasuser
  122. if [[ -z "$diasuser" ]]; then
  123. err_fun 17 && continue
  124. elif [[ "$diasuser" != +([0-9]) ]]; then
  125. err_fun 8 && continue
  126. elif [[ "$diasuser" -gt "360" ]]; then
  127. err_fun 9 && continue
  128. fi
  129. break
  130. done
  131. #Lim
  132. [[ $(cat /etc/passwd |grep $1: |grep -vi [a-z]$1 |grep -v [0-9]$1 > /dev/null) ]] && return 1
  133. valid=$(date '+%C%y-%m-%d' -d " +$diasuser days") && datexp=$(date "+%F" -d " + $diasuser days")
  134. echo -e "\e[91m >> Expira el : \e[92m$datexp "
  135. ##Registro
  136. echo " $UUID | $nick | $valid " >> /etc/VPS-MX/RegV2ray
  137. Fecha=`date +%d-%m-%y-%R`
  138. cp /etc/VPS-MX/RegV2ray /etc/VPS-MX/v2ray/RegV2ray-"$Fecha"
  139. v2ray restart > /dev/null 2>&1
  140. echo ""
  141. v2ray info > /etc/VPS-MX/v2ray/confuuid.log
  142. lineP=$(sed -n '/'${UUID}'/=' /etc/VPS-MX/v2ray/confuuid.log)
  143. numl1=4
  144. let suma=$lineP+$numl1
  145. sed -n ${suma}p /etc/VPS-MX/v2ray/confuuid.log
  146. echo ""
  147. msg -bar
  148. echo -e "\e[92m UUID AGREGEGADO CON EXITO "
  149. msg -bar
  150. msg -ne "Enter Para Continuar" && read enter
  151. ${SCPinst}/v2ray.sh
  152. }
  153. delusr () {
  154. clear
  155. clear
  156. invaliduuid () {
  157. msg -bar
  158. echo -e "\e[91m UUID INVALIDO \n$(msg -bar)"
  159. msg -ne "Enter Para Continuar" && read enter
  160. ${SCPinst}/v2ray.sh
  161. }
  162. msg -bar
  163. msg -tit
  164. msg -ama " ELIMINAR USUARIO | UUID V2RAY"
  165. msg -bar
  166. echo -e "\e[97m USUARIOS REGISTRADOS"
  167. echo -e "\e[33m$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f2,1)"
  168. msg -bar
  169. echo -ne "\e[91m >> Digita el UUID a elininar:\n \033[1;92m " && read uuidel
  170. [[ $(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json|head -1) ]] || invaliduuid
  171. lineP=$(sed -n '/'${uuidel}'/=' /etc/v2ray/config.json)
  172. linePre=$(sed -n '/'${uuidel}'/=' /etc/VPS-MX/RegV2ray)
  173. sed -i "${linePre}d" /etc/VPS-MX/RegV2ray
  174. numl1=2
  175. let resta=$lineP-$numl1
  176. sed -i "${resta}d" /etc/v2ray/config.json
  177. sed -i "${resta}d" /etc/v2ray/config.json
  178. sed -i "${resta}d" /etc/v2ray/config.json
  179. sed -i "${resta}d" /etc/v2ray/config.json
  180. sed -i "${resta}d" /etc/v2ray/config.json
  181. v2ray restart > /dev/null 2>&1
  182. msg -bar
  183. msg -ne "Enter Para Continuar" && read enter
  184. ${SCPinst}/v2ray.sh
  185. }
  186. mosusr_kk() {
  187. clear
  188. clear
  189. msg -bar
  190. msg -tit
  191. msg -ama " USUARIOS REGISTRADOS | UUID V2RAY"
  192. msg -bar
  193. # usersss=$(cat /etc/VPS-MX/RegV2ray|cut -d '|' -f1)
  194. # cat /etc/VPS-MX/RegV2ray|cut -d'|' -f3
  195. VPSsec=$(date +%s)
  196. local HOST="/etc/VPS-MX/RegV2ray"
  197. local HOST2="/etc/VPS-MX/RegV2ray"
  198. local RETURN="$(cat $HOST|cut -d'|' -f2)"
  199. local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
  200. if [[ -z $RETURN ]]; then
  201. echo -e "----- NINGUN USER REGISTRADO -----"
  202. msg -ne "Enter Para Continuar" && read enter
  203. ${SCPinst}/v2ray.sh
  204. else
  205. i=1
  206. echo -e "\e[97m UUID | USER | EXPIRACION \e[93m"
  207. msg -bar
  208. while read hostreturn ; do
  209. DateExp="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f3)"
  210. if [[ ! -z $DateExp ]]; then
  211. DataSec=$(date +%s --date="$DateExp")
  212. [[ "$VPSsec" -gt "$DataSec" ]] && EXPTIME="\e[91m[EXPIRADO]\e[97m" || EXPTIME="\e[92m[$(($(($DataSec - $VPSsec)) / 86400))]\e[97m Dias"
  213. else
  214. EXPTIME="\e[91m[ S/R ]"
  215. fi
  216. usris="$(cat /etc/VPS-MX/RegV2ray|grep -w "$hostreturn"|cut -d'|' -f2)"
  217. local contador_secuencial+="\e[93m$hostreturn \e[97m|\e[93m$usris\e[97m|\e[93m $EXPTIME \n"
  218. if [[ $i -gt 30 ]]; then
  219. echo -e "$contador_secuencial"
  220. unset contador_secuencial
  221. unset i
  222. fi
  223. let i++
  224. done <<< "$IDEUUID"
  225. [[ ! -z $contador_secuencial ]] && {
  226. linesss=$(cat /etc/VPS-MX/RegV2ray | wc -l)
  227. echo -e "$contador_secuencial \n Numero de Registrados: $linesss"
  228. }
  229. fi
  230. msg -bar
  231. msg -ne "Enter Para Continuar" && read enter
  232. ${SCPinst}/v2ray.sh
  233. }
  234. lim_port () {
  235. clear
  236. clear
  237. msg -bar
  238. msg -tit
  239. msg -ama " LIMITAR MB X PORT | UUID V2RAY"
  240. msg -bar
  241. ###VER
  242. estarts () {
  243. VPSsec=$(date +%s)
  244. local HOST="/etc/VPS-MX/v2ray/lisportt.log"
  245. local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
  246. local RETURN="$(cat $HOST|cut -d'|' -f2)"
  247. local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
  248. if [[ -z $RETURN ]]; then
  249. echo -e "----- NINGUN PUERTO REGISTRADO -----"
  250. msg -ne "Enter Para Continuar" && read enter
  251. ${SCPinst}/v2ray.sh
  252. else
  253. i=1
  254. while read hostreturn ; do
  255. iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log
  256. statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
  257. gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
  258. local contador_secuencial+=" \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB \n"
  259. if [[ $i -gt 30 ]]; then
  260. echo -e "$contador_secuencial"
  261. unset contador_secuencial
  262. unset i
  263. fi
  264. let i++
  265. done <<< "$IDEUUID"
  266. [[ ! -z $contador_secuencial ]] && {
  267. linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
  268. echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
  269. }
  270. fi
  271. msg -bar
  272. msg -ne "Enter Para Continuar" && read enter
  273. ${SCPinst}/v2ray.sh
  274. }
  275. ###LIM
  276. liport () {
  277. while true; do
  278. echo -ne "\e[91m >> Digite Port a Limitar:\033[1;92m " && read portbg
  279. if [[ -z "$portbg" ]]; then
  280. err_fun 17 && continue
  281. elif [[ "$portbg" != +([0-9]) ]]; then
  282. err_fun 16 && continue
  283. elif [[ "$portbg" -gt "1000" ]]; then
  284. err_fun 16 && continue
  285. fi
  286. break
  287. done
  288. while true; do
  289. echo -ne "\e[91m >> Digite Cantidad de GB:\033[1;92m " && read capgb
  290. if [[ -z "$capgb" ]]; then
  291. err_fun 17 && continue
  292. elif [[ "$capgb" != +([0-9]) ]]; then
  293. err_fun 15 && continue
  294. elif [[ "$capgb" -gt "1000" ]]; then
  295. err_fun 15 && continue
  296. fi
  297. break
  298. done
  299. uml1=1073741824
  300. gbuser="$capgb"
  301. let multiplicacion=$uml1*$gbuser
  302. sudo iptables -I OUTPUT -p tcp --sport $portbg -j DROP
  303. sudo iptables -I OUTPUT -p tcp --sport $portbg -m quota --quota $multiplicacion -j ACCEPT
  304. iptables-save > /etc/iptables/rules.v4
  305. echo ""
  306. echo -e " Port Seleccionado: $portbg | Cantidad de GB: $gbuser"
  307. echo ""
  308. echo " $portbg | $gbuser | $multiplicacion " >> /etc/VPS-MX/v2ray/lisportt.log
  309. msg -bar
  310. msg -ne "Enter Para Continuar" && read enter
  311. ${SCPinst}/v2ray.sh
  312. }
  313. ###RES
  314. resdata () {
  315. VPSsec=$(date +%s)
  316. local HOST="/etc/VPS-MX/v2ray/lisportt.log"
  317. local HOST2="/etc/VPS-MX/v2ray/lisportt.log"
  318. local RETURN="$(cat $HOST|cut -d'|' -f2)"
  319. local IDEUUID="$(cat $HOST|cut -d'|' -f1)"
  320. if [[ -z $RETURN ]]; then
  321. echo -e "----- NINGUN PUERTO REGISTRADO -----"
  322. return 0
  323. else
  324. i=1
  325. while read hostreturn ; do
  326. iptables -n -v -L > /etc/VPS-MX/v2ray/data1.log
  327. statsss=$(cat /etc/VPS-MX/v2ray/data1.log|grep -w "tcp spt:$hostreturn quota:"|cut -d' ' -f3,4,5)
  328. gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$hostreturn"|cut -d'|' -f2)
  329. local contador_secuencial+=" \e[97mPUERTO: \e[93m$hostreturn \e[97m|\e[93m$statsss \e[97m|\e[93m $gblim GB \n"
  330. if [[ $i -gt 30 ]]; then
  331. echo -e "$contador_secuencial"
  332. unset contador_secuencial
  333. unset i
  334. fi
  335. let i++
  336. done <<< "$IDEUUID"
  337. [[ ! -z $contador_secuencial ]] && {
  338. linesss=$(cat /etc/VPS-MX/v2ray/lisportt.log | wc -l)
  339. echo -e "$contador_secuencial \n Puertos Limitados: $linesss"
  340. }
  341. fi
  342. msg -bar
  343. while true; do
  344. echo -ne "\e[91m >> Digite Puerto a Limpiar:\033[1;92m " && read portbg
  345. if [[ -z "$portbg" ]]; then
  346. err_fun 17 && continue
  347. elif [[ "$portbg" != +([0-9]) ]]; then
  348. err_fun 16 && continue
  349. elif [[ "$portbg" -gt "1000" ]]; then
  350. err_fun 16 && continue
  351. fi
  352. break
  353. done
  354. invaliduuid () {
  355. msg -bar
  356. echo -e "\e[91m PUERTO INVALIDO \n$(msg -bar)"
  357. msg -ne "Enter Para Continuar" && read enter
  358. ${SCPinst}/v2ray.sh
  359. }
  360. [[ $(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log|head -1) ]] || invaliduuid
  361. gblim=$(cat /etc/VPS-MX/v2ray/lisportt.log|grep -w "$portbg"|cut -d'|' -f3)
  362. sudo iptables -D OUTPUT -p tcp --sport $portbg -j DROP
  363. sudo iptables -D OUTPUT -p tcp --sport $portbg -m quota --quota $gblim -j ACCEPT
  364. iptables-save > /etc/iptables/rules.v4
  365. lineP=$(sed -n '/'${portbg}'/=' /etc/VPS-MX/v2ray/lisportt.log)
  366. sed -i "${linePre}d" /etc/VPS-MX/v2ray/lisportt.log
  367. msg -bar
  368. msg -ne "Enter Para Continuar" && read enter
  369. ${SCPinst}/v2ray.sh
  370. }
  371. ## MENU
  372. echo -ne "\033[1;32m [1] > " && msg -azu "$(fun_trans "LIMITAR DATA x PORT") "
  373. echo -ne "\033[1;32m [2] > " && msg -azu "$(fun_trans "RESETEAR DATA DE PORT") "
  374. echo -ne "\033[1;32m [3] > " && msg -azu "$(fun_trans "VER DATOS CONSUMIDOS") "
  375. echo -ne "$(msg -bar)\n\033[1;32m [0] > " && msg -bra "\e[97m\033[1;41m VOLVER \033[1;37m"
  376. msg -bar
  377. selection=$(selection_fun 3)
  378. case ${selection} in
  379. 1)liport ;;
  380. 2)resdata;;
  381. 3)estarts;;
  382. 0)
  383. ${SCPinst}/v2ray.sh
  384. ;;
  385. esac
  386. }
  387. limpiador_activador () {
  388. unset PIDGEN
  389. PIDGEN=$(ps aux|grep -v grep|grep "limv2ray")
  390. if [[ ! $PIDGEN ]]; then
  391. screen -dmS limv2ray watch -n 21600 limv2ray
  392. else
  393. #killall screen
  394. screen -S limv2ray -p 0 -X quit
  395. fi
  396. unset PID_GEN
  397. PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
  398. [[ ! $PID_GEN ]] && PID_GEN="\e[91m [ DESACTIVADO ] " || PID_GEN="\e[92m [ ACTIVADO ] "
  399. statgen="$(echo $PID_GEN)"
  400. clear
  401. clear
  402. msg -bar
  403. msg -tit
  404. msg -ama " ELIMINAR EXPIRADOS | UUID V2RAY"
  405. msg -bar
  406. echo ""
  407. echo -e " $statgen "
  408. echo ""
  409. msg -bar
  410. msg -ne "Enter Para Continuar" && read enter
  411. ${SCPinst}/v2ray.sh
  412. }
  413. selection_fun () {
  414. local selection="null"
  415. local range
  416. for((i=0; i<=$1; i++)); do range[$i]="$i "; done
  417. while [[ ! $(echo ${range[*]}|grep -w "$selection") ]]; do
  418. echo -ne "\033[1;37m$(fun_trans " ► Selecione una Opcion"): " >&2
  419. read selection
  420. tput cuu1 >&2 && tput dl1 >&2
  421. done
  422. echo $selection
  423. }
  424. PID_GEN=$(ps x|grep -v grep|grep "limv2ray")
  425. [[ ! $PID_GEN ]] && PID_GEN="\e[91m [ OFF ] " || PID_GEN="\e[92m [ ON ] "
  426. statgen="$(echo $PID_GEN)"
  427. SPR &
  428. msg -bar3
  429. msg -bar
  430. msg -tit
  431. echo -e " \e[91m\e[43mINSTALADOR DE V2RAY\e[0m"
  432. msg -bar
  433. ## INSTALADOR
  434. echo -e "$(msg -verd "[1]")$(msg -verm2 " ➛ ")$(msg -azu "INSTALAR V2RAY ") "
  435. echo -e "$(msg -verd "[2]")$(msg -verm2 " ➛ ")$(msg -azu "CAMBIAR PROTOCOLO ") "
  436. echo -e "$(msg -verd "[3]")$(msg -verm2 " ➛ ")$(msg -azu "ACTIVAR TLS ") "
  437. echo -e "$(msg -verd "[4]")$(msg -verm2 " ➛ ")$(msg -azu "CAMBIAR PUERTO V2RAY ")"
  438. msg -bar
  439. ## CONTROLER
  440. echo -e "$(msg -verd "[5]")$(msg -verm2 " ➛ ")$(msg -azu "AGREGAR USUARIO UUID ")"
  441. echo -e "$(msg -verd "[6]")$(msg -verm2 " ➛ ")$(msg -azu "ELIMINAR USUARIO UUID ")"
  442. echo -e "$(msg -verd "[7]")$(msg -verm2 " ➛ ")$(msg -azu "MOSTAR USUARIOS REGISTRADOS ")"
  443. echo -e "$(msg -verd "[8]")$(msg -verm2 " ➛ ")$(msg -azu "INFORMACION DE CUENTAS ")"
  444. echo -e "$(msg -verd "[9]")$(msg -verm2 " ➛ ")$(msg -azu "ESTADISTICAS DE CONSUMO ")"
  445. echo -e "$(msg -verd "[10]")$(msg -verm2 "➛ ")$(msg -azu "LIMITADOR POR CONSUMO ")\e[91m ( BETA x PORT )"
  446. echo -e "$(msg -verd "[11]")$(msg -verm2 "➛ ")$(msg -azu "LIMPIADOR DE EXPIRADOS ------- $statgen ")"
  447. msg -bar
  448. ## DESISNTALAR
  449. echo -e "$(msg -verd "[12]")$(msg -verm2 "➛ ")$(msg -azu "\033[1;31mDESINSTALAR V2RAY ")"
  450. echo -e "$(msg -verd "[0]") $(msg -verm2 "➛ ")$(msg -azu "\e[97m\033[1;41m VOLVER \033[1;37m ")"
  451. msg -bar
  452. pid_inst () {
  453. [[ $1 = "" ]] && echo -e "\033[1;31m[OFF]" && return 0
  454. unset portas
  455. portas_var=$(lsof -V -i -P -n | grep -v "ESTABLISHED" |grep -v "COMMAND")
  456. i=0
  457. while read port; do
  458. var1=$(echo $port | awk '{print $1}') && var2=$(echo $port | awk '{print $9}' | awk -F ":" '{print $2}')
  459. [[ "$(echo -e ${portas[@]}|grep "$var1 $var2")" ]] || {
  460. portas[$i]="$var1 $var2\n"
  461. let i++
  462. }
  463. done <<< "$portas_var"
  464. [[ $(echo "${portas[@]}"|grep "$1") ]] && echo -e "\033[1;32m[ Servicio ON ]" || echo -e "\033[1;31m[ Servicio OFF ]"
  465. }
  466. echo -e " \e[97mEstado actual: $(pid_inst v2ray)"
  467. msg -bar
  468. # while [[ ${arquivoonlineadm} != @(0|[1-99]) ]]; do
  469. # read -p "Seleccione una Opcion [0-12]: " arquivoonlineadm
  470. # tput cuu1 && tput dl1
  471. # done
  472. selection=$(selection_fun 18)
  473. case ${selection} in
  474. 1)intallv2ray;;
  475. 2)protocolv2ray;;
  476. 3)tls;;
  477. 4)portv;;
  478. 5)addusr;;
  479. 6)delusr;;
  480. 7)mosusr_kk;;
  481. 8)infocuenta;;
  482. 9)stats;;
  483. 10)lim_port;;
  484. 11)limpiador_activador;;
  485. 12)unistallv2;;
  486. 0)exit;;
  487. esac