diff --git a/.templates/01-custom_script.sh b/.templates/01-custom_script.sh index a3a845491..a4fb06a67 100755 --- a/.templates/01-custom_script.sh +++ b/.templates/01-custom_script.sh @@ -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() { diff --git a/.templates/ha_entrypoint.sh b/.templates/ha_entrypoint.sh index 8370520e1..fedc5f4af 100755 --- a/.templates/ha_entrypoint.sh +++ b/.templates/ha_entrypoint.sh @@ -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() {