Shell
#!/bin/bash
# Quick Comet management helper
# Usage: comet-quick.sh [start|stop|status|restart]
LAUNCH_SCRIPT="$HOME/mcp-comet-bridge/launch-comet-debug.sh"
case "$1" in
start)
if lsof -i :9222 > /dev/null 2>&1; then
echo "β
Comet is already running with debug port"
else
if [ -f "$LAUNCH_SCRIPT" ]; then
echo "π Launching Comet with debug port..."
"$LAUNCH_SCRIPT"
else
echo "β Launch script not found at: $LAUNCH_SCRIPT"
exit 1
fi
fi
;;
stop)
if lsof -i :9222 > /dev/null 2>&1; then
echo "π Stopping Comet..."
pkill -f "Comet.*remote-debugging-port=9222"
sleep 1
if lsof -i :9222 > /dev/null 2>&1; then
echo "β οΈ Comet still running, force killing..."
pkill -9 -f "Comet.*remote-debugging-port=9222"
fi
echo "β
Comet stopped"
else
echo "βΉοΈ Comet is not running"
fi
;;
status)
if lsof -i :9222 > /dev/null 2>&1; then
echo "β
Comet is running with debug port on :9222"
else
echo "β Comet is not running (or debug port not open)"
fi
;;
restart)
$0 stop
sleep 2
$0 start
;;
*)
echo "Usage: comet-quick.sh [start|stop|status|restart]"
echo ""
echo "Commands:"
echo " start - Launch Comet with debug port"
echo " stop - Stop Comet"
echo " status - Check if Comet is running"
echo " restart - Restart Comet"
exit 1
;;
esac