Skip to content

Instantly share code, notes, and snippets.

@jgillman
Created June 3, 2014 04:56
Show Gist options
  • Save jgillman/4d3975ab5aa10d6460a1 to your computer and use it in GitHub Desktop.
Save jgillman/4d3975ab5aa10d6460a1 to your computer and use it in GitHub Desktop.
A quick and dirty shell script to turn on the Lightpack, launch Plex, then turn off the Lightpack when Plex exits.
#!/bin/bash
# A quick and dirty shell script to turn on the Lightpack, launch Plex, then
# turn off the Lightpack when Plex exits.
# Turn on Lightpack
(sleep 1; echo "lock"; echo "setstatus:on"; sleep 1; echo "exit") \
| telnet 127.0.0.1 3636;
# Launch Plex Home Theater, and turn off Lightpack on exit
"/Applications/Plex Home Theater.app/Contents/MacOS/Plex Home Theater" \
&& (sleep 1; echo "lock"; echo "setstatus:off"; sleep 1; echo "exit") \
| telnet 127.0.0.1 3636
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment