1
0

blockT.sh 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531
  1. #!/bin/bash
  2. #19/12/19
  3. PATH=/bin:/sbin:/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:~/bin
  4. export PATH
  5. declare -A cor=( [0]="\033[1;37m" [1]="\033[1;34m" [2]="\033[1;31m" [3]="\033[1;33m" [4]="\033[1;32m" )
  6. SCPfrm="/etc/adm-lite" && [[ ! -d ${SCPfrm} ]] && exit
  7. SCPinst="/etc/adm-lite" && [[ ! -d ${SCPinst} ]] && exit
  8. sh_ver="1.0.11"
  9. 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"
  10. Info="${Green_font_prefix}[Informacion]${Font_color_suffix}"
  11. Error="${Red_font_prefix}[Error]${Font_color_suffix}"
  12. smtp_port="25,26,465,587"
  13. pop3_port="109,110,995"
  14. imap_port="143,218,220,993"
  15. other_port="24,50,57,105,106,158,209,1109,24554,60177,60179"
  16. bt_key_word="torrent
  17. .torrent
  18. peer_id=
  19. announce
  20. info_hash
  21. get_peers
  22. find_node
  23. BitTorrent
  24. announce_peer
  25. BitTorrent protocol
  26. announce.php?passkey=
  27. magnet:
  28. xunlei
  29. sandai
  30. Thunder
  31. XLLiveUD"
  32. check_sys(){
  33. if [[ -f /etc/redhat-release ]]; then
  34. release="centos"
  35. elif cat /etc/issue | grep -q -E -i "debian"; then
  36. release="debian"
  37. elif cat /etc/issue | grep -q -E -i "ubuntu"; then
  38. release="ubuntu"
  39. elif cat /etc/issue | grep -q -E -i "centos|red hat|redhat"; then
  40. release="centos"
  41. elif cat /proc/version | grep -q -E -i "debian"; then
  42. release="debian"
  43. elif cat /proc/version | grep -q -E -i "ubuntu"; then
  44. release="ubuntu"
  45. elif cat /proc/version | grep -q -E -i "centos|red hat|redhat"; then
  46. release="centos"
  47. fi
  48. bit=`uname -m`
  49. }
  50. check_BT(){
  51. Cat_KEY_WORDS
  52. BT_KEY_WORDS=$(echo -e "$Ban_KEY_WORDS_list"|grep "torrent")
  53. }
  54. check_SPAM(){
  55. Cat_PORT
  56. SPAM_PORT=$(echo -e "$Ban_PORT_list"|grep "${smtp_port}")
  57. }
  58. Cat_PORT(){
  59. Ban_PORT_list=$(iptables -t filter -L OUTPUT -nvx --line-numbers|grep "REJECT"|awk '{print $13}')
  60. }
  61. Cat_KEY_WORDS(){
  62. Ban_KEY_WORDS_list=""
  63. Ban_KEY_WORDS_v6_list=""
  64. if [[ ! -z ${v6iptables} ]]; then
  65. Ban_KEY_WORDS_v6_text=$(${v6iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
  66. Ban_KEY_WORDS_v6_list=$(echo -e "${Ban_KEY_WORDS_v6_text}"|sed -r 's/.*\"(.+)\".*/\1/')
  67. fi
  68. Ban_KEY_WORDS_text=$(${v4iptables} -t mangle -L OUTPUT -nvx --line-numbers|grep "DROP")
  69. Ban_KEY_WORDS_list=$(echo -e "${Ban_KEY_WORDS_text}"|sed -r 's/.*\"(.+)\".*/\1/')
  70. }
  71. View_PORT(){
  72. Cat_PORT
  73. echo -e "========${Red_background_prefix} Puerto Bloqueado Actualmente ${Font_color_suffix}========="
  74. echo -e "$Ban_PORT_list" && echo && echo -e "==============================================="
  75. }
  76. View_KEY_WORDS(){
  77. Cat_KEY_WORDS
  78. echo -e "============${Red_background_prefix} Actualmente Prohibido ${Font_color_suffix}============"
  79. echo -e "$Ban_KEY_WORDS_list" && echo -e "==============================================="
  80. }
  81. View_ALL(){
  82. echo
  83. View_PORT
  84. View_KEY_WORDS
  85. echo
  86. msg -bar2
  87. }
  88. Save_iptables_v4_v6(){
  89. if [[ ${release} == "centos" ]]; then
  90. if [[ ! -z "$v6iptables" ]]; then
  91. service ip6tables save
  92. chkconfig --level 2345 ip6tables on
  93. fi
  94. service iptables save
  95. chkconfig --level 2345 iptables on
  96. else
  97. if [[ ! -z "$v6iptables" ]]; then
  98. ip6tables-save > /etc/ip6tables.up.rules
  99. 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
  100. else
  101. echo -e "#!/bin/bash\n/sbin/iptables-restore < /etc/iptables.up.rules" > /etc/network/if-pre-up.d/iptables
  102. fi
  103. iptables-save > /etc/iptables.up.rules
  104. chmod +x /etc/network/if-pre-up.d/iptables
  105. fi
  106. }
  107. Set_key_word() { $1 -t mangle -$3 OUTPUT -m string --string "$2" --algo bm --to 65535 -j DROP; }
  108. Set_tcp_port() {
  109. [[ "$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
  110. [[ "$1" = "$v6iptables" ]] && $1 -t filter -$3 OUTPUT -p tcp -m multiport --dports "$2" -m state --state NEW,ESTABLISHED -j REJECT --reject-with tcp-reset
  111. }
  112. Set_udp_port() { $1 -t filter -$3 OUTPUT -p udp -m multiport --dports "$2" -j DROP; }
  113. Set_SPAM_Code_v4(){
  114. for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
  115. do
  116. Set_tcp_port $v4iptables "$i" $s
  117. Set_udp_port $v4iptables "$i" $s
  118. done
  119. }
  120. Set_SPAM_Code_v4_v6(){
  121. for i in ${smtp_port} ${pop3_port} ${imap_port} ${other_port}
  122. do
  123. for j in $v4iptables $v6iptables
  124. do
  125. Set_tcp_port $j "$i" $s
  126. Set_udp_port $j "$i" $s
  127. done
  128. done
  129. }
  130. Set_PORT(){
  131. if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
  132. Set_tcp_port $v4iptables $PORT $s
  133. Set_udp_port $v4iptables $PORT $s
  134. Set_tcp_port $v6iptables $PORT $s
  135. Set_udp_port $v6iptables $PORT $s
  136. elif [[ -n "$v4iptables" ]]; then
  137. Set_tcp_port $v4iptables $PORT $s
  138. Set_udp_port $v4iptables $PORT $s
  139. fi
  140. Save_iptables_v4_v6
  141. }
  142. Set_KEY_WORDS(){
  143. key_word_num=$(echo -e "${key_word}"|wc -l)
  144. for((integer = 1; integer <= ${key_word_num}; integer++))
  145. do
  146. i=$(echo -e "${key_word}"|sed -n "${integer}p")
  147. Set_key_word $v4iptables "$i" $s
  148. [[ ! -z "$v6iptables" ]] && Set_key_word $v6iptables "$i" $s
  149. done
  150. Save_iptables_v4_v6
  151. }
  152. Set_BT(){
  153. key_word=${bt_key_word}
  154. Set_KEY_WORDS
  155. Save_iptables_v4_v6
  156. }
  157. Set_SPAM(){
  158. if [[ -n "$v4iptables" ]] && [[ -n "$v6iptables" ]]; then
  159. Set_SPAM_Code_v4_v6
  160. elif [[ -n "$v4iptables" ]]; then
  161. Set_SPAM_Code_v4
  162. fi
  163. Save_iptables_v4_v6
  164. }
  165. Set_ALL(){
  166. Set_BT
  167. Set_SPAM
  168. }
  169. Ban_BT(){
  170. check_BT
  171. [[ ! -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent bloqueados y Palabras Claves, no es\nnecesario volver a prohibirlas !" && msg -bar2 && exit 0
  172. s="A"
  173. Set_BT
  174. View_ALL
  175. echo -e "${Info} Torrent bloqueados y Palabras Claves !"
  176. msg -bar2
  177. }
  178. Ban_SPAM(){
  179. check_SPAM
  180. [[ ! -z ${SPAM_PORT} ]] && echo -e "${Error} Se detectó un puerto SPAM bloqueado, no es\nnecesario volver a bloquear !" && msg -bar2 && exit 0
  181. s="A"
  182. Set_SPAM
  183. View_ALL
  184. echo -e "${Info} Puertos SPAM Bloqueados !"
  185. msg -bar2
  186. }
  187. Ban_ALL(){
  188. check_BT
  189. check_SPAM
  190. s="A"
  191. if [[ -z ${BT_KEY_WORDS} ]]; then
  192. if [[ -z ${SPAM_PORT} ]]; then
  193. Set_ALL
  194. View_ALL
  195. echo -e "${Info} Torrent bloqueados, Palabras Claves y Puertos SPAM !"
  196. msg -bar2
  197. else
  198. Set_BT
  199. View_ALL
  200. echo -e "${Info} Torrent bloqueados y Palabras Claves !"
  201. fi
  202. else
  203. if [[ -z ${SPAM_PORT} ]]; then
  204. Set_SPAM
  205. View_ALL
  206. echo -e "${Info} Puerto SPAM (spam) prohibido !"
  207. else
  208. echo -e "${Error} Torrent Bloqueados, Palabras Claves y Puertos SPAM,\nno es necesario volver a prohibir !" && msg -bar2 && exit 0
  209. fi
  210. fi
  211. }
  212. UnBan_BT(){
  213. check_BT
  214. [[ -z ${BT_KEY_WORDS} ]] && echo -e "${Error} Torrent y Palabras Claves no bloqueadas, verifique !"&& msg -bar2 && exit 0
  215. s="D"
  216. Set_BT
  217. View_ALL
  218. echo -e "${Info} Torrent Desbloqueados y Palabras Claves !"
  219. msg -bar2
  220. }
  221. UnBan_SPAM(){
  222. check_SPAM
  223. [[ -z ${SPAM_PORT} ]] && echo -e "${Error} Puerto SPAM no detectados, verifique !" && msg -bar2 && exit 0
  224. s="D"
  225. Set_SPAM
  226. View_ALL
  227. echo -e "${Info} Puertos de SPAM Desbloqueados !"
  228. msg -bar2
  229. }
  230. UnBan_ALL(){
  231. check_BT
  232. check_SPAM
  233. s="D"
  234. if [[ ! -z ${BT_KEY_WORDS} ]]; then
  235. if [[ ! -z ${SPAM_PORT} ]]; then
  236. Set_ALL
  237. View_ALL
  238. echo -e "${Info} Torrent, Palabras Claves y Puertos SPAM Desbloqueados !"
  239. msg -bar2
  240. else
  241. Set_BT
  242. View_ALL
  243. echo -e "${Info} Torrent, Palabras Claves Desbloqueados !"
  244. msg -bar2
  245. fi
  246. else
  247. if [[ ! -z ${SPAM_PORT} ]]; then
  248. Set_SPAM
  249. View_ALL
  250. echo -e "${Info} Puertos SPAM Desbloqueados !"
  251. msg -bar2
  252. else
  253. echo -e "${Error} No se detectan Torrent, Palabras Claves y Puertos SPAM Bloqueados, verifique !" && msg -bar2 && exit 0
  254. fi
  255. fi
  256. }
  257. ENTER_Ban_KEY_WORDS_type(){
  258. Type=$1
  259. Type_1=$2
  260. if [[ $Type_1 != "ban_1" ]]; then
  261. echo -e "Por favor seleccione un tipo de entrada:
  262. 1. Entrada manual (solo se admiten palabras clave únicas)
  263. 2. Lectura local de archivos (admite lectura por lotes de palabras clave, una palabra clave por línea)
  264. 3. Lectura de dirección de red (admite lectura por lotes de palabras clave, una palabra clave por línea)" && echo
  265. read -e -p "(Por defecto: 1. Entrada manual):" key_word_type
  266. fi
  267. [[ -z "${key_word_type}" ]] && key_word_type="1"
  268. if [[ ${key_word_type} == "1" ]]; then
  269. if [[ $Type == "ban" ]]; then
  270. ENTER_Ban_KEY_WORDS
  271. else
  272. ENTER_UnBan_KEY_WORDS
  273. fi
  274. elif [[ ${key_word_type} == "2" ]]; then
  275. ENTER_Ban_KEY_WORDS_file
  276. elif [[ ${key_word_type} == "3" ]]; then
  277. ENTER_Ban_KEY_WORDS_url
  278. else
  279. if [[ $Type == "ban" ]]; then
  280. ENTER_Ban_KEY_WORDS
  281. else
  282. ENTER_UnBan_KEY_WORDS
  283. fi
  284. fi
  285. }
  286. ENTER_Ban_PORT(){
  287. echo -e "Ingrese el puerto que Bloqueará:\n(segmento de Puerto único / Puerto múltiple / Puerto continuo)\n"
  288. if [[ ${Ban_PORT_Type_1} != "1" ]]; then
  289. echo -e "
  290. ${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
  291. -Puerto único: 25 (puerto único)
  292. -Multipuerto: 25, 26, 465, 587 (varios puertos están separados por comas)
  293. -Segmento de puerto continuo: 25: 587 (todos los puertos entre 25-587)" && echo
  294. fi
  295. read -e -p "(Intro se cancela por defecto):" PORT
  296. [[ -z "${PORT}" ]] && echo "Cancelado..." && View_ALL && exit 0
  297. }
  298. ENTER_Ban_KEY_WORDS(){
  299. msg -bar2
  300. echo -e "Ingrese las palabras clave que se prohibirán\n(nombre de dominio, etc., solo admite una sola palabra clave)"
  301. if [[ ${Type_1} != "ban_1" ]]; then
  302. echo ""
  303. echo -e "${Green_font_prefix}======== Ejemplo Descripción ========${Font_color_suffix}
  304. -Palabras clave: youtube, que prohíbe el acceso a cualquier nombre de dominio que contenga la palabra clave youtube.
  305. -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.
  306. -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.
  307. -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
  308. fi
  309. read -e -p "(Intro se cancela por defecto):" key_word
  310. [[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
  311. }
  312. ENTER_Ban_KEY_WORDS_file(){
  313. echo -e "Ingrese el archivo local de palabras clave que se prohibirá / desbloqueará (utilice la ruta absoluta)" && echo
  314. read -e -p "(El valor predeterminado es leer key_word.txt en el mismo directorio que el script):" key_word
  315. [[ -z "${key_word}" ]] && key_word="key_word.txt"
  316. if [[ -e "${key_word}" ]]; then
  317. key_word=$(cat "${key_word}")
  318. [[ -z ${key_word} ]] && echo -e "${Error} El contenido del archivo está vacío. !" && View_ALL && exit 0
  319. else
  320. echo -e "${Error} Archivo no encontrado ${key_word} !" && View_ALL && exit 0
  321. fi
  322. }
  323. ENTER_Ban_KEY_WORDS_url(){
  324. 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
  325. read -e -p "(Intro se cancela por defecto):" key_word
  326. [[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
  327. key_word=$(wget --no-check-certificate -t3 -T5 -qO- "${key_word}")
  328. [[ -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
  329. }
  330. ENTER_UnBan_KEY_WORDS(){
  331. View_KEY_WORDS
  332. echo -e "Ingrese la palabra clave que desea desbloquear (ingrese la palabra clave completa y precisa de acuerdo con la lista anterior)" && echo
  333. read -e -p "(Intro se cancela por defecto):" key_word
  334. [[ -z "${key_word}" ]] && echo "Cancelado ..." && View_ALL && exit 0
  335. }
  336. ENTER_UnBan_PORT(){
  337. 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
  338. read -e -p "(Intro se cancela por defecto):" PORT
  339. [[ -z "${PORT}" ]] && echo "Cancelado ..." && View_ALL && exit 0
  340. }
  341. Ban_PORT(){
  342. s="A"
  343. ENTER_Ban_PORT
  344. Set_PORT
  345. echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
  346. Ban_PORT_Type_1="1"
  347. while true
  348. do
  349. ENTER_Ban_PORT
  350. Set_PORT
  351. echo -e "${Info} Puerto bloqueado [ ${PORT} ] !\n"
  352. done
  353. View_ALL
  354. }
  355. Ban_KEY_WORDS(){
  356. s="A"
  357. ENTER_Ban_KEY_WORDS_type "ban"
  358. Set_KEY_WORDS
  359. echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
  360. while true
  361. do
  362. ENTER_Ban_KEY_WORDS_type "ban" "ban_1"
  363. Set_KEY_WORDS
  364. echo -e "${Info} Palabras clave bloqueadas [ ${key_word} ] !\n"
  365. done
  366. View_ALL
  367. }
  368. UnBan_PORT(){
  369. s="D"
  370. View_PORT
  371. [[ -z ${Ban_PORT_list} ]] && echo -e "${Error} Se detecta cualquier puerto no bloqueado !" && exit 0
  372. ENTER_UnBan_PORT
  373. Set_PORT
  374. echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
  375. while true
  376. do
  377. View_PORT
  378. [[ -z ${Ban_PORT_list} ]] && echo -e "${Error} No se detecta puertos bloqueados !" && msg -bar2 && exit 0
  379. ENTER_UnBan_PORT
  380. Set_PORT
  381. echo -e "${Info} Puerto decapsulado [ ${PORT} ] !\n"
  382. done
  383. View_ALL
  384. }
  385. UnBan_KEY_WORDS(){
  386. s="D"
  387. Cat_KEY_WORDS
  388. [[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && exit 0
  389. ENTER_Ban_KEY_WORDS_type "unban"
  390. Set_KEY_WORDS
  391. echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
  392. while true
  393. do
  394. Cat_KEY_WORDS
  395. [[ -z ${Ban_KEY_WORDS_list} ]] && echo -e "${Error} No se ha detectado ningún bloqueo !" && msg -bar2 && exit 0
  396. ENTER_Ban_KEY_WORDS_type "unban" "ban_1"
  397. Set_KEY_WORDS
  398. echo -e "${Info} Palabras clave desbloqueadas [ ${key_word} ] !\n"
  399. done
  400. View_ALL
  401. }
  402. UnBan_KEY_WORDS_ALL(){
  403. Cat_KEY_WORDS
  404. [[ -z ${Ban_KEY_WORDS_text} ]] && echo -e "${Error} No se detectó ninguna clave, verifique !" && msg -bar2 && exit 0
  405. if [[ ! -z "${v6iptables}" ]]; then
  406. Ban_KEY_WORDS_v6_num=$(echo -e "${Ban_KEY_WORDS_v6_list}"|wc -l)
  407. for((integer = 1; integer <= ${Ban_KEY_WORDS_v6_num}; integer++))
  408. do
  409. ${v6iptables} -t mangle -D OUTPUT 1
  410. done
  411. fi
  412. Ban_KEY_WORDS_num=$(echo -e "${Ban_KEY_WORDS_list}"|wc -l)
  413. for((integer = 1; integer <= ${Ban_KEY_WORDS_num}; integer++))
  414. do
  415. ${v4iptables} -t mangle -D OUTPUT 1
  416. done
  417. Save_iptables_v4_v6
  418. View_ALL
  419. echo -e "${Info} Todas las palabras clave han sido desbloqueadas !"
  420. }
  421. check_iptables(){
  422. v4iptables=`iptables -V`
  423. v6iptables=`ip6tables -V`
  424. if [[ ! -z ${v4iptables} ]]; then
  425. v4iptables="iptables"
  426. if [[ ! -z ${v6iptables} ]]; then
  427. v6iptables="ip6tables"
  428. fi
  429. else
  430. echo -e "${Error} El firewall de iptables no está instalado !
  431. Por favor, instale el firewall de iptables:
  432. CentOS Sistema: yum install iptables -y
  433. Debian / Ubuntu Sistema: apt-get install iptables -y"
  434. fi
  435. }
  436. Update_Shell(){
  437. sh_new_ver=$(wget --no-check-certificate -qO- -t1 -T3 "https://raw.githubusercontent.com/VPS-MX/VPS-MX-8.0/master/SCRIPT/blockBT.sh"|grep 'sh_ver="'|awk -F "=" '{print $NF}'|sed 's/\"//g'|head -1)
  438. [[ -z ${sh_new_ver} ]] && echo -e "${Error} No se puede vincular a Github !" && exit 0
  439. wget https://raw.githubusercontent.com/VPS-MX/VPS-MX-8.0/master/SCRIPT/blockBT.sh -O /etc/ger-frm/blockBT.sh &> /dev/null
  440. chmod +x /etc/ger-frm/blockBT.sh
  441. echo -e "El script ha sido actualizado a la última versión.[ ${sh_new_ver} ]"
  442. msg -bar2
  443. exit 0
  444. }
  445. check_sys
  446. check_iptables
  447. action=$1
  448. if [[ ! -z $action ]]; then
  449. [[ $action = "banbt" ]] && Ban_BT && exit 0
  450. [[ $action = "banspam" ]] && Ban_SPAM && exit 0
  451. [[ $action = "banall" ]] && Ban_ALL && exit 0
  452. [[ $action = "unbanbt" ]] && UnBan_BT && exit 0
  453. [[ $action = "unbanspam" ]] && UnBan_SPAM && exit 0
  454. [[ $action = "unbanall" ]] && UnBan_ALL && exit 0
  455. fi
  456. echo -e " Panel de Firewall ChumoGH By ADM 2021 ${Red_font_prefix}[v${sh_ver}]${Font_color_suffix}"
  457. msg -bar2
  458. echo -e " ${Green_font_prefix}0.${Font_color_suffix} Ver la lista actual de prohibidos
  459. ————————————
  460. ${Green_font_prefix}1.${Font_color_suffix} Bloquear Torrent, Palabras Clave
  461. ${Green_font_prefix}2.${Font_color_suffix} Bloquear Puertos SPAM
  462. ${Green_font_prefix}3.${Font_color_suffix} Bloquear Torrent, Palabras Clave + Puertos SPAM
  463. ${Green_font_prefix}4.${Font_color_suffix} Bloquear Puerto personalizado
  464. ${Green_font_prefix}5.${Font_color_suffix} Bloquear Palabras Clave Personalizadas
  465. ————————————
  466. ${Green_font_prefix}6.${Font_color_suffix} Desbloquear Torrent, Palabras Clave
  467. ${Green_font_prefix}7.${Font_color_suffix} Desbloquear Puertos SPAM
  468. ${Green_font_prefix}8.${Font_color_suffix} Desbloquear Torrent, Palabras Clave , Puertos SPAM
  469. ${Green_font_prefix}9.${Font_color_suffix} Desbloquear Puerto Personalizado
  470. ${Green_font_prefix}10.${Font_color_suffix} Desbloquear Palabra Clave Personalizadas
  471. ${Green_font_prefix}11.${Font_color_suffix} Desbloquear Todas las palabras Clave Personalizadas
  472. ————————————
  473. ${Green_font_prefix}12.${Font_color_suffix} Actualizar script" && msg -bar2
  474. read -e -p " Por favor ingrese un número [0-12]:" num && msg -bar2
  475. case "$num" in
  476. 0)
  477. View_ALL
  478. ;;
  479. 1)
  480. Ban_BT
  481. ;;
  482. 2)
  483. Ban_SPAM
  484. ;;
  485. 3)
  486. Ban_ALL
  487. ;;
  488. 4)
  489. Ban_PORT
  490. ;;
  491. 5)
  492. Ban_KEY_WORDS
  493. ;;
  494. 6)
  495. UnBan_BT
  496. ;;
  497. 7)
  498. UnBan_SPAM
  499. ;;
  500. 8)
  501. UnBan_ALL
  502. ;;
  503. 9)
  504. UnBan_PORT
  505. ;;
  506. 10)
  507. UnBan_KEY_WORDS
  508. ;;
  509. 11)
  510. UnBan_KEY_WORDS_ALL
  511. ;;
  512. 12)
  513. Update_Shell
  514. ;;
  515. *)
  516. echo "Por favor ingrese el número correcto [0-12]"
  517. ;;
  518. esac