add runit service files

This commit is contained in:
2025-06-13 00:18:22 +02:00
parent d411e1391b
commit afe80df7e8
3 changed files with 24 additions and 0 deletions

0
poster_display.sh Normal file → Executable file
View File

3
runit/poster_display/log/run Executable file
View File

@@ -0,0 +1,3 @@
#!/bin/sh
exec svlogd -tt /var/log/poster_display

21
runit/poster_display/run Executable file
View File

@@ -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