vps/maj.sh
2023-12-03 09:22:27 +00:00

31 lines
626 B
Bash
Executable file

#!/bin/bash
services=(cryptpad etebase mc nginx-www searxng synapse syncthing 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