Aktualisiere das Setup-Skript, um die EOF-Delimiter für die Konfiguration von .bashrc, .npmrc und Reparaturskripten zu ändern. Dies verbessert die Lesbarkeit und Wartbarkeit des Skripts.

This commit is contained in:
Till Tomczak 2025-06-04 13:52:12 +02:00
parent 6f16cbd612
commit 42300c9c16

View File

@ -1430,7 +1430,7 @@ EOF
# Füge DISPLAY-Variable zum .bashrc hinzu
if ! grep -q "export DISPLAY=" "$kiosk_home/.bashrc" 2>/dev/null; then
cat >> "$kiosk_home/.bashrc" << 'EOF'
cat >> "$kiosk_home/.bashrc" << 'BASHRCEOF3'
# X11 Display Konfiguration
export DISPLAY=:0.0
@ -1441,7 +1441,7 @@ if [ -z "$DISPLAY" ] && [ "$XDG_VTNR" = "1" ]; then
export DISPLAY=:0.0
fi
EOF
BASHRCEOF3
chown "$KIOSK_USER:$KIOSK_USER" "$kiosk_home/.bashrc"
fi
@ -1877,7 +1877,7 @@ fix_project_permissions() {
fi
# Erstelle .npmrc für kiosk User
cat > "$kiosk_home/.npmrc" << 'EOF'
cat > "$kiosk_home/.npmrc" << 'NPMRCEOF'
# npm-Konfiguration für kiosk User
fund=false
audit-level=moderate
@ -1885,7 +1885,7 @@ progress=false
loglevel=warn
cache=/home/kiosk/.npm
prefix=/home/kiosk/.npm-global
EOF
NPMRCEOF
chown "$KIOSK_USER:$KIOSK_USER" "$kiosk_home/.npmrc" 2>/dev/null || true
@ -1928,7 +1928,7 @@ create_permission_fix_script() {
progress "Erstelle automatisches Berechtigen-Reparatur-Skript..."
cat > "$fix_script" << 'EOF'
cat > "$fix_script" << 'FIXSCRIPTEOF'
#!/bin/bash
# ===================================================================
@ -2075,13 +2075,13 @@ fi
# DISPLAY-Variable in bashrc sicherstellen
if [ -f "$kiosk_home/.bashrc" ] && ! grep -q "export DISPLAY=" "$kiosk_home/.bashrc" 2>/dev/null; then
cat >> "$kiosk_home/.bashrc" << 'EOF'
cat >> "$kiosk_home/.bashrc" << 'BASHRCEOF'
# X11 Display Konfiguration
export DISPLAY=:0.0
export XAUTHORITY=/home/kiosk/.Xauthority
EOF
BASHRCEOF
chown "$KIOSK_USER:$KIOSK_USER" "$kiosk_home/.bashrc"
log "✅ X11-Variablen zu .bashrc hinzugefügt"
fi
@ -2098,7 +2098,7 @@ info " - Als kiosk-User: cd $SCRIPT_DIR && npm install"
info " - Als root bei Problemen: sudo $0"
info ""
EOF
FIXSCRIPTEOF
# Mache Skript ausführbar
chmod +x "$fix_script" 2>/dev/null || warning "⚠️ Konnte fix-permissions.sh nicht ausführbar machen"
@ -2111,7 +2111,7 @@ EOF
progress "Erstelle X11-Reparatur-Skript..."
cat > "$x11_fix_script" << 'EOF'
cat > "$x11_fix_script" << 'X11FIXSCRIPTEOF'
#!/bin/bash
# ===================================================================
@ -2195,13 +2195,13 @@ log "Prüfe X11-Umgebungsvariablen..."
if [ -f "$kiosk_home/.bashrc" ]; then
if ! grep -q "export DISPLAY=" "$kiosk_home/.bashrc" 2>/dev/null; then
log "Füge X11-Variablen zu .bashrc hinzu..."
cat >> "$kiosk_home/.bashrc" << 'BASHEOF'
cat >> "$kiosk_home/.bashrc" << 'BASHEOF2'
# X11 Display Konfiguration
export DISPLAY=:0.0
export XAUTHORITY=/home/kiosk/.Xauthority
BASHEOF
BASHEOF2
if [ "$EUID" -eq 0 ]; then
chown "$KIOSK_USER:$KIOSK_USER" "$kiosk_home/.bashrc"
@ -2287,7 +2287,7 @@ info " - Neustart: sudo reboot"
info " - Manual X11 start: startx"
info ""
EOF
X11FIXSCRIPTEOF
chmod +x "$x11_fix_script" 2>/dev/null || warning "⚠️ Konnte fix-x11.sh nicht ausführbar machen"