mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-10 16:01:00 +02:00
Add disable_cron and run_on_startup options to Epic Games Free addon
Co-authored-by: alexbelgium <44178713+alexbelgium@users.noreply.github.com>
This commit is contained in:
@@ -37,6 +37,14 @@ This addon is based on the docker image https://hub.docker.com/r/charlocharlie/e
|
|||||||
|
|
||||||
Addon options expose the `env_vars` field for passing extra environment variables; all other configuration is done via the JSON file.
|
Addon options expose the `env_vars` field for passing extra environment variables; all other configuration is done via the JSON file.
|
||||||
|
|
||||||
|
### Add-on Options
|
||||||
|
|
||||||
|
| Option | Type | Default | Description |
|
||||||
|
|--------|------|---------|-------------|
|
||||||
|
| `run_on_startup` | boolean | `true` | Run a claim cycle when the add-on starts |
|
||||||
|
| `disable_cron` | boolean | `false` | Disable the cron schedule (only run on startup) |
|
||||||
|
| `env_vars` | list | `[]` | Extra environment variables to pass to the container |
|
||||||
|
|
||||||
### Configuration Files
|
### Configuration Files
|
||||||
|
|
||||||
Configuration files are stored in `/config/addons_config/epicgamesfree/`:
|
Configuration files are stored in `/config/addons_config/epicgamesfree/`:
|
||||||
|
|||||||
@@ -75,6 +75,8 @@ map:
|
|||||||
name: Epic Games Free
|
name: Epic Games Free
|
||||||
options:
|
options:
|
||||||
env_vars: []
|
env_vars: []
|
||||||
|
run_on_startup: true
|
||||||
|
disable_cron: false
|
||||||
ports:
|
ports:
|
||||||
3000/tcp: 3000
|
3000/tcp: 3000
|
||||||
ports_description:
|
ports_description:
|
||||||
@@ -83,6 +85,8 @@ schema:
|
|||||||
env_vars:
|
env_vars:
|
||||||
- name: match(^[A-Za-z0-9_]+$)
|
- name: match(^[A-Za-z0-9_]+$)
|
||||||
value: str?
|
value: str?
|
||||||
|
run_on_startup: bool?
|
||||||
|
disable_cron: bool?
|
||||||
slug: epicgamesfree
|
slug: epicgamesfree
|
||||||
udev: true
|
udev: true
|
||||||
url: https://github.com/alexbelgium/hassio-addons
|
url: https://github.com/alexbelgium/hassio-addons
|
||||||
|
|||||||
@@ -28,6 +28,27 @@ fi
|
|||||||
# Permissions
|
# Permissions
|
||||||
chmod -R 777 "$HOME"
|
chmod -R 777 "$HOME"
|
||||||
|
|
||||||
|
######################
|
||||||
|
# APPLY ADDON CONFIG #
|
||||||
|
######################
|
||||||
|
|
||||||
|
# Handle run_on_startup option
|
||||||
|
if bashio::config.has_value "run_on_startup"; then
|
||||||
|
if bashio::config.true "run_on_startup"; then
|
||||||
|
bashio::log.info "run_on_startup is enabled"
|
||||||
|
jq '.runOnStartup = true' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
|
||||||
|
else
|
||||||
|
bashio::log.info "run_on_startup is disabled"
|
||||||
|
jq '.runOnStartup = false' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
|
||||||
|
fi
|
||||||
|
fi
|
||||||
|
|
||||||
|
# Handle disable_cron option
|
||||||
|
if bashio::config.true "disable_cron"; then
|
||||||
|
bashio::log.info "Cron schedule is disabled - the addon will only run on startup"
|
||||||
|
jq 'del(.cronSchedule)' "$CONFIG_JSON" > "${CONFIG_JSON}.tmp" && mv "${CONFIG_JSON}.tmp" "$CONFIG_JSON"
|
||||||
|
fi
|
||||||
|
|
||||||
##############
|
##############
|
||||||
# Launch App #
|
# Launch App #
|
||||||
##############
|
##############
|
||||||
|
|||||||
Reference in New Issue
Block a user