Created
September 13, 2016 17:32
-
-
Save JigSawFr/70d7f95f16f1f6f27528a18e183ee67c to your computer and use it in GitHub Desktop.
PlexPy - Plex Docker Container Restart with Rancher
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# ############# PLEX DOCKER CONTAINER RESTART WITH RANCHER ############# # | |
# ###################################################################### # | |
# Written by JigSawFr <https://github.com/JigSawFr> # | |
# ###################################################################### # | |
# With this script, you can restart your plex container when an update is available, or if plex seems down. | |
# 1. You need to have installed Rancher Management Server (see: https://github.com/rancher/rancher#installation) | |
# 2. You need to have added an host in your Management Interface (Infrastructure -> Host -> Add host) | |
# 3. You need to create an API access to your environnement (API) | |
# 4. Report your ACCESS_KEY, SECRET_KEY, ENDPOINT and PLEX_CONTAINER in vars. | |
# 5. Enable this script on PlexPy and you're fine ! | |
RANCHER_ACCESS_KEY="" | |
RANCHER_SECRET_KEY="" | |
RANCHER_ENDPOINT="" # Example: http://www.my-server.fr:8080/v1/projects/1a5 | |
RANCHER_PLEX_CONTAINER="" # Example: 1i32 | |
# ###################################################################### # | |
# #################### DON'T TOUCH AFTER THIS LINE #################### # | |
# ###################################################################### # | |
curl -u "${RANCHER_ACCESS_KEY}:${RANCHER_SECRET_KEY}" \ | |
-X POST \ | |
-H 'Accept: application/json' \ | |
-H 'Content-Type: application/json' \ | |
-d '{}' \ | |
'${RANCHER_ENDPOINT}/containers/${RANCHER_PLEX_CONTAINER}/?action=restart' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
You can do it w/o 3d party managers: