Skip to content

Instantly share code, notes, and snippets.

@hatsch
Last active March 14, 2023 18:19
Show Gist options
  • Save hatsch/46c6f53362aeadf8747b40111c371e47 to your computer and use it in GitHub Desktop.
Save hatsch/46c6f53362aeadf8747b40111c371e47 to your computer and use it in GitHub Desktop.
output dorftv to the raspberrry pi hdmi port
#!/bin/sh
## play the dorfstream to the HDMI output
## To enable add the following to /etc/rc.local
## sleep 10
## echo localhost > /etc/ansible/hosts
## su - pi -c "git clone https://gist.github.com/46c6f53362aeadf8747b40111c371e47.git bin > /dev/null 2>&1 || echo Already Exists"
## su - pi -c "cd /home/pi/bin ; git pull || echo Error checkout"
## su - pi -c "/bin/sh /home/pi/bin/distribute.sh &"
## su - pi -c "/cd /home/pi/bin ; ansible-playbook playbook.yml"
##
apt-get install ansible -y
SERVICE='omxplayer'
while true; do
if ps ax | grep -v grep | grep $SERVICE > /dev/null
then
echo "running" >> /dev/null
else
omxplayer --no-keys --no-osd -b --loop --timeout 20 -o hdmi https://stream.openplayout.org/hls/dorftv/live_high/index.m3u8
fi
done
---
- hosts: localhost
connection: local
tasks:
- name: Update cron
cron: name="reboot" minute="30" hour="5" month=* day="1" job="sudo reboot"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment