mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-13 11:21:02 +01:00
Create timer
This commit is contained in:
14
qbittorrent/rootfs/etc/services.d/nginx/timer
Normal file
14
qbittorrent/rootfs/etc/services.d/nginx/timer
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/with-contenv bashio
|
||||
# shellcheck shell=bash
|
||||
|
||||
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
|
||||
Reference in New Issue
Block a user