#!/bin/bash services=(nginx-rp nginx-www vw) if [[ ! $(echo "${services[*]} all" | grep -P "\b$1\b" ) ]]; then echo "Wrong argument." exit 1 fi rel_path="$(dirname "$0")" case "$1" in vw|all) sudo "$rel_path/vw/backup.sh" || exit 1 ;; esac if [[ "$1" != "all" ]]; then docker-compose -f "$rel_path/$1/docker-compose.yaml" pull docker-compose -f "$rel_path/$1/docker-compose.yaml" up -d else for service in "${services[@]}"; do docker-compose -f "$rel_path/$service/docker-compose.yaml" pull docker-compose -f "$rel_path/$service/docker-compose.yaml" up -d done fi