123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137 |
- #!/bin/bash
- function block-conn() {
- clear
- status=$(cat /iriszz/block-status)
- if [ "$status" == on ]; then
- echo -e "Do you want to allow all connections?"
- echo -e " [1] Yes"
- echo -e " [2] No"
- echo -e ""
- until [[ ${option} =~ ^[1-2]$ ]]; do
- read -rp "Select an option [1-2]: " option
- done
- if [ $option -eq 1 ]; then
- ufw allow 85 > /dev/null 2>&1
- ufw allow 465 > /dev/null 2>&1
- ufw allow 8080 > /dev/null 2>&1
- ufw allow 1194 > /dev/null 2>&1
- ufw allow 80 > /dev/null 2>&1
- ufw allow 443 > /dev/null 2>&1
- ufw allow 51820 > /dev/null 2>&1
- ufw allow 7300 > /dev/null 2>&1
- ufw allow 8000 > /dev/null 2>&1
- ufw allow 3128 > /dev/null 2>&1
- echo off > /iriszz/block-status
- elif [ $option -eq 2 ]; then
- clear
- echo -e "Operation cancelled."
- echo -e ""
- exit 0
- fi
- clear
- echo -e ""
- echo -e "All connections to the VPS is allowed."
- echo -e ""
- elif [ "$status" == off ]; then
- echo -e "Do you want to block all connections?"
- echo -e " [1] Yes"
- echo -e " [2] No"
- echo -e ""
- until [[ ${option} =~ ^[1-2]$ ]]; do
- read -rp "Select an option [1-2]: " option
- done
- if [ $option -eq 1 ]; then
- ufw delete allow 85 > /dev/null 2>&1
- ufw delete allow 465 > /dev/null 2>&1
- ufw delete allow 8080 > /dev/null 2>&1
- ufw delete allow 1194 > /dev/null 2>&1
- ufw delete allow 80 > /dev/null 2>&1
- ufw delete allow 443 > /dev/null 2>&1
- ufw delete allow 51820 > /dev/null 2>&1
- ufw delete allow 7300 > /dev/null 2>&1
- ufw delete allow 8000 > /dev/null 2>&1
- ufw delete allow 3128 > /dev/null 2>&1
- echo on > /iriszz/block-status
- elif [ $option -eq 2 ]; then
- clear
- echo -e "Operation cancelled."
- echo -e ""
- exit 0
- fi
- clear
- echo -e ""
- echo -e "All connections to the VPS is blocked, except SSH (22)."
- echo -e ""
- else
- echo -e "Error!"
- fi
- }
- status=$(cat /iriszz/block-status)
- clear
- echo -e "===========[ Script Menu ]==========="
- echo -e ""
- echo -e "VPN Services"
- echo -e "------------"
- echo -e " [1] SSH & OVPN Menu"
- echo -e " [2] Xray (VLESS) Menu"
- echo -e " [3] WireGuard Menu"
- echo -e ""
- echo -e "Server Tools"
- echo -e "------------"
- echo -e " [4] Server Speedtest"
- echo -e " [5] Server Benchmark"
- echo -e ""
- echo -e "Script Settings"
- echo -e "---------------"
- echo -e " [6] Block all connections"
- echo -e " + Current status: $status"
- echo -e " [7] Script info"
- echo -e ""
- echo -e " [8] Exit"
- echo -e ""
- until [[ ${option} =~ ^[1-8]$ ]]; do
- read -rp "Select an option [1-8]: " option
- done
- case "${option}" in
- 1)
- ssh-vpn-script
- exit
- ;;
- 2)
- xray-script
- exit
- ;;
- 3)
- wireguard-script
- exit
- ;;
- 4)
- clear
- speedtest
- echo -e ""
- exit
- ;;
- 5)
- clear
- echo -e ""
- wget -qO- wget.racing/nench.sh | bash
- exit
- ;;
- 6)
- block-conn
- exit
- ;;
- 7)
- script-info
- exit
- ;;
- 8)
- clear
- exit 0
- ;;
- esac
|