-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstart.sh
More file actions
executable file
路32 lines (27 loc) 路 894 Bytes
/
Copy pathstart.sh
File metadata and controls
executable file
路32 lines (27 loc) 路 894 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
#!/bin/bash
# Flight Operations Dispatch Center - Startup Script
# ===================================================
echo "馃洬 Starting Flight Operations Dispatch Center..."
echo ""
# Kill any existing node processes on port 3000
echo "馃Ч Cleaning up existing processes..."
lsof -ti:3000 | xargs kill -9 2>/dev/null || true
pkill -9 -f "node server.js" 2>/dev/null || true
sleep 1
# Create logs directory if it doesn't exist
mkdir -p logs
# Check if PM2 is installed
if command -v pm2 &> /dev/null; then
echo "馃殌 Starting with PM2 (production mode)..."
pm2 start ecosystem.config.js
pm2 logs flight-dispatch --lines 20
else
# Check if nodemon is available
if [ -f "node_modules/.bin/nodemon" ]; then
echo "馃攧 Starting with Nodemon (auto-restart)..."
npm run dev
else
echo "馃摝 Starting with Node.js..."
npm start
fi
fi