22 lines
423 B
Bash
Executable File
22 lines
423 B
Bash
Executable File
#!/bin/bash
|
|
# play random youtube videos for up to 15 minutes
|
|
|
|
#launch browser on local display
|
|
function launch_browser {
|
|
DISPLAY=:0 /usr/bin/chromium-browser `shuf -n 1 /home/pi/Documents/facebook_url.list` &
|
|
}
|
|
|
|
#prevent race condition/memory exhaustion
|
|
if pgrep -f chromium-browser >/dev/null
|
|
then
|
|
exit 0
|
|
else
|
|
for i in $(seq 13)
|
|
do
|
|
launch_browser
|
|
sleep 10
|
|
done
|
|
sleep 30 && /usr/bin/killall chromium-browser
|
|
fi
|
|
|