This script below allows you to create a cron job to auto update your Plex server running on Debian/Ubuntu. The script will automatically check to see if anyone is streaming before updating.

To find your plex token, you can login to your server and go to the update tab and right click and copy the "Please install manually" link address. In this address you will find your plex token at the end.