Files

31 lines
1.1 KiB
Bash
Raw Permalink Normal View History

#!/bin/bash
# HMS MediaEngine App-Start (vom Finder, ohne sichtbares Terminal)
DIR="$(cd "$(dirname "$0")/../../.." && pwd)"
PY=""
for p in /opt/homebrew/bin/python3 /usr/local/bin/python3 python3; do
if command -v "$p" >/dev/null 2>&1; then PY="$p"; break; fi
done
if [ -z "$PY" ]; then
osascript -e 'display alert "Python nicht gefunden" message "Bitte HMS-Mac-Install.command im Projektordner einmal ausfuehren - es installiert alles Grafische." as critical' >/dev/null 2>&1
exit 1
fi
cd "$DIR"
# Portable GStreamer-Umgebung laden (falls HMS-Portable-Install genutzt)
if [ -f "$DIR/runtime/env.sh" ]; then
source "$DIR/runtime/env.sh"
fi
if "$PY" -c "import gi; gi.require_version('Gst','1.0')" >/dev/null 2>&1; then
nohup "$PY" "$DIR/run.py" >>/tmp/hms-mediaengine.log 2>&1 &
PORT=8080
for i in 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 \
21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40; do
curl -s -o /dev/null "http://localhost:$PORT/api/health" && break
sleep 0.5
done
open "http://localhost:$PORT"
exit 0
else
nohup "$PY" "$DIR/installer_gui.py" >/tmp/hms-installer.log 2>&1 &
exit 0
fi