listmonk/scripts/restart-dev.sh
restyler 418b840082 Enhance SQL Snippets UI and functionality
- Update translations for enabled/disabled status in SQL snippets
- Increase modal width for better user experience
- Refactor form field names for consistency (query_sql to querySql)
- Add live subscriber count display in SQL snippet form
- Implement loading and error states for subscriber count
- Adjust validation logic to use updated field names
- Introduce a new script for restarting the development environment
2025-06-28 20:25:54 +04:00

35 lines
No EOL
914 B
Bash
Executable file

#!/bin/bash
# Development restart script for listmonk
# Stops backend, rebuilds frontend, and starts backend
set -e
echo "🛑 Stopping backend..."
if [ -f /tmp/listmonk.pid ]; then
kill $(cat /tmp/listmonk.pid) 2>/dev/null || true
rm -f /tmp/listmonk.pid
fi
# Also kill any other Go processes that might be running
pkill -f "go run.*cmd" 2>/dev/null || true
# Kill any processes on port 9000
lsof -ti:9000 | xargs kill -9 2>/dev/null || true
echo "🔨 Rebuilding frontend..."
make build-frontend
echo "🚀 Starting backend..."
make run > /tmp/listmonk_debug.log 2>&1 & echo $! > /tmp/listmonk.pid
echo "⏳ Waiting for server to start..."
sleep 3
if tail -3 /tmp/listmonk_debug.log | grep -q "http server started"; then
echo "✅ Server started successfully on http://127.0.0.1:9000"
else
echo "❌ Server failed to start. Check logs:"
tail -10 /tmp/listmonk_debug.log
exit 1
fi