From 5aef2467b1c30de0b76c638fcbb21f2f03da562f Mon Sep 17 00:00:00 2001 From: midoks Date: Wed, 1 Feb 2023 13:20:53 +0800 Subject: [PATCH] Update debian.sh --- scripts/install/debian.sh | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/scripts/install/debian.sh b/scripts/install/debian.sh index 177895509..9623aff82 100644 --- a/scripts/install/debian.sh +++ b/scripts/install/debian.sh @@ -46,8 +46,12 @@ apt install -y python3-pip python3-dev python3-venv if [ -f /usr/sbin/ufw ];then - ufw allow 22/tcp - ufw allow $SSH_PORT/tcp + if [ "$SSH_PORT" != "" ];then + ufw allow $SSH_PORT/tcp + else + ufw allow 22/tcp + fi + ufw allow 80/tcp ufw allow 443/tcp ufw allow 888/tcp @@ -70,8 +74,11 @@ if [ ! -f /usr/sbin/ufw ];then systemctl unmask firewalld systemctl start firewalld - firewall-cmd --permanent --zone=public --add-port=22/tcp - firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp + if [ "$SSH_PORT" != "" ];then + firewall-cmd --permanent --zone=public --add-port=${SSH_PORT}/tcp + else + firewall-cmd --permanent --zone=public --add-port=22/tcp + fi firewall-cmd --permanent --zone=public --add-port=80/tcp firewall-cmd --permanent --zone=public --add-port=443/tcp firewall-cmd --permanent --zone=public --add-port=888/tcp