Simplify run_on_startup handling for consistency

Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
copilot-swe-agent[bot]
2025-12-04 14:45:38 +00:00
parent 893e3ced2c
commit 9a55232bba

View File

@@ -33,14 +33,12 @@ chmod -R 777 "$HOME"
###################### ######################
# Handle run_on_startup option # Handle run_on_startup option
if bashio::config.has_value "run_on_startup"; then if bashio::config.true "run_on_startup"; then
if bashio::config.true "run_on_startup"; then bashio::log.info "run_on_startup is enabled"
bashio::log.info "run_on_startup is enabled" jq '.runOnStartup = true' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
jq '.runOnStartup = true' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON" else
else bashio::log.info "run_on_startup is disabled"
bashio::log.info "run_on_startup is disabled" jq '.runOnStartup = false' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
jq '.runOnStartup = false' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
fi
fi fi
# Handle disable_cron option # Handle disable_cron option