mirror of
https://github.com/LearningCircuit/local-deep-research.git
synced 2026-06-16 20:10:39 +03:00
- 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
36 lines
1002 B
Bash
Executable File
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
|