Files
local-deep-research/scripts/dev/stop_server.sh
LearningCircuit 309b2a619e Fix shellcheck warnings in all shell scripts
- Quote variables to prevent word splitting (SC2086)
- Use 'read -r' to prevent backslash mangling (SC2162)
- Use 'cd ... || exit' for safe directory changes (SC2164)
- Use '-n' instead of '\! -z' for string checks (SC2236)
- Use pgrep instead of ps | grep (SC2009)
- Check exit codes directly instead of using $? (SC2181)
- Declare and assign separately for exports (SC2155)
- Fix unused loop variables with underscore prefix (SC2034)
- Remove stray markdown backticks from ollama_entrypoint.sh
2025-11-27 19:18:10 +01:00

36 lines
1002 B
Bash
Executable File

#!/bin/bash
# Script to stop the LDR server
echo "Stopping LDR server..."
# Kill the main server process
if pkill -f "python -m local_deep_research.web.app" 2>/dev/null; then
echo "✓ Server stopped successfully"
# Wait a moment for the process to fully terminate
sleep 1
# Check if any processes are still running
if pgrep -f "python -m local_deep_research.web.app" > /dev/null; then
echo "Warning: Some server processes may still be running"
echo "Attempting force stop..."
pkill -9 -f "python -m local_deep_research.web.app" 2>/dev/null
sleep 1
fi
else
echo "No running LDR server found"
fi
# Also stop any orphaned Flask dev servers
pkill -f "flask run" 2>/dev/null
# Check final status
if pgrep -f "python -m local_deep_research.web.app" > /dev/null; then
echo "Error: Server processes still running:"
pgrep -af "python -m local_deep_research.web.app"
exit 1
else
echo "All server processes stopped"
exit 0
fi