Files
daynivo-kiosk-os/uninstall.sh
T
rothmanandClaude Opus 5.5 4d061f5211
CI / test-bookworm (push) Failing after 2s
CI / test-latest (push) Successful in 30s
Boot splash with the InfoFlow logo instead of the Raspberry Pi one
Own plymouth theme (logo centred on white), quiet kernel command line
without boot text, Raspberry logos or cursor, and no firmware rainbow
square. The initramfs is only rebuilt when the theme changes;
uninstall.sh restores the previous theme.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
2026-11-04 23:19:32 +01:00

74 lines
3.4 KiB
Bash
Executable File

#!/usr/bin/env bash
#
# Remove VoxIP 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)
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 InfoFlow-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
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 " VoxIP-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 "==> VoxIP Kiosk OS is verwijderd. Herstart de Raspberry Pi om de kiosk te stoppen."