diff --git a/web_secu/avahi.sh b/web_secu/avahi.sh index 7a0d0e2..6eaaf94 100644 --- a/web_secu/avahi.sh +++ b/web_secu/avahi.sh @@ -12,11 +12,14 @@ cat << 'EOF' EOF -if dpkg -l avahi-daemon 2>/dev/null | grep -q '^ii'; then - echo "Avahi est déjà installé et actif." +if systemctl is-active --quiet avahi-daemon; then + echo "Avahi est déjà actif accessible via $(hostname).local" else - apt install -y avahi-daemon + if ! dpkg -l avahi-daemon 2>/dev/null | grep -q '^ii'; then + echo "Installation de Avahi..." + apt install -y avahi-daemon + fi systemctl enable avahi-daemon systemctl start avahi-daemon - echo "Avahi démarré — accessible via loustiques.local" + echo "Avahi démarré accessible via $(hostname).local" fi \ No newline at end of file