Skip to content

Instantly share code, notes, and snippets.

@Jbithell
Last active August 16, 2022 17:15
Show Gist options
  • Save Jbithell/d228b54c20c39040affe1f16c75a3509 to your computer and use it in GitHub Desktop.
Save Jbithell/d228b54c20c39040affe1f16c75a3509 to your computer and use it in GitHub Desktop.
Boot a raspberry Pi into VLC
SHELL=/bin/bash
MAILTO=""
@reboot $HOME/monitor boot >> "$HOME/log/monitor.log" 2>&1
*/1 * * * * $HOME/monitor >> "$HOME/log/monitor.log" 2>&1
#/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
@Jbithell
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment