Last active
August 16, 2022 17:15
-
-
Save Jbithell/d228b54c20c39040affe1f16c75a3509 to your computer and use it in GitHub Desktop.
Boot a raspberry Pi into VLC
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
SHELL=/bin/bash | |
MAILTO="" | |
@reboot $HOME/monitor boot >> "$HOME/log/monitor.log" 2>&1 | |
*/1 * * * * $HOME/monitor >> "$HOME/log/monitor.log" 2>&1 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#/bin/bash | |
PROG="VLC_STARTER" | |
IP="" | |
ID="" | |
PASS="" | |
export DISPLAY=:0 | |
[ "$1" = "boot" ] && STARTUP_SLEEP=60 | |
MUTEX="/tmp/$PROG.running" | |
exec 9>"$MUTEX" | |
flock --exclusive --nonblock 9 | |
[ $? -eq 0 ] || exit # Somebody has stolen the lock! | |
# Sleep some time till the network and the system clock are stabilized | |
[ -n "$STARTUP_SLEEP" ] && { | |
echo "Waiting the system becomes stable" >&9 | |
echo "Waiting the system becomes stable " | |
sleep $STARTUP_SLEEP | |
STARTUP_SLEEP= | |
} | |
vlc -f rtsp://${ID}:${PASS}@${IP}/Streaming/channels/101 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Inspired by https://gist.github.com/kndt84/7a6984a0ee0b85db1a7c5c5de495283e