This commit is contained in:
Daniel LaForce 2023-09-28 16:22:25 -06:00
parent 98eaecb45f
commit 231c87a00c
1 changed files with 37 additions and 46 deletions

View File

@ -8,13 +8,9 @@ source config/tools.sh
# Check that required tools are installed
check_utilities
sudo apt install retry -y
SKIP_PULL=0
DEBUG=0
max_retries=10
for i in "$@"; do
case $i in
--no-pull)
@ -74,7 +70,7 @@ fi
echo "[$0] ***** Checking configuration... *****"
retry --max-retries $max_retries -- yq eval -o json config.yaml > config.json
yq eval -o json config.yaml > config.json
if [[ ${CHECK_FOR_OUTDATED_CONFIG} == true ]]; then
nb_services=$(cat config.json | jq '.services | length')
@ -105,7 +101,6 @@ if [[ $(cat config.json | jq '[.services[] | select(.name=="flood" and .enabled=
echo "[$0] ******* Exiting *******"
exit 1
fi
# Determine deluge hostname (for flood) based on the VPN status (enabled or not) of deluge
if [[ $(cat config.json | jq '[.services[] | select(.name=="deluge" and .enabled==true and .vpn==true)] | length') -eq 1 ]]; then
export DELUGE_HOST="gluetun"
@ -286,20 +281,16 @@ echo "[$0] ***** Config OK. Launching services... *****"
if [[ "${SKIP_PULL}" != "1" ]]; then
echo "[$0] ***** Pulling all images... *****"
retry --max-retries $max_retries -- ${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} pull
${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} pull
fi
echo "[$0] ***** Recreating containers if required... *****"
retry --max-retries $max_retries -- ${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} up -d --remove-orphans
${DOCKER_COMPOSE_BINARY} ${ALL_SERVICES} up -d --remove-orphans
echo "[$0] ***** Done updating containers *****"
echo "[$0] ***** Clean unused images and volumes... *****"
retry --max-retries $max_retries -- docker image prune -af
retry --max-retries $max_retries -- docker volume prune -f
docker image prune -af
docker volume prune -f
echo "[$0] ***** Done! *****"
exit 0