ids.alfacom.it/deployment/restart_frontend.sh
marco370 3beb9d8782 Add unique constraint to network analytics data and restart frontend script
Add a unique constraint to the network_analytics table in the Drizzle schema to prevent duplicate entries, and create a new script for restarting the frontend application.

Replit-Commit-Author: Agent
Replit-Commit-Session-Id: 7a657272-55ba-4a79-9a2e-f1ed9bc7a528
Replit-Commit-Checkpoint-Type: full_checkpoint
Replit-Commit-Event-Id: 2676dcba-e26b-4eb4-b4a4-33d33d0c9b00
Replit-Commit-Screenshot-Url: https://storage.googleapis.com/screenshot-production-us-central1/449cf7c4-c97a-45ae-8234-e5c5b8d6a84f/7a657272-55ba-4a79-9a2e-f1ed9bc7a528/37PFEyl
2025-11-24 09:13:11 +00:00

41 lines
985 B
Bash
Executable File

#!/bin/bash
#
# Restart IDS Frontend (Node.js/Express/Vite)
# Utility per restart manuale del server frontend
#
set -e
echo "🔄 Restart Frontend Node.js..."
# Kill processi Vite esistenti
echo "⏸️ Stopping existing processes..."
pkill -f "vite" 2>/dev/null || true
pkill -f "npm run dev" 2>/dev/null || true
sleep 2
# Verifica porta 5000 libera
if lsof -Pi :5000 -sTCP:LISTEN -t >/dev/null 2>&1; then
echo "⚠️ Porta 5000 occupata, killing processo..."
lsof -ti:5000 | xargs kill -9 2>/dev/null || true
sleep 1
fi
# Restart usando check_frontend.sh
echo "🚀 Starting frontend..."
/opt/ids/deployment/check_frontend.sh
# Attendi avvio
sleep 3
# Verifica
if pgrep -f "vite" > /dev/null; then
PID=$(pgrep -f "vite")
echo "✅ Frontend avviato con PID: $PID"
echo "📡 Server disponibile su: http://localhost:5000"
else
echo "❌ Errore: Frontend non avviato!"
echo "📋 Controlla log: tail -f /var/log/ids/frontend.log"
exit 1
fi