When my MBP is at my desk at home, it’s connected to an external HD that contains media. I have a Plex server configured to use that drive, but I don’t always keep the drive mounted or the Plex server running. I’ve set things up so that I can start or stop the Plex server from my iPhone, rather than having to run upstairs to my office when I realize it’s not running. I have done the following:
On the Mac:
Set up 2 actions in Keyboard Maestro: Start Plex and Stop Plex.
- Start Plex:
- Execute shell script: diskutil mount “Media”
- Run application: /Applications/Plex Media Server.app
- Stop Plex:
- Quit “Plex Media Server”
- Execute script: diskutil unmount “Media”
Each of these is set up with a Shared Web Trigger - this gives you a unique URL on triggers.keyboardmastro.com that will execute the macro in question from anywhere.
(See here for details: https://wiki.keyboardmaestro.com/trigger/Remote). The URL will return 0 if the action field, or 1 if the action succeeded.
On iOS:
Use Workflow to create 2 actions: Plex On and Plex Off. Each action simply opens the corresponding URL on triggers.keyboardmaestro.com, which then causes the corresponding macro to run on the Mac.
I have the 2 actions saved as Springboard icons.