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
This commit is contained in:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user