add runit service files
This commit is contained in:
0
poster_display.sh
Normal file → Executable file
0
poster_display.sh
Normal file → Executable file
3
runit/poster_display/log/run
Executable file
3
runit/poster_display/log/run
Executable file
@@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
|
||||||
|
exec svlogd -tt /var/log/poster_display
|
||||||
21
runit/poster_display/run
Executable file
21
runit/poster_display/run
Executable 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
|
||||||
Reference in New Issue
Block a user