1
0
mirror of https://github.com/Radarr/Radarr.git synced 2024-09-28 20:27:21 +02:00

Added update script

hotio 2017-01-23 11:05:15 +01:00
parent 726a6f6b10
commit 646b4d8b00

@ -101,6 +101,27 @@ sudo docker pull linuxserver/radarr
sudo systemctl restart docker-radarr
```
If you want to automate this, you can use the following script (let it run with a systemd timer):
```bash
#!/bin/bash
images=( linuxserver/jackett linuxserver/radarr linuxserver/sonarr )
containers=( jackett radarr sonarr )
services=( docker-jackett docker-radarr docker-sonarr )
for ((i=0; i<${#images[*]}; i++)); do
echo "Pulling docker image: ${images[i]}"
docker pull ${images[i]}
if [[ $(docker inspect --type=image --format='{{.Id}}' ${images[i]}) != $(docker inspect --type=container --format='{{.Image}}' ${containers[i]}) ]]; then
echo "Restarting service: ${services[i]}"
systemctl restart ${services[i]}
fi
done
```
Modify the variables `images`, `containers` and `services` according to your system. This script will only restart a service/container if the docker image was updated by `docker pull`.
# Doing some cleanup
With these commands you can do some cleanup of docker images and containers: