project-nomad/install/start_nomad.sh
Claude 9ca20a99e5
fix: harden shell scripts with set -euo pipefail and safe sed substitution
- 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
2026-03-24 09:30:42 +00:00

29 lines
704 B
Bash

#!/bin/bash
set -euo pipefail
echo "Finding Project N.O.M.A.D containers..."
# -a to include all containers (running and stopped)
containers=$(docker ps -a --filter "name=^nomad_" --format "{{.Names}}")
if [ -z "$containers" ]; then
echo "No containers found for Project N.O.M.A.D. Is it installed?"
exit 0
fi
echo "Found the following containers:"
echo "$containers"
echo ""
for container in $containers; do
echo "Starting container: $container"
if docker start "$container"; then
echo "✓ Successfully started $container"
else
echo "✗ Failed to start $container"
fi
echo ""
done
echo "Finished initiating start of all Project N.O.M.A.D containers."