- ajout de la liste des ports ouvert dans la conf du firewall

This commit is contained in:
Frogg 2026-05-16 13:01:44 +02:00
parent a75d4db48e
commit be1a33bb56
1 changed files with 7 additions and 2 deletions

View File

@ -324,12 +324,15 @@ do_deb_sys_ufw() {
# 1. On montre l'existant SANS y toucher
current_rules=$($SUDO ufw status | grep -v "(v6)" | grep "ALLOW" | awk '{print $1}' | cut -d'/' -f1 | tr '\n' ' ')
if [[ -n "$current_rules" ]]; then
echo -e "${COLOR_YELLOW}Ports actuellement ouverts : ${COLOR_WHITE}${current_rules}${NONE}"
msg_warning "Ports actuellement ouverts : ${COLOR_WHITE}${current_rules}${NONE}"
msg_warning "Toutes les autres règles existantes seront supprimées"
msg_warning "Veuillez saisir tous les ports à ouvrir"
msg_warning "Même si il étaient déjà ouvert avant.\n"
fi
msg_info "Liste des ports tcp sortant ouvert"
ss -tlnw | grep -v -E '(127\.0\.0\.1|::1)' | column -t
# 2. Boucle de saisie (on remplit uniquement le tableau en mémoire)
while true; do
read -rp "Entrez un port à ouvrir (ou 'f' pour terminer) : " input_port
@ -481,7 +484,9 @@ EOF
}
do_deb_sys_mail(){
read -rp "Mail admin : " m;
local m
read -rp "Mail admin [${CONFIG_DEB_INSTALL_SERVER_ADMIN_MAIL}]: " m;
m=${m:-$CONFIG_DEB_INSTALL_SERVER_ADMIN_MAIL}
echo "export ADMIN_MAIL=\"$m\"" | $SUDO tee -a /etc/environment > /dev/null
# shellcheck disable=SC2034
export ADMIN_MAIL=$m