- daynivo-config.json, daynivo-authorized_keys and daynivo-network-reset on the boot partition; errors go to daynivo-config.error.txt. - daynivo-kiosk-ctl, with voxip-kiosk-ctl as a symlink to it. - The voxip-* names keep working, so existing SD cards and instructions stay valid; when both config files are present the Daynivo one is applied last. - Internal names (services, /etc/voxip-kiosk, user voxip) are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
76 lines
3.7 KiB
Bash
Executable File
76 lines
3.7 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/daynivo-kiosk-ctl /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."
|