From ced9c14add655c997e107ea7360635be0533f2c1 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?M=C4=83rcziem=20=E2=84=A2?= <118485377+spalencsar@users.noreply.github.com> Date: Mon, 6 Oct 2025 11:10:52 +0200 Subject: [PATCH] Fix IP address detection in Portainer for cross-distribution compatibility - Replace hostname -I with ip addr parsing for better compatibility - hostname command may not be available or behave differently on some systems --- lib/portainer.sh | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/lib/portainer.sh b/lib/portainer.sh index d8a9e9d..b4f9257 100644 --- a/lib/portainer.sh +++ b/lib/portainer.sh @@ -45,7 +45,9 @@ install_portainer() { sleep 5 log_success "Portainer wurde erfolgreich installiert und läuft auf Port 9000 (HTTP) und 9443 (HTTPS)." - log_info "Portainer ist nun verfügbar unter: https://$(hostname -I | awk '{print $1}'):9443" + local ip_address + ip_address=$(ip addr show | grep 'inet ' | grep -v '127.0.0.1' | head -1 | awk '{print $2}' | cut -d/ -f1) + log_info "Portainer ist nun verfügbar unter: https://${ip_address}:9443" } # Logging-Funktionen bereitstellen, falls nicht vorhanden