From 4e7d763848e1443f6511a88627ebc468d942832d Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Fri, 12 Feb 2021 15:17:57 +0100 Subject: [PATCH] Update and rename scrutiny/rootfs/etc/periodic/weekly/run to scrutiny/rootfs/etc/cont-init.d/99-run --- scrutiny/rootfs/etc/cont-init.d/99-run | 32 +++++++++++++++++++++++++ scrutiny/rootfs/etc/periodic/weekly/run | 30 ----------------------- 2 files changed, 32 insertions(+), 30 deletions(-) create mode 100644 scrutiny/rootfs/etc/cont-init.d/99-run delete mode 100644 scrutiny/rootfs/etc/periodic/weekly/run diff --git a/scrutiny/rootfs/etc/cont-init.d/99-run b/scrutiny/rootfs/etc/cont-init.d/99-run new file mode 100644 index 000000000..bc900aa39 --- /dev/null +++ b/scrutiny/rootfs/etc/cont-init.d/99-run @@ -0,0 +1,32 @@ +#!/usr/bin/with-contenv bashio + +#################### +# Add local drives # +#################### + +scrutiny-collector-metrics run || bashio::log.error "Local devices not seen" + +#port="8080" +#host="localhost" +#timeout="30" +#timeout_argument="" + +#if timeout -t 1337 true >/dev/null 2>&1; then + timeout_argument="-t" +#fi + +#timeout ${timeout_argument} "${timeout}" \ +#bash -c \ +#"until echo > /dev/tcp/${host}/${port} ; do sleep 0.5; done" \ +#>/dev/null 2>&1 && bash -c "scrutiny-collector-metrics run" \ +#|| bashio::log.error "port $port is not available, local devices won't be available" + +############## +# CHECK PRIV # +############## + +#ip link delete dummy0 type dummy >/dev/null || true +#ip link add dummy0 type dummy >/dev/null \ +# || bashio::log.error "Privileged mode is disabled, the addon will stop"; \ +# bashio::log.error "sending TERM signal"; \ +# s6-svscanctl -t /var/run/s6/services diff --git a/scrutiny/rootfs/etc/periodic/weekly/run b/scrutiny/rootfs/etc/periodic/weekly/run deleted file mode 100644 index 071eb95ef..000000000 --- a/scrutiny/rootfs/etc/periodic/weekly/run +++ /dev/null @@ -1,30 +0,0 @@ -#!/usr/bin/with-contenv bashio - -#################### -# Add local drives # -#################### - -port="8080" -host="localhost" -timeout="30" -timeout_argument="" - -if timeout -t 1337 true >/dev/null 2>&1; then - timeout_argument="-t" -fi - -timeout ${timeout_argument} "${timeout}" \ -bash -c \ -"until echo > /dev/tcp/${host}/${port} ; do sleep 0.5; done" \ ->/dev/null 2>&1 && bash -c "scrutiny-collector-metrics run" \ -|| bashio::log.error "port $port is not available, local devices won't be available" - -############## -# CHECK PRIV # -############## - -#ip link delete dummy0 type dummy >/dev/null || true -#ip link add dummy0 type dummy >/dev/null \ -# || bashio::log.error "Privileged mode is disabled, the addon will stop"; \ -# bashio::log.error "sending TERM signal"; \ -# s6-svscanctl -t /var/run/s6/services