Add scripts to kill and restart all processes

This commit is contained in:
RobbStarkAustria
2026-03-29 12:51:36 +02:00
parent d6090a6179
commit c4bd27510c
2 changed files with 84 additions and 0 deletions

43
scripts/restart-all.sh Executable file
View File

@@ -0,0 +1,43 @@
#!/bin/bash
set -e
cd "$(dirname "$0")/.."
echo "Restarting infoscreen services..."
# Kill existing processes first
./scripts/kill-all.sh
sleep 2
# Load .env for environment variables
if [ -f .env ]; then
set -a
source .env
set +a
fi
# Create log directory if it doesn't exist
mkdir -p logs
# Start simclient.py with nohup (persists after SSH disconnect)
echo "Starting simclient.py..."
nohup ./scripts/start-dev.sh > logs/simclient.log 2>&1 &
SIMCLIENT_PID=$!
echo "✓ simclient.py started (PID: $SIMCLIENT_PID)"
# Start display_manager.py with nohup (persists after SSH disconnect)
echo "Starting display_manager.py..."
nohup ./scripts/start-display-manager.sh > logs/display_manager.log 2>&1 &
DISPLAY_PID=$!
echo "✓ display_manager.py started (PID: $DISPLAY_PID)"
echo ""
echo "Both services are running and will persist after SSH disconnect."
echo ""
echo "Monitor logs:"
echo " tail -f logs/simclient.log"
echo " tail -f logs/display_manager.log"
echo ""
echo "Kill processes:"
echo " ./scripts/kill-all.sh"