25 lines
490 B
Bash
Executable File
25 lines
490 B
Bash
Executable File
#!/bin/bash
|
|
|
|
# Collect exclusions passed as arguments
|
|
exclusions=("$@")
|
|
|
|
for dir in /docker/*/
|
|
do
|
|
# Get the base folder name from path
|
|
folder=$(basename "$dir")
|
|
|
|
# Skip if folder is in the exclusions array
|
|
for exclusion in "${exclusions[@]}"; do
|
|
if [[ "$folder" = "$exclusion" ]]; then
|
|
continue 2
|
|
fi
|
|
done
|
|
|
|
cd "$dir" || {
|
|
echo "Failed to enter directory: $dir"
|
|
continue
|
|
}
|
|
|
|
docker compose down --remove-orphans
|
|
done
|