Files
dotfiles/.bin/docker-restart-all-containers

30 lines
534 B
Bash
Executable File

#!/usr/bin/env bash
readonly = DOCKER_FOLDER="/srv/"
function ok()
{
echo -e "\e[32mdone\e[0m"
}
function failed()
{
echo -e "\e[31mfailed\e[0m"
}
function main() {
container_list=$(find "${DOCKER_FOLDER}" -mindepth 1 -maxdepth 1 -type d ! -iname "archives" ! -iname "images" ! -iname "lost+found")
for container_path in ${container_list}; do
cd "${container_path}"
docker compose down \
&& docker compose stop \
&& docker compose up -d
cd - &>/dev/null
done
}
main