mirror of
https://github.com/MHSanaei/3x-ui.git
synced 2025-09-09 11:46:18 +00:00
modified: x-ui.sh
This commit is contained in:
parent
252decac58
commit
d02c61f360
1 changed files with 17 additions and 3 deletions
20
x-ui.sh
20
x-ui.sh
|
@ -68,6 +68,8 @@ elif [[ "${release}" == "manjaro" ]]; then
|
||||||
echo "Your OS is Manjaro"
|
echo "Your OS is Manjaro"
|
||||||
elif [[ "${release}" == "armbian" ]]; then
|
elif [[ "${release}" == "armbian" ]]; then
|
||||||
echo "Your OS is Armbian"
|
echo "Your OS is Armbian"
|
||||||
|
elif [[ "${release}" == "alpine" ]]; then
|
||||||
|
echo "Your OS is Alpine"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Declare Variables
|
# Declare Variables
|
||||||
|
@ -403,6 +405,9 @@ enable_bbr() {
|
||||||
fedora)
|
fedora)
|
||||||
dnf -y update && dnf -y install ca-certificates
|
dnf -y update && dnf -y install ca-certificates
|
||||||
;;
|
;;
|
||||||
|
alpine)
|
||||||
|
apk update && apk add ca-certificates
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -546,13 +551,13 @@ firewall_menu() {
|
||||||
open_ports
|
open_ports
|
||||||
;;
|
;;
|
||||||
2)
|
2)
|
||||||
sudo ufw status
|
ufw status
|
||||||
;;
|
;;
|
||||||
3)
|
3)
|
||||||
delete_ports
|
delete_ports
|
||||||
;;
|
;;
|
||||||
4)
|
4)
|
||||||
sudo ufw disable
|
ufw disable
|
||||||
;;
|
;;
|
||||||
*) echo "Invalid choice" ;;
|
*) echo "Invalid choice" ;;
|
||||||
esac
|
esac
|
||||||
|
@ -589,7 +594,7 @@ open_ports() {
|
||||||
echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2
|
echo "Error: Invalid input. Please enter a comma-separated list of ports or a range of ports (e.g. 80,443,2053 or 400-500)." >&2
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Open the specified ports using ufw
|
# Open the specified ports using ufw
|
||||||
IFS=',' read -ra PORT_LIST <<<"$ports"
|
IFS=',' read -ra PORT_LIST <<<"$ports"
|
||||||
for port in "${PORT_LIST[@]}"; do
|
for port in "${PORT_LIST[@]}"; do
|
||||||
|
@ -727,6 +732,9 @@ ssl_cert_issue() {
|
||||||
fedora)
|
fedora)
|
||||||
dnf -y update && dnf -y install socat
|
dnf -y update && dnf -y install socat
|
||||||
;;
|
;;
|
||||||
|
alpine)
|
||||||
|
apk update && apk add socat
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1086,6 +1094,9 @@ install_iplimit() {
|
||||||
fedora)
|
fedora)
|
||||||
dnf -y update && dnf -y install fail2ban
|
dnf -y update && dnf -y install fail2ban
|
||||||
;;
|
;;
|
||||||
|
alpine)
|
||||||
|
apk update && apk add fail2ban
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
echo -e "${red}Unsupported operating system. Please check the script and install the necessary packages manually.${plain}\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
@ -1165,6 +1176,9 @@ remove_iplimit() {
|
||||||
dnf remove fail2ban -y
|
dnf remove fail2ban -y
|
||||||
dnf autoremove -y
|
dnf autoremove -y
|
||||||
;;
|
;;
|
||||||
|
alpine)
|
||||||
|
apk del fail2ban
|
||||||
|
;;
|
||||||
*)
|
*)
|
||||||
echo -e "${red}Unsupported operating system. Please uninstall Fail2ban manually.${plain}\n"
|
echo -e "${red}Unsupported operating system. Please uninstall Fail2ban manually.${plain}\n"
|
||||||
exit 1
|
exit 1
|
||||||
|
|
Loading…
Reference in a new issue