vps/maj.sh

32 lines
597 B
Bash
Raw Normal View History

2023-11-22 08:26:10 +01:00
#!/bin/bash
2023-11-22 17:55:29 +01:00
services=(nginx-rp nginx-www searxng vw)
2023-11-22 08:26:10 +01:00
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