75 lines
1.9 KiB
Bash
75 lines
1.9 KiB
Bash
#!/bin/bash
|
|
|
|
# MYP Kiosk Installation - Einfach und direkt
|
|
# Installiert Backend + Kiosk-Modus ohne venv oder nginx
|
|
|
|
set -e
|
|
|
|
echo "=== MYP Kiosk Installation ==="
|
|
|
|
# Prüfe Root-Rechte
|
|
if [[ $EUID -ne 0 ]]; then
|
|
echo "FEHLER: Dieses Skript muss als root ausgeführt werden"
|
|
exit 1
|
|
fi
|
|
|
|
# Installiere benötigte Pakete
|
|
echo "Installiere Pakete..."
|
|
apt update
|
|
apt install -y python3.11 python3-pip chromium-browser lightdm openbox curl
|
|
|
|
# Erstelle Verzeichnisse
|
|
echo "Erstelle Verzeichnisse..."
|
|
mkdir -p /opt/myp/backend
|
|
mkdir -p /home/user/.config/openbox
|
|
|
|
# Kopiere Backend-Code
|
|
echo "Kopiere Backend-Code..."
|
|
cp -r ../app /opt/myp/backend/
|
|
cp ../requirements.txt /opt/myp/backend/
|
|
|
|
# Installiere Python-Abhängigkeiten global
|
|
echo "Installiere Python-Abhängigkeiten..."
|
|
cd /opt/myp/backend
|
|
pip3 install --break-system-packages -r requirements.txt
|
|
|
|
# Setze Berechtigungen
|
|
echo "Setze Berechtigungen..."
|
|
chmod -R 755 /opt/myp/backend
|
|
chmod +x /opt/myp/backend/app/app.py
|
|
chown -R user:user /opt/myp
|
|
chown -R user:user /home/user
|
|
|
|
# Installiere Services
|
|
echo "Installiere Services..."
|
|
chmod 644 myp-backend.service
|
|
chmod 644 myp-kiosk.service
|
|
cp myp-backend.service /etc/systemd/system/
|
|
cp myp-kiosk.service /etc/systemd/system/
|
|
systemctl daemon-reload
|
|
systemctl enable myp-backend.service
|
|
systemctl enable myp-kiosk.service
|
|
|
|
# Konfiguriere automatischen Login
|
|
echo "Konfiguriere automatischen Login..."
|
|
cat > /etc/lightdm/lightdm.conf.d/10-autologin.conf << EOF
|
|
[Seat:*]
|
|
autologin-user=user
|
|
autologin-user-timeout=0
|
|
user-session=openbox
|
|
EOF
|
|
|
|
# Konfiguriere Openbox für Kiosk-Start
|
|
echo "Konfiguriere Openbox..."
|
|
cat > /home/user/.config/openbox/autostart << EOF
|
|
# Starte Kiosk-Service automatisch
|
|
systemctl --user start myp-kiosk.service &
|
|
EOF
|
|
|
|
chmod 755 /home/user/.config/openbox/autostart
|
|
chown user:user /home/user/.config/openbox/autostart
|
|
|
|
echo "=== Installation abgeschlossen ==="
|
|
echo "System wird in 5 Sekunden neu gestartet..."
|
|
sleep 5
|
|
reboot |