From afe80df7e81f89faba95d8af90e8461dc48a9499 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?David=20Z=C3=A1le=C5=A1=C3=A1k?= Date: Fri, 13 Jun 2025 00:18:22 +0200 Subject: [PATCH] add runit service files --- poster_display.sh | 0 runit/poster_display/log/run | 3 +++ runit/poster_display/run | 21 +++++++++++++++++++++ 3 files changed, 24 insertions(+) mode change 100644 => 100755 poster_display.sh create mode 100755 runit/poster_display/log/run create mode 100755 runit/poster_display/run diff --git a/poster_display.sh b/poster_display.sh old mode 100644 new mode 100755 diff --git a/runit/poster_display/log/run b/runit/poster_display/log/run new file mode 100755 index 0000000..14ab72a --- /dev/null +++ b/runit/poster_display/log/run @@ -0,0 +1,3 @@ +#!/bin/sh + +exec svlogd -tt /var/log/poster_display diff --git a/runit/poster_display/run b/runit/poster_display/run new file mode 100755 index 0000000..1f9b4bf --- /dev/null +++ b/runit/poster_display/run @@ -0,0 +1,21 @@ +#!/bin/sh + +REMOTE_URL="http://217.115.244.100/tvpresentation/" + +USER=tv +export XDG_RUNTIME_DIR=/run/user/$(id -u "$USER") + +export WAYLAND_DISPLAY=wayland-1 + +# počkej na dostupnost sítě / serveru (max 60 sekund) +for i in $(seq 1 60); do + if wget --spider -q "$REMOTE_URL"; then + echo "Síť dostupná, spouštím prezentaci" + exec chpst -u $USER /usr/local/bin/plakaty.sh + fi + echo "Čekám na síť ($i/60)..." + sleep 1 +done + +echo "Síť nebyla dostupná, končím se chybou" +exit 1