menu-xray.sh 2.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137
  1. #!/bin/bash
  2. function block-conn() {
  3. clear
  4. status=$(cat /iriszz/block-status)
  5. if [ "$status" == on ]; then
  6. echo -e "Do you want to allow all connections?"
  7. echo -e " [1] Yes"
  8. echo -e " [2] No"
  9. echo -e ""
  10. until [[ ${option} =~ ^[1-2]$ ]]; do
  11. read -rp "Select an option [1-2]: " option
  12. done
  13. if [ $option -eq 1 ]; then
  14. ufw allow 85 > /dev/null 2>&1
  15. ufw allow 465 > /dev/null 2>&1
  16. ufw allow 8080 > /dev/null 2>&1
  17. ufw allow 1194 > /dev/null 2>&1
  18. ufw allow 80 > /dev/null 2>&1
  19. ufw allow 443 > /dev/null 2>&1
  20. ufw allow 51820 > /dev/null 2>&1
  21. ufw allow 7300 > /dev/null 2>&1
  22. ufw allow 8000 > /dev/null 2>&1
  23. ufw allow 3128 > /dev/null 2>&1
  24. echo off > /iriszz/block-status
  25. elif [ $option -eq 2 ]; then
  26. clear
  27. echo -e "Operation cancelled."
  28. echo -e ""
  29. exit 0
  30. fi
  31. clear
  32. echo -e ""
  33. echo -e "All connections to the VPS is allowed."
  34. echo -e ""
  35. elif [ "$status" == off ]; then
  36. echo -e "Do you want to block all connections?"
  37. echo -e " [1] Yes"
  38. echo -e " [2] No"
  39. echo -e ""
  40. until [[ ${option} =~ ^[1-2]$ ]]; do
  41. read -rp "Select an option [1-2]: " option
  42. done
  43. if [ $option -eq 1 ]; then
  44. ufw delete allow 85 > /dev/null 2>&1
  45. ufw delete allow 465 > /dev/null 2>&1
  46. ufw delete allow 8080 > /dev/null 2>&1
  47. ufw delete allow 1194 > /dev/null 2>&1
  48. ufw delete allow 80 > /dev/null 2>&1
  49. ufw delete allow 443 > /dev/null 2>&1
  50. ufw delete allow 51820 > /dev/null 2>&1
  51. ufw delete allow 7300 > /dev/null 2>&1
  52. ufw delete allow 8000 > /dev/null 2>&1
  53. ufw delete allow 3128 > /dev/null 2>&1
  54. echo on > /iriszz/block-status
  55. elif [ $option -eq 2 ]; then
  56. clear
  57. echo -e "Operation cancelled."
  58. echo -e ""
  59. exit 0
  60. fi
  61. clear
  62. echo -e ""
  63. echo -e "All connections to the VPS is blocked, except SSH (22)."
  64. echo -e ""
  65. else
  66. echo -e "Error!"
  67. fi
  68. }
  69. status=$(cat /iriszz/block-status)
  70. clear
  71. echo -e "===========[ Script Menu ]==========="
  72. echo -e ""
  73. echo -e "VPN Services"
  74. echo -e "------------"
  75. echo -e " [1] SSH & OVPN Menu"
  76. echo -e " [2] Xray (VLESS) Menu"
  77. echo -e " [3] WireGuard Menu"
  78. echo -e ""
  79. echo -e "Server Tools"
  80. echo -e "------------"
  81. echo -e " [4] Server Speedtest"
  82. echo -e " [5] Server Benchmark"
  83. echo -e ""
  84. echo -e "Script Settings"
  85. echo -e "---------------"
  86. echo -e " [6] Block all connections"
  87. echo -e " + Current status: $status"
  88. echo -e " [7] Script info"
  89. echo -e ""
  90. echo -e " [8] Exit"
  91. echo -e ""
  92. until [[ ${option} =~ ^[1-8]$ ]]; do
  93. read -rp "Select an option [1-8]: " option
  94. done
  95. case "${option}" in
  96. 1)
  97. ssh-vpn-script
  98. exit
  99. ;;
  100. 2)
  101. xray-script
  102. exit
  103. ;;
  104. 3)
  105. wireguard-script
  106. exit
  107. ;;
  108. 4)
  109. clear
  110. speedtest
  111. echo -e ""
  112. exit
  113. ;;
  114. 5)
  115. clear
  116. echo -e ""
  117. wget -qO- wget.racing/nench.sh | bash
  118. exit
  119. ;;
  120. 6)
  121. block-conn
  122. exit
  123. ;;
  124. 7)
  125. script-info
  126. exit
  127. ;;
  128. 8)
  129. clear
  130. exit 0
  131. ;;
  132. esac