OverviewFilesCommitsIssuesDocsReleasesPeers

hypercore-kb / opencog-kb / language-learning / chatbot / stop-daemon.sh

16 lines · bash ref:
#!/bin/bash
#
# stop-daemon.sh - Stop the AtomSpace learning daemon
#
if [ -f /tmp/chatbot-daemon.pid ]; then
    PID=$(cat /tmp/chatbot-daemon.pid)
    echo "Stopping daemon (PID: $PID)..."
    kill $PID 2>/dev/null
    rm -f /tmp/chatbot-daemon.pid
    rm -f /tmp/atomspace-chatbot.sock
    echo "Stopped."
else
    echo "No PID file found. Cleaning up socket..."
    rm -f /tmp/atomspace-chatbot.sock
fi