Files
daynivo-kiosk-os/uninstall.sh
T
rothmanandClaude Opus 5.5 f8303754f7 Releases on Gitea, one-line installer and auto-update (1.1.0)
- .github/workflows/release.yml: a tag vX.Y.Z runs the tests, publishes
  daynivo-kiosk-os-X.Y.Z.tar.gz (+ .sha256) and install-online.sh as a
  Gitea release, then builds the SD image with pi-gen and attaches it.
- install-online.sh: curl | sudo bash installer for the latest release.
- voxip-kiosk-updater: checks the latest release, verifies and unpacks a
  newer one under /opt/daynivo-kiosk-os and runs its update.sh. A daily
  timer checks around 03:00 and installs when auto_update is on.
- Web interface: Systeem -> Software-updates with the auto-update switch,
  check now and install now (helper verbs update-check / update-install).
- CI checks out with plain git, so it runs on Gitea's act_runner too.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-05 19:30:34 +01:00

76 lines
3.6 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Remove Daynivo Kiosk OS.
#
# sudo ./uninstall.sh # remove programs and services, keep configuration
# sudo ./uninstall.sh --purge # also remove configuration, state, logs and users
#
# Installed Debian packages (Chromium, Xorg, Flask, …) are left in place; remove
# them with apt if they are no longer needed.
set -euo pipefail
PURGE=0
[[ ${1:-} == "--purge" ]] && PURGE=1
[[ ${1:-} == "-h" || ${1:-} == "--help" ]] && { sed -n '3,10p' "$0" | sed 's/^# \{0,1\}//'; exit 0; }
[[ $EUID -eq 0 ]] || { echo "Voer dit script uit met sudo." >&2; exit 1; }
UNITS=(voxip-kiosk-healthcheck.timer voxip-kiosk-healthcheck.service voxip-kiosk-agent.service
voxip-kiosk-browser.service voxip-kiosk-x.service voxip-kiosk-manager.service
voxip-network-guard.service voxip-boot-import.service voxip-kiosk-update.timer voxip-kiosk-update.service)
PREVIOUS_TARGET="$(cat /var/lib/voxip-kiosk/previous-default-target 2>/dev/null || true)"
PREVIOUS_SPLASH="$(cat /var/lib/voxip-kiosk/previous-plymouth-theme 2>/dev/null || true)"
mapfile -t DISABLED_DMS < <(cat /var/lib/voxip-kiosk/disabled-display-managers 2>/dev/null)
echo "==> Services stoppen en verwijderen"
systemctl stop voxip-network-rollback.timer 2>/dev/null || true
for unit in "${UNITS[@]}"; do
systemctl disable --now "$unit" 2>/dev/null || true
rm -f "/etc/systemd/system/$unit"
done
systemctl daemon-reload
echo "==> Bestanden verwijderen"
rm -rf /usr/lib/voxip-kiosk /usr/share/voxip-kiosk /usr/share/doc/voxip-kiosk
rm -f /usr/local/sbin/voxip-kiosk-ctl
rm -f /etc/sudoers.d/voxip-kiosk
rm -f /etc/systemd/journald.conf.d/voxip-kiosk.conf /etc/systemd/system.conf.d/voxip-watchdog.conf
rm -f /etc/logrotate.d/voxip-kiosk /etc/avahi/services/voxip-kiosk.service
rm -f /etc/chromium/policies/managed/voxip-kiosk.json /etc/chromium-browser/policies/managed/voxip-kiosk.json
rm -f /etc/systemd/zram-generator.conf
rm -f /etc/ssh/sshd_config.d/voxip-kiosk.conf
if [[ -f /etc/X11/Xwrapper.config.voxip-orig ]]; then
mv /etc/X11/Xwrapper.config.voxip-orig /etc/X11/Xwrapper.config
else
rm -f /etc/X11/Xwrapper.config
fi
if [[ -d /usr/share/plymouth/themes/voxip-kiosk ]]; then
echo "==> Opstartscherm terugzetten (${PREVIOUS_SPLASH:-text})"
rm -rf /usr/share/plymouth/themes/voxip-kiosk
plymouth-set-default-theme -R "${PREVIOUS_SPLASH:-text}" >/dev/null 2>&1 || true
fi
if [[ -f /etc/systemd/system/display-kiosk.service.voxip-disabled ]]; then
echo " (de eerdere Daynivo-kioskservice staat nog als display-kiosk.service.voxip-disabled)"
fi
if [[ $PURGE -eq 1 ]]; then
echo "==> Configuratie, status, logs en gebruikers verwijderen"
rm -rf /etc/voxip-kiosk /var/lib/voxip-kiosk /var/lib/voxip-kiosk-network /var/lib/voxip-kiosk-browser /var/log/voxip-kiosk
# Downloaded releases (install-online.sh and the updater); safe even when running from there.
rm -rf /opt/daynivo-kiosk-os /var/cache/voxip-kiosk
rm -f /etc/NetworkManager/system-connections/voxip-eth0.nmconnection /etc/NetworkManager/system-connections/voxip-wlan0.nmconnection
nmcli connection reload 2>/dev/null || true
userdel -r kiosk 2>/dev/null || true
userdel voxip 2>/dev/null || true
groupdel kiosk 2>/dev/null || true
groupdel voxip 2>/dev/null || true
else
echo " Configuratie bewaard in /etc/voxip-kiosk (verwijderen met --purge)."
echo " Daynivo-netwerkprofielen (voxip-eth0/voxip-wlan0) blijven actief."
fi
if [[ -n $PREVIOUS_TARGET ]]; then systemctl set-default "$PREVIOUS_TARGET" >/dev/null 2>&1 || true; fi
for dm in "${DISABLED_DMS[@]}"; do systemctl enable "$dm" >/dev/null 2>&1 || true; done
echo "==> Daynivo Kiosk OS is verwijderd. Herstart de Raspberry Pi om de kiosk te stoppen."