From 3d76ae8811d01d0f1de2cb089dae2a6a973165b4 Mon Sep 17 00:00:00 2001 From: Valentin Date: Wed, 17 Apr 2024 17:16:02 +0200 Subject: [PATCH] import directus db 3 modif ufw port ssh and ip --- install.sh | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/install.sh b/install.sh index cd2fb68..e07a311 100644 --- a/install.sh +++ b/install.sh @@ -22,10 +22,7 @@ get_username() { get_ip() { if [[ -z "$ip" ]]; then - ip=$(hostname -I) - if [[ "${ip: -1}" == " " ]]; then - ip="${ip%?}" - fi + ip=$(hostname -I | cut -d' ' -f1) fi } @@ -104,7 +101,8 @@ if [[ "$answer" == "y" ]]; then echo -e "${PURPLE}${BOLD}Setup Firewall and Fail2ban${RESET}" apt install -y ufw fail2ban systemctl enable fail2ban - ufw allow ssh + get_ssh_port + ufw allow $ssh_port ufw allow http ufw allow https fi