mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-15 17:08:19 +01:00
Update and rename scrutiny/rootfs/etc/periodic/weekly/run to scrutiny/rootfs/etc/cont-init.d/99-run
This commit is contained in:
32
scrutiny/rootfs/etc/cont-init.d/99-run
Normal file
32
scrutiny/rootfs/etc/cont-init.d/99-run
Normal file
@@ -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
|
||||
@@ -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
|
||||
Reference in New Issue
Block a user