Files
ProxMenux/AppImage/scripts/AppRun

46 lines
1.6 KiB
Plaintext
Raw Normal View History

2025-09-29 18:58:53 +02:00
#!/bin/bash
# ProxMenux Monitor AppImage Entry Point
# This script is executed when the AppImage is run
# Get the directory where this AppImage is mounted
APPDIR="$(dirname "$(readlink -f "${0}")")"
export PATH="${APPDIR}/usr/bin:${PATH}"
export LD_LIBRARY_PATH="${APPDIR}/usr/lib:${LD_LIBRARY_PATH}"
2025-09-29 19:12:56 +02:00
export PYTHONPATH="${APPDIR}/usr/lib/python3/dist-packages:${APPDIR}/usr/lib/python3/site-packages:${PYTHONPATH}"
2025-09-29 18:58:53 +02:00
# Change to the AppImage directory
cd "${APPDIR}"
# Debug: Print directory structure for troubleshooting
echo "[v0] AppImage mounted at: ${APPDIR}"
echo "[v0] Contents of AppImage root:"
ls -la "${APPDIR}/" || echo "[v0] Cannot list AppImage root"
echo "[v0] Contents of web directory:"
ls -la "${APPDIR}/web/" || echo "[v0] Web directory not found"
echo "[v0] Looking for index.html:"
find "${APPDIR}" -name "index.html" -type f || echo "[v0] No index.html found"
2025-09-29 19:12:56 +02:00
echo "[v0] Python path: ${PYTHONPATH}"
echo "[v0] Checking Flask installation:"
python3 -c "import flask; print('Flask version:', flask.__version__)" 2>/dev/null || echo "[v0] Flask not found"
2025-09-29 18:58:53 +02:00
# Check for translation argument
if [[ "$1" == "--translate" ]]; then
echo "🌐 Starting ProxMenux Translation Service..."
2025-09-29 19:07:35 +02:00
exec python3 "${APPDIR}/usr/bin/translate_cli.py" "${@:2}"
2025-09-29 18:58:53 +02:00
else
echo "🚀 Starting ProxMenux Monitor Dashboard..."
echo "📊 Dashboard will be available at: http://localhost:8008"
echo "🔌 API endpoints at: http://localhost:8008/api/"
echo ""
echo "Press Ctrl+C to stop the server"
echo ""
# Start the Flask server
2025-09-29 19:07:35 +02:00
exec python3 "${APPDIR}/usr/bin/flask_server.py"
2025-09-29 18:58:53 +02:00
fi