mirror of
https://github.com/acedanger/shell.git
synced 2025-12-06 00:00:13 -08:00
2.1 KiB
2.1 KiB
Plex Management Script Documentation
This document provides an overview and step-by-step explanation of the plex.sh script. This script is used to manage the Plex Media Server service on a systemd-based Linux distribution.
Script Overview
The script performs the following main tasks:
- Starts the Plex Media Server.
- Stops the Plex Media Server.
- Restarts the Plex Media Server.
- Displays the current status of the Plex Media Server.
Detailed Steps
1. Start Plex Media Server
start_plex() {
sudo systemctl start plexmediaserver
echo "Plex Media Server started."
}
This function starts the Plex Media Server using systemctl.
2. Stop Plex Media Server
stop_plex() {
sudo systemctl stop plexmediaserver
echo "Plex Media Server stopped."
}
This function stops the Plex Media Server using systemctl.
3. Restart Plex Media Server
restart_plex() {
sudo systemctl restart plexmediaserver
echo "Plex Media Server restarted."
}
This function restarts the Plex Media Server using systemctl.
4. Display Plex Media Server Status
status_plex() {
sudo systemctl status plexmediaserver
}
This function displays the current status of the Plex Media Server using systemctl.
Usage
To use the script, run it with one of the following parameters:
./plex.sh {start|stop|restart|status}
start: Starts the Plex Media Server.stop: Stops the Plex Media Server.restart: Restarts the Plex Media Server.status: Displays the current status of the Plex Media Server.
Important Information
- Ensure that the script is executable. You can make it executable with the following command:
chmod +x plex.sh - The script uses
systemctlto manage the Plex Media Server service. Ensure thatsystemctlis available on your system. - The script requires
sudoprivileges to manage the Plex Media Server service. Ensure that you have the necessary permissions to run the script withsudo.
By following this documentation, you should be able to understand and use the plex.sh script effectively.