File size: 980 Bytes
8ed5b77
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
#!/usr/bin/env bash
set -euo pipefail

SRC_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
TARGETS=("/opt/modInteractive" "$HOME/modInteractive")

sudo systemctl stop modinteractive 2>/dev/null || true
pkill mpv 2>/dev/null || true
rm -f /tmp/modinteractive-mpv.sock

for target in "${TARGETS[@]}"; do
  if [[ -d "$target" ]]; then
    mkdir -p "$target/admin/templates" "$target/admin/static"
    cp "$SRC_DIR/admin/templates/index.html" "$target/admin/templates/index.html"
    cp "$SRC_DIR/admin/static/app.js" "$target/admin/static/app.js"
    cp "$SRC_DIR/admin/static/style.css" "$target/admin/static/style.css"
    cp "$SRC_DIR/admin/server.py" "$target/admin/server.py"
    echo "patched $target"
  fi
done

python3 -m py_compile /opt/modInteractive/admin/server.py

echo "OK: modern admin patch applied"
echo "Start manually: cd /opt/modInteractive && /opt/modInteractive/venv/bin/python main.py --source pir"
echo "Or service: sudo systemctl restart modinteractive"