mirror of
https://github.com/agessaman/meshcore-bot.git
synced 2026-05-25 18:04:03 +00:00
e0eae09104
ruff: fix import order, Dict→dict, and unused variable in discord_bridge_service.py mypy: add types-requests to test deps to resolve import-untyped warnings; add per-module ignore_errors overrides for modules not yet brought up to strict typing standard ShellCheck: remove unused vars (SC2034) in install-service.sh and uninstall-service.sh; split local declare/assign (SC2155) in install-service.sh and restart_viewer.sh; replace ls|grep (SC2010) with glob loops in docker-setup.sh; capture $? immediately after heredoc (SC2320)
44 lines
1.3 KiB
Bash
Executable File
44 lines
1.3 KiB
Bash
Executable File
#!/bin/bash
|
|
|
|
# MeshCore Bot Data Viewer Restart Script
|
|
# Manual restart tool for troubleshooting and development
|
|
# Use when integrated web viewer has issues or for standalone testing
|
|
|
|
echo "Restarting MeshCore Bot Data Viewer in standalone mode..."
|
|
|
|
# Check if Python 3 is available
|
|
if ! command -v python3 &> /dev/null; then
|
|
echo "Error: Python 3 is required but not installed."
|
|
exit 1
|
|
fi
|
|
|
|
# Check if we're in the right directory
|
|
if [ ! -f "modules/web_viewer/app.py" ]; then
|
|
echo "Error: app.py not found. Please run from the project root directory."
|
|
exit 1
|
|
fi
|
|
|
|
# Create logs directory if it doesn't exist
|
|
mkdir -p logs
|
|
|
|
# Set environment variables for better performance
|
|
PYTHONPATH="${PYTHONPATH}:$(pwd)"
|
|
export PYTHONPATH
|
|
export FLASK_ENV=production
|
|
|
|
# Kill any existing web viewer processes on port 8080
|
|
echo "Checking for existing web viewer processes..."
|
|
if lsof -ti:8080 >/dev/null 2>&1; then
|
|
echo "Found existing processes on port 8080, stopping them..."
|
|
lsof -ti:8080 | xargs kill -9 2>/dev/null || true
|
|
sleep 2
|
|
fi
|
|
|
|
# Start the web viewer in standalone mode
|
|
echo "Starting web viewer in standalone mode on http://127.0.0.1:8080"
|
|
echo "Note: This runs independently of the main bot"
|
|
echo "Press Ctrl+C to stop"
|
|
echo ""
|
|
|
|
python3 modules/web_viewer/app.py --host 127.0.0.1 --port 8080
|