Files
KX-Bridge-Release/bridge.sh
Phil Merricks 9a15762705 feat: improve English UI and ACE filament mapping
Complete English-mode coverage for browser-visible UI strings and console messages.

Extract uploaded G-code/3MF filament metadata and use it to build smarter ACE/AMS slot mappings while preserving existing fallback behavior.

Ignore local config and Codex workspace files generated during development.
2026-05-08 20:56:00 +01:00

47 lines
1.1 KiB
Bash
Executable File
Raw Permalink Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

#!/bin/bash
# Bridge-Manager: start | stop | restart | status | log
SCRIPT="$(dirname "$0")/kobrax_moonraker_bridge.py"
LOGFILE="/tmp/bridge.log"
PRINTER_IP="${PRINTER_IP:-}"
case "${1:-restart}" in
start)
if ss -tlnp | grep -q 7125; then
echo "Port 7125 belegt beende alte Instanz..."
fuser -k 7125/tcp 2>/dev/null || pkill -f kobrax_moonraker_bridge 2>/dev/null
sleep 1
fi
CMD=(python3 "$SCRIPT")
if [[ -n "$PRINTER_IP" ]]; then
CMD+=(--printer-ip "$PRINTER_IP")
fi
nohup "${CMD[@]}" > "$LOGFILE" 2>&1 &
echo "Bridge gestartet PID=$!"
sleep 2; tail -3 "$LOGFILE"
;;
stop)
pkill -f kobrax_moonraker_bridge && echo "Bridge beendet" || echo "Nicht aktiv"
fuser -k 7125/tcp 2>/dev/null
;;
restart)
"$0" stop
sleep 1
"$0" start
;;
status)
if ss -tlnp | grep -q 7125; then
echo "Bridge läuft (Port 7125 aktiv)"
ps aux | grep kobrax_moonraker | grep -v grep
else
echo "Bridge nicht aktiv"
fi
;;
log)
tail -${2:-20} "$LOGFILE"
;;
*)
echo "Usage: $0 {start|stop|restart|status|log [N]}"
exit 1
;;
esac