-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathinstall.sh
More file actions
112 lines (97 loc) · 3.58 KB
/
Copy pathinstall.sh
File metadata and controls
112 lines (97 loc) · 3.58 KB
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
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
#!/bin/bash
set -e
echo "=========================================================="
echo " 🎬 VDR-Rectools - Manuelle Installation"
echo "=========================================================="
# 1. Root-Check
if [ "$EUID" -ne 0 ]; then
echo "FEHLER: Bitte als root ausführen (z. B. sudo ./install.sh)"
exit 1
fi
# 2. Abhängigkeiten prüfen
echo "-> Prüfe Abhängigkeiten..."
MISSING=0
for cmd in bash php ffmpeg ffprobe vdr svdrpsend; do
if ! command -v "$cmd" >/dev/null 2>&1; then
echo " FEHLER: Abhängigkeit '$cmd' fehlt."
MISSING=1
fi
done
if [ $MISSING -eq 1 ]; then
echo "FEHLER: Bitte installiere die fehlenden Abhängigkeiten, bevor du fortfährst."
exit 1
fi
echo " Alle Abhängigkeiten gefunden."
# 3. Dateien kopieren
echo "-> Kopiere Programmdateien..."
mkdir -p /usr/bin /usr/share/vdr-rectools/lang /var/www/html/lang /etc/vdr /tmp/vdr-rectools-jobs
cp usr/bin/vdr-rectools usr/bin/vdr-rectools-worker /usr/bin/
cp -r usr/share/vdr-rectools/* /usr/share/vdr-rectools/
cp -r var/www/html/* /var/www/html/
# 4. Rechte setzen
echo "-> Setze Berechtigungen..."
chmod +x /usr/bin/vdr-rectools /usr/bin/vdr-rectools-worker
find /usr/share/vdr-rectools -type f -name "*.sh" -exec chmod +x {} \;
chmod 777 /tmp/vdr-rectools-jobs
# 5. Konfiguration sichern/kopieren
echo "-> Prüfe Konfiguration..."
if [ ! -f /etc/vdr/vdr-rectools.conf ] && [ ! -f /etc/vdr/conf.d/vdr-rectools.conf ]; then
echo " Erstelle Standardkonfiguration unter /etc/vdr/vdr-rectools.conf"
if [ -f debian/vdr-rectools.conf ]; then
cp debian/vdr-rectools.conf /etc/vdr/vdr-rectools.conf
elif [ -f vdr-rectools.conf ]; then
cp vdr-rectools.conf /etc/vdr/vdr-rectools.conf
else
cat <<EOFCONF > /etc/vdr/vdr-rectools.conf
VIDEO_DIR="/srv/vdr/video"
IMPORT_DIR="/srv/vdr/import"
REPAIR_STAGING="/srv/vdr/tmp/staging"
HTML_DASHBOARD=1
HTML_PATH="/var/www/html/rectools.html"
LANGUAGE="de"
EOFCONF
fi
else
echo " Konfiguration existiert bereits, wird nicht überschrieben."
fi
# 6. Systemd-Einheiten für Worker (Job-Queue) anlegen
echo "-> Installiere Systemd-Dienste für den Worker..."
if [ -d /etc/systemd/system ]; then
cat <<EOFW > /etc/systemd/system/vdr-rectools-worker.service
[Unit]
Description=VDR-Rectools Web-UI Worker
[Service]
Type=oneshot
ExecStart=/usr/bin/vdr-rectools-worker
EOFW
cat <<EOFP > /etc/systemd/system/vdr-rectools-worker.path
[Unit]
Description=VDR-Rectools Job Queue Watcher
[Path]
PathModified=/tmp/vdr-rectools-jobs
MakeDirectory=yes
DirectoryMode=0777
[Install]
WantedBy=multi-user.target
EOFP
systemctl daemon-reload || true
mkdir -p /tmp/vdr-rectools-jobs
chmod 0777 /tmp/vdr-rectools-jobs
systemctl enable vdr-rectools-worker.path --now >/dev/null 2>&1 || true
fi
# 7. PHP-FPM neuladen
echo "-> Lade PHP-FPM neu (für OPcache)..."
if [ -d /run/systemd/system ]; then
for svc in $(systemctl list-units --type=service --all --no-legend 'php*-fpm.service' 2>/dev/null | awk '{print $1}'); do
systemctl reload-or-restart "$svc" >/dev/null 2>&1 || true
done
fi
echo "=========================================================="
echo " INSTALLATION ABGESCHLOSSEN!"
echo "=========================================================="
echo "Nächste Schritte:"
echo "1. Konfiguration anpassen: nano /etc/vdr/vdr-rectools.conf"
echo "2. Web-Oberfläche aufrufen: http://<IP-DEINES-VDR>/rectools.html"
echo "3. Stelle sicher, dass dein VDR-Aufnahmeverzeichnis (/srv/vdr/video)"
echo " die korrekten Rechte (chown -R vdr:vdr) besitzt."
echo "=========================================================="