1
0
Fork 0
mirror of https://github.com/sdr-enthusiasts/docker-adsb-ultrafeeder.git synced 2024-11-23 22:30:09 +00:00
docker-adsb-ultrafeeder/rootfs/etc/s6-overlay/scripts/prometheus-readsb

17 lines
542 B
Text
Raw Normal View History

2023-08-31 02:59:09 +00:00
#!/command/with-contenv bash
2023-04-08 21:07:11 +00:00
# shellcheck shell=bash disable=SC1091
2023-03-28 20:01:27 +00:00
2023-04-08 21:07:11 +00:00
source /scripts/common
if chk_enabled "$PROMETHEUS_ENABLE"; then
2023-03-28 20:01:27 +00:00
while [[ ! -f /run/readsb-prometheus.prom ]]
do
sleep 1
done
trap "pkill -P $$ || true; s6wrap --timestamps --prepend=prometheus-readsb --quiet --args echo 'service stopping'; exit 0" SIGTERM SIGINT SIGHUP SIGQUIT
echo -e "HTTP/1.1 200 OK\nContent-Type: text/plain\n\n$(cat /run/readsb-prometheus.prom)" | ncat -l 9274 > /dev/null 2>&1 &
wait
2023-03-28 20:01:27 +00:00
else
exec sleep infinity
2023-03-28 20:01:27 +00:00
fi