Restart Roku Nightly

When I was kid, my dad got mad when I forgot to turn off the lights when leaving a room. Shutting off bandwidth usage when not in use is the modern day equivalent of shutting off the lights.

As an example, if someone is watching a Roku channel and shuts off the TV without going to Roku's home page, then the channel will continue to stream.

Here are some other reasons to reboot Roku from a script:

A major issue with cord cutting is the number of streams for a service are limited. So, everyone should shut off a stream when it is not in use. But, every once in a while someone forgets to go to the home menu on a Roku.

My Rokus perform better if they are periodically restarted.

My cord cutting system has two devices connected to each TV:

Raspberry Pi running Kodi on OSMC for over-the-air TV. [Note: I was using SlingTV, which did not have local channels. DirecTV has local channels, but doesn't have the CW where I live]

Roku serves premium content: DirecTV with HBO, Amazon and Netflix.

The TVheadend server has four digital tuners running on ubuntu. On roku.com, I changed the names of the Rokus. My Family Room Roku was originally named Roku-701. I renamed it by logging in to roku.com, going to My Account and clicking on Rename.

This script to reboot Roku can run on any linux server, including Raspberry Pi or my ubuntu TV server.

The script could be easily modified to do other things like enforce time limits by shutting off a Roku, instead of restarting it.

Step 1. Select a linux system to run the script

I run this script on my TVheadend server

Step 2. Install nmap

Open a terminal window on a laptop and ssh into the server, then run the command:

$ sudo apt-get install nmap

Step 3. Download the script and make it executable

Open a terminal window on a laptop and ssh into the server, then run the commands:

$ cd /usr/bin

$ sudo wget https://raw.githubusercontent.com/dumbo25/cord-cutter/master/roku_reboot.sh

$ sudo chmod +x /usr/bin/roku_reboot.sh

See if it works. Turn on a Roku and run the script

Step 4. Create a crontab to run the script

Create a cron job to run the script:

$ sudo crontab -e

And add the lines:

# reboot all Rokus at 2am every night

0 2 * * * bash /usr/bin/roku_reboot.sh >/dev/null 2&>&1

Step 5. Don't let a middle of the night reboot turn on the TV

In Roku go to Settings, System, Control other devices and unclick 1-touch play. Otherwise, when the Roku reboots in the middle of the night it might wake up the people in the room

And your done!