mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-25 23:41:45 +01:00
Fix shebang probe rejecting valid interpreters when Supervisor API returns empty
The probe script requires bashio::addon.version to return non-empty output, but the Supervisor API may not be ready during container init. This causes all shebang candidates to be rejected even though the interpreter works fine. Fix: output a 'PROBE_OK' marker when the script executes successfully but the version is empty. Also check /.bashio-standalone.sh as fallback path (some containers store it there instead of /usr/local/lib/). Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
@@ -71,13 +71,16 @@ _rc=$?
|
||||
set -e
|
||||
|
||||
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
||||
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
|
||||
. /usr/local/lib/bashio-standalone.sh
|
||||
_bv="$(bashio::addon.version)"
|
||||
fi
|
||||
for _sf in /usr/local/lib/bashio-standalone.sh /.bashio-standalone.sh; do
|
||||
if [ -f "$_sf" ]; then
|
||||
. "$_sf"
|
||||
_bv="$(bashio::addon.version 2>/dev/null || true)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "$_bv"
|
||||
echo "${_bv:-PROBE_OK}"
|
||||
'
|
||||
|
||||
validate_shebang() {
|
||||
|
||||
@@ -90,14 +90,17 @@ _rc=$?
|
||||
set -e
|
||||
|
||||
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
||||
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
|
||||
# shellcheck disable=SC1091
|
||||
. /usr/local/lib/bashio-standalone.sh
|
||||
_bv="$(bashio::addon.version)"
|
||||
fi
|
||||
for _sf in /usr/local/lib/bashio-standalone.sh /.bashio-standalone.sh; do
|
||||
if [ -f "$_sf" ]; then
|
||||
# shellcheck disable=SC1090
|
||||
. "$_sf"
|
||||
_bv="$(bashio::addon.version 2>/dev/null || true)"
|
||||
break
|
||||
fi
|
||||
done
|
||||
fi
|
||||
|
||||
echo "$_bv"
|
||||
echo "${_bv:-PROBE_OK}"
|
||||
'
|
||||
|
||||
validate_shebang() {
|
||||
|
||||
Reference in New Issue
Block a user