1
0
mirror of https://github.com/tommytran732/Pterodactyl-Script synced 2025-02-20 18:31:34 -05:00

Added "firewall setup" option

This commit is contained in:
William H 2020-11-14 22:20:23 +01:00 committed by GitHub
parent 6a698fd4c4
commit 1478b37c52
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -178,6 +178,7 @@ install_options(){
output "[20] Change Pterodactyl theme (0.7.19 Only)." output "[20] Change Pterodactyl theme (0.7.19 Only)."
output "[21] Emergency MariaDB root password reset." output "[21] Emergency MariaDB root password reset."
output "[22] Emergency database host information reset." output "[22] Emergency database host information reset."
output "[23] Setup the firewall."
read choice read choice
case $choice in case $choice in
1 ) installoption=1 1 ) installoption=1
@ -246,6 +247,9 @@ install_options(){
22 ) installoption=22 22 ) installoption=22
output "You have selected Database Host information reset." output "You have selected Database Host information reset."
;; ;;
23 ) installoption=23
output "You have selected to setup the firewall."
;;
* ) output "You did not enter a valid selection." * ) output "You did not enter a valid selection."
install_options install_options
esac esac
@ -1900,6 +1904,12 @@ EOF
ufw allow 8080 ufw allow 8080
ufw allow 2022 ufw allow 2022
ufw allow 3306 ufw allow 3306
elif [ "$installoption" = "23" ]; then
ufw allow 80
ufw allow 443
ufw allow 8080
ufw allow 2022
ufw allow 3306
fi fi
yes |ufw enable yes |ufw enable
elif [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rhel" ]; then elif [ "$lsb_dist" = "centos" ] || [ "$lsb_dist" = "fedora" ] || [ "$lsb_dist" = "rhel" ]; then
@ -1934,6 +1944,12 @@ EOF
firewall-cmd --permanent --add-port=2022/tcp firewall-cmd --permanent --add-port=2022/tcp
firewall-cmd --permanent --add-port=8080/tcp firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --permanent --add-service=mysql firewall-cmd --permanent --add-service=mysql
elif [ "$installoption" = "23" ]; then
firewall-cmd --add-service=http --permanent
firewall-cmd --add-service=https --permanent
firewall-cmd --permanent --add-port=2022/tcp
firewall-cmd --permanent --add-port=8080/tcp
firewall-cmd --permanent --add-service=mysql
fi fi
fi fi
} }
@ -2169,4 +2185,7 @@ case $installoption in
;; ;;
22) database_host_reset 22) database_host_reset
;; ;;
23) firewall
broadcast
;;
esac esac