mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-17 19:40:31 +02:00
Merge pull request #2700 from alexbelgium/copilot/fix-unbound-variable-error
qbittorrent: fix LSIO_NON_ROOT_USER unbound variable crash on startup
This commit is contained in:
@@ -1,4 +1,7 @@
|
||||
|
||||
## 5.2.0-4 (2026-05-10)
|
||||
- Fix "unbound variable" crash: use \`${LSIO_NON_ROOT_USER:-}\` so the variable is safely empty when unset; remove duplicate QB_BIN detection block
|
||||
|
||||
## 5.2.0-3 (2026-05-10)
|
||||
- Fix qBittorrent restart loop: remove s6-notifyoncheck (notification-fd 3 EBADF when not running under s6-rc), discover binary path dynamically across LSIO image layouts, remove `/dev/stdout` redirect that fails on some ARM runtimes, align with upstream LSIO run script (WebUI address from config, LSIO_NON_ROOT_USER)
|
||||
- Fix Dockerfile: add missing `-i` flag to `sed '11,13d'` so default config lines are actually removed at build time
|
||||
|
||||
@@ -143,4 +143,4 @@ schema:
|
||||
slug: qbittorrent
|
||||
udev: true
|
||||
url: https://github.com/alexbelgium/hassio-addons
|
||||
version: "5.2.0-3"
|
||||
version: "5.2.0-4"
|
||||
|
||||
@@ -1,6 +1,8 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
set +u
|
||||
|
||||
WEBUI_PORT=${WEBUI_PORT:-8080}
|
||||
export PATH="/usr/local/sbin:/usr/local/bin:${PATH}"
|
||||
|
||||
@@ -56,20 +58,6 @@ if [[ -z "${QB_BIN}" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Find qbittorrent-nox binary across different LSIO image layouts
|
||||
QB_BIN=""
|
||||
for candidate in /app/qbittorrent-nox /usr/bin/qbittorrent-nox /usr/local/bin/qbittorrent-nox; do
|
||||
if [[ -x "${candidate}" ]]; then
|
||||
QB_BIN="${candidate}"
|
||||
break
|
||||
fi
|
||||
done
|
||||
|
||||
if [[ -z "${QB_BIN}" ]]; then
|
||||
bashio::log.fatal "qbittorrent-nox binary not found"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
bashio::log.info "Starting qBittorrent..."
|
||||
|
||||
# Suppress output in silent mode by redirecting the current shell's stdout/stderr
|
||||
@@ -79,7 +67,7 @@ if bashio::config.true 'silent'; then
|
||||
exec >/dev/null 2>&1
|
||||
fi
|
||||
|
||||
if [[ -z ${LSIO_NON_ROOT_USER} ]]; then
|
||||
if [[ -z ${LSIO_NON_ROOT_USER:-} ]]; then
|
||||
exec s6-setuidgid abc "${QB_BIN}" --webui-port="${WEBUI_PORT}"
|
||||
else
|
||||
exec "${QB_BIN}" --webui-port="${WEBUI_PORT}"
|
||||
|
||||
Reference in New Issue
Block a user