Switch start/stop scripts to use systemd services

This commit is contained in:
Jordan Ramos
2026-05-07 16:27:47 -06:00
parent 3db84a377b
commit f657351219
2 changed files with 12 additions and 49 deletions

View File

@@ -1,22 +1,14 @@
#!/bin/bash
echo "Starting CVE Dashboard servers..."
# Start backend
cd backend
nohup node server.js > backend.log 2>&1 &
BACKEND_PID=$!
echo "Backend started (PID: $BACKEND_PID)"
sudo systemctl start cve-backend
echo "✓ Backend started"
# Start frontend
cd ../frontend
nohup npm start > frontend.log 2>&1 &
FRONTEND_PID=$!
echo "Frontend started (PID: $FRONTEND_PID)"
sudo systemctl start cve-frontend
echo "✓ Frontend started"
# Save PIDs
echo $BACKEND_PID > ../backend.pid
echo $FRONTEND_PID > ../frontend.pid
sleep 1
echo "✓ Both servers running in background"
echo " Backend: http://localhost:3001"
echo " Frontend: http://localhost:3000"
# Show status
systemctl is-active --quiet cve-backend && echo " Backend: http://localhost:3001 (running)" || echo " Backend: FAILED"
systemctl is-active --quiet cve-frontend && echo " Frontend: http://localhost:3000 (running)" || echo " Frontend: FAILED"