Purpose
If you run multiple Plex servers and want to limit how many concurrent streams a particular user can have across all servers, this script can help. Simply set a threshold (e.g., 2 total streams), and if a user exceeds it (e.g., 3 streams across any combination of servers), the script will terminate all of their active sessions.
- Multi-Server Aware: The script connects to multiple Plex servers (via Tautulli) to check each user’s total streams.
- User Threshold: You decide how many total streams a user is allowed (e.g., 2). If they exceed it, the script automatically kills their sessions.
- Easy Deployment (Unraid): If you’re on Unraid, simply place the script in the User Scripts plugin and schedule or run it as needed.
- Custom Message: When a user is forced off, they’ll see a warning message indicating they exceeded the global limit.
-
Download the Bash script:
plex-session-killer.sh -
Set Threshold & Server Info:
- Edit the script to specify:
- Your Tautulli or Plex server details (API keys and URLs)
- The maximum allowed streams per user.
- Edit the script to specify:
-
Run on Unraid (Optional):
- Go to User Scripts (on Unraid)
- Upload or paste the script
- Set to schedule on startup
The script logs each check and displays:
- How many sessions each user has
- Whether they exceeded the threshold
- Any termination actions taken
When a user is forced to stop their streams, they’ll see a prompt similar to this:
Stay tuned for more features and updates!