From 6c4477e11de5078ab35bbaa2e5a0d28b3c0b4066 Mon Sep 17 00:00:00 2001 From: CanbiZ <47820557+MickLesk@users.noreply.github.com> Date: Tue, 11 Mar 2025 08:48:44 +0100 Subject: [PATCH] fix hostname_ip --- misc/filebrowser.sh | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/misc/filebrowser.sh b/misc/filebrowser.sh index a87f4f5..9c66b0b 100644 --- a/misc/filebrowser.sh +++ b/misc/filebrowser.sh @@ -27,9 +27,12 @@ INFO="${BL}ℹ️${CL}" APP="FileBrowser" INSTALL_PATH="/usr/local/bin/filebrowser" DB_PATH="/usr/local/community-scripts/filebrowser.db" -IP=$(hostname -I | awk '{print $1}') DEFAULT_PORT=8080 +# Get first non-loopback IP +IP=$(hostname -I | awk '{print $1}') +[[ -z "$IP" ]] && IP="127.0.0.1" # Fallback auf localhost, falls keine IP gefunden wird + # Detect OS if [[ -f "/etc/alpine-release" ]]; then OS="Alpine" @@ -161,8 +164,8 @@ depend() { } EOF chmod +x "$SERVICE_PATH" - rc-update add filebrowser default - rc-service filebrowser start + rc-update add filebrowser default &>/dev/null + rc-service filebrowser start &>/dev/null fi msg_ok "Service created successfully"