fix hostname_ip
This commit is contained in:
parent
3bd99f0cfb
commit
6c4477e11d
@ -27,9 +27,12 @@ INFO="${BL}ℹ️${CL}"
|
|||||||
APP="FileBrowser"
|
APP="FileBrowser"
|
||||||
INSTALL_PATH="/usr/local/bin/filebrowser"
|
INSTALL_PATH="/usr/local/bin/filebrowser"
|
||||||
DB_PATH="/usr/local/community-scripts/filebrowser.db"
|
DB_PATH="/usr/local/community-scripts/filebrowser.db"
|
||||||
IP=$(hostname -I | awk '{print $1}')
|
|
||||||
DEFAULT_PORT=8080
|
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
|
# Detect OS
|
||||||
if [[ -f "/etc/alpine-release" ]]; then
|
if [[ -f "/etc/alpine-release" ]]; then
|
||||||
OS="Alpine"
|
OS="Alpine"
|
||||||
@ -161,8 +164,8 @@ depend() {
|
|||||||
}
|
}
|
||||||
EOF
|
EOF
|
||||||
chmod +x "$SERVICE_PATH"
|
chmod +x "$SERVICE_PATH"
|
||||||
rc-update add filebrowser default
|
rc-update add filebrowser default &>/dev/null
|
||||||
rc-service filebrowser start
|
rc-service filebrowser start &>/dev/null
|
||||||
fi
|
fi
|
||||||
msg_ok "Service created successfully"
|
msg_ok "Service created successfully"
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user