diff --git a/addons_updater/rootfs/etc/cont-init.d/99-run.sh b/addons_updater/rootfs/etc/cont-init.d/99-run.sh index 66b8f8255..eaab3dc77 100755 --- a/addons_updater/rootfs/etc/cont-init.d/99-run.sh +++ b/addons_updater/rootfs/etc/cont-init.d/99-run.sh @@ -198,12 +198,10 @@ for f in */; do else LOGINFO="... $SLUG : beta is off" && if [ "$VERBOSE" = true ]; then bashio::log.info "$LOGINFO"; fi fi - - #Execute version search - # shellcheck disable=SC2086 - LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS 2>&1)" || \ + # If failure, checks if there is packages that could be used - { if [[ "$SOURCE" == "github" ]] && [[ ${LASTVERSION,,} == *"no release found"* ]]; then + function test_packages () { + if [[ "$SOURCE" == "github" ]] && [[ ${LASTVERSION,,} == *"no release found"* ]]; then # Is there a package echo "No version found, looking if packages available" last_packages="$(curl -s https://github.com/$REPOSITORY/packages | sed -n "s/.*\/container\/package\/\([^\"]*\).*/\1/p")" || true @@ -232,6 +230,11 @@ for f in */; do # Continue to next continue fi } + + #Execute version search + # shellcheck disable=SC2086 + LASTVERSION="$(lastversion "$UPSTREAM" $ARGUMENTS 2>&1 || test_packages)" + fi # Add brackets