scripts/uninstall.sh
29 Zeilen · 906 B · Shell
| 1 | |
| 2 | # Entfernt TV-Wall wieder. Medien bleiben erhalten, sofern nicht --purge. |
| 3 | set -euo pipefail |
| 4 | [[ $EUID -eq 0 ]] || { echo "bitte mit sudo starten" >&2; exit 1; } |
| 5 | |
| 6 | PURGE=0 |
| 7 | [[ "${1:-}" == "--purge" ]] && PURGE=1 |
| 8 | |
| 9 | systemctl disable --now tvwall.service 2>/dev/null || true |
| 10 | rm -f /etc/systemd/system/tvwall.service |
| 11 | systemctl daemon-reload |
| 12 | |
| 13 | nmcli connection delete tvwall-ap 2>/dev/null || true |
| 14 | rm -f /etc/NetworkManager/dnsmasq-shared.d/tvwall.conf |
| 15 | |
| 16 | rm -f /usr/local/bin/tvwall |
| 17 | rm -rf /opt/tvwall |
| 18 | |
| 19 | # Login auf der Konsole wieder einschalten. |
| 20 | systemctl enable --now getty@tty1.service 2>/dev/null || true |
| 21 | |
| 22 | if [[ $PURGE -eq 1 ]]; then |
| 23 | rm -rf /var/lib/tvwall /etc/tvwall |
| 24 | userdel -r tvwall 2>/dev/null || true |
| 25 | echo "TV-Wall vollstaendig entfernt (inklusive Medien)." |
| 26 | else |
| 27 | echo "TV-Wall entfernt. Medien und Konfiguration bleiben erhalten:" |
| 28 | echo " /var/lib/tvwall und /etc/tvwall" |
| 29 | fi |