mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-03-12 16:10:41 +01:00
Try timeout option
This commit is contained in:
@@ -26,7 +26,7 @@ UPSTREAM=$(bashio::config 'upstream')
|
||||
|
||||
mv -f /data/joal/config.json / || true
|
||||
|
||||
curl -s -S -L -o /tmp/joal.tar.gz "https://github.com/anthonyraymond/joal/releases/download/${UPSTREAM}/joal.tar.gz" >/dev/null
|
||||
curl -L -o /tmp/joal.tar.gz "https://github.com/anthonyraymond/joal/releases/download/${UPSTREAM}/joal.tar.gz"
|
||||
mkdir -p /data/joal
|
||||
tar zxvf /tmp/joal.tar.gz -C /data/joal >/dev/null
|
||||
chown -R $(id -u):$(id -g) /data/joal
|
||||
@@ -41,6 +41,19 @@ mv -f /config.json /data/joal/ || true
|
||||
nohup java -jar /joal/joal.jar --joal-conf=/data/joal --spring.main.web-environment=true --server.port="8081" --joal.ui.path.prefix="joal" --joal.ui.secret-token=$TOKEN \
|
||||
& bashio::log.info "... Joal started with secret token $TOKEN"
|
||||
# Wait for transmission to become available
|
||||
bashio::net.wait_for 8081 localhost 900
|
||||
bashio::log.info "... starting NGinx"
|
||||
exec nginx || bashio::log.fatal "... Nginx not started, only access through webui available"
|
||||
bashio::net.wait_for 8081 localhost 900 || true
|
||||
exec nginx || bashio::log.fatal "... Nginx not started, only access through webui available" \
|
||||
& bashio::log.info "... Nginx started for Ingress"
|
||||
|
||||
###########
|
||||
# TIMEOUT #
|
||||
###########
|
||||
|
||||
if bashio::config.has_value 'run_for_hours'; then
|
||||
RUNTIME=$(bashio::config 'run_for_hours')
|
||||
bashio::log.info "... Addon will stop after $RUNTIME hours"
|
||||
sleep $TIMEOUT && kill "$PID"
|
||||
else
|
||||
bashio::log.info "... run_for_hours option not defined, addon will run continuously
|
||||
fi"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user