mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-09 09:21:03 +01:00
16 lines
492 B
Plaintext
Executable File
16 lines
492 B
Plaintext
Executable File
#!/usr/bin/with-contenv bashio
|
|
# shellcheck shell=bash
|
|
set -e
|
|
|
|
RUNTIME=$(bashio::config 'run_duration')
|
|
|
|
if bashio::config.has_value 'run_duration'; then
|
|
bashio::log.warning "The run_duration option is set. The addon will stop after $RUNTIME"
|
|
sleep $RUNTIME || bashio::log.fatal "run_duration format is not correct. Use 5d or 5h or 5m for example"
|
|
bashio::log.info "Timeout achieved, addon will stop !"
|
|
sleep 60s
|
|
bashio::addon.stop
|
|
else
|
|
rm -r /etc/services.d/timer
|
|
fi
|