mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-06-10 09:35:58 +02: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
|
set -e
|
||||||
|
|
||||||
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
||||||
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
|
for _sf in /usr/local/lib/bashio-standalone.sh /.bashio-standalone.sh; do
|
||||||
. /usr/local/lib/bashio-standalone.sh
|
if [ -f "$_sf" ]; then
|
||||||
_bv="$(bashio::addon.version)"
|
. "$_sf"
|
||||||
fi
|
_bv="$(bashio::addon.version 2>/dev/null || true)"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$_bv"
|
echo "${_bv:-PROBE_OK}"
|
||||||
'
|
'
|
||||||
|
|
||||||
validate_shebang() {
|
validate_shebang() {
|
||||||
|
|||||||
@@ -90,14 +90,17 @@ _rc=$?
|
|||||||
set -e
|
set -e
|
||||||
|
|
||||||
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
if [ "$_rc" -ne 0 ] || [ -z "$_bv" ] || [ "$_bv" = "null" ]; then
|
||||||
if [ -f /usr/local/lib/bashio-standalone.sh ]; then
|
for _sf in /usr/local/lib/bashio-standalone.sh /.bashio-standalone.sh; do
|
||||||
# shellcheck disable=SC1091
|
if [ -f "$_sf" ]; then
|
||||||
. /usr/local/lib/bashio-standalone.sh
|
# shellcheck disable=SC1090
|
||||||
_bv="$(bashio::addon.version)"
|
. "$_sf"
|
||||||
fi
|
_bv="$(bashio::addon.version 2>/dev/null || true)"
|
||||||
|
break
|
||||||
|
fi
|
||||||
|
done
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$_bv"
|
echo "${_bv:-PROBE_OK}"
|
||||||
'
|
'
|
||||||
|
|
||||||
validate_shebang() {
|
validate_shebang() {
|
||||||
|
|||||||
Reference in New Issue
Block a user