mirror of
https://github.com/Crosstalk-Solutions/project-nomad.git
synced 2026-03-30 21:49:26 +02:00
- Add set -euo pipefail to install and update scripts for fail-fast behavior - Escape sed replacement strings to prevent injection via special characters - Add || true guards for commands expected to fail (tr pipe, read prompts) - Validate target_tag in update-watcher to prevent unsafe characters in sed - Properly quote variable assignments to satisfy strict mode https://claude.ai/code/session_01JFvpTYgm8GiE4vJ4cJKsFx
28 lines
687 B
Bash
28 lines
687 B
Bash
#!/bin/bash
|
|
set -euo pipefail
|
|
|
|
echo "Finding running Docker containers for Project N.O.M.A.D..."
|
|
|
|
containers=$(docker ps --filter "name=^nomad_" --format "{{.Names}}")
|
|
|
|
if [ -z "$containers" ]; then
|
|
echo "No running containers found for Project N.O.M.A.D."
|
|
exit 0
|
|
fi
|
|
|
|
echo "Found the following running containers:"
|
|
echo "$containers"
|
|
echo ""
|
|
|
|
for container in $containers; do
|
|
echo "Gracefully stopping container: $container"
|
|
if docker stop "$container"; then
|
|
echo "✓ Successfully stopped $container"
|
|
else
|
|
echo "✗ Failed to stop $container"
|
|
fi
|
|
echo ""
|
|
done
|
|
|
|
echo "Finished initiating graceful shutdown of all Project N.O.M.A.D containers."
|