Services (daynivo-kiosk-*, daynivo-network-guard, daynivo-boot-import), programs in /usr/lib/daynivo-kiosk, folders /etc, /var/lib, /var/log and /var/cache daynivo-kiosk*, the system user daynivo, DAYNIVO_* settings, the plymouth theme, network profiles daynivo-eth0/wlan0, the image stage and its first user daynivoadmin. install.sh moves a kiosk installed up to 1.2.x over once: old services stopped and removed, folders moved (configuration, password, browser profile, logs) with symlinks under the old names, the voxip user renamed with the same uid, network profiles renamed unless a change awaits confirmation, and old leftovers removed. Tested by upgrading a configured 1.2.0 installation in a container, and running the install a second time. Old names keep working where people type or place them: voxip-config.json, voxip-authorized_keys, voxip-network-reset, voxip-kiosk-ctl, and VOXIP_DEFAULT_URL / VOXIP_DEVICE_NAME for image builds. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
42 lines
1.6 KiB
Bash
Executable File
42 lines
1.6 KiB
Bash
Executable File
#!/usr/bin/env bash
|
|
#
|
|
# Update Daynivo Kiosk OS from this checkout (or an extracted release).
|
|
#
|
|
# sudo ./update.sh # git pull --ff-only, back up config, install --upgrade
|
|
# sudo ./update.sh --no-pull # install the code as it is in this directory
|
|
#
|
|
# The configuration in /etc/daynivo-kiosk is backed up first and never overwritten.
|
|
|
|
set -euo pipefail
|
|
|
|
SRC="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
|
PULL=1
|
|
[[ ${1:-} == "--no-pull" ]] && PULL=0
|
|
[[ ${1:-} == "-h" || ${1:-} == "--help" ]] && { sed -n '3,9p' "$0" | sed 's/^# \{0,1\}//'; exit 0; }
|
|
[[ $EUID -eq 0 ]] || { echo "Voer dit script uit met sudo." >&2; exit 1; }
|
|
|
|
BEFORE="$(cat /usr/share/daynivo-kiosk/VERSION 2>/dev/null || cat /usr/share/voxip-kiosk/VERSION 2>/dev/null || echo 'niet geïnstalleerd')"
|
|
|
|
if [[ $PULL -eq 1 && -d "$SRC/.git" ]]; then
|
|
echo "==> Laatste versie ophalen"
|
|
OWNER="$(stat -c %U "$SRC")"
|
|
sudo -u "$OWNER" git -C "$SRC" pull --ff-only
|
|
fi
|
|
|
|
# Before the rename to Daynivo (up to 1.2.x) the configuration lived in /etc/voxip-kiosk.
|
|
CONF_DIR=daynivo-kiosk
|
|
if [[ ! -d /etc/daynivo-kiosk && -d /etc/voxip-kiosk ]]; then CONF_DIR=voxip-kiosk; fi
|
|
if [[ -d /etc/$CONF_DIR ]]; then
|
|
BACKUP="/var/backups/daynivo-kiosk-$(date +%Y%m%d-%H%M%S).tar.gz"
|
|
echo "==> Configuratie back-uppen naar $BACKUP"
|
|
install -d -m 0700 /var/backups
|
|
tar -C /etc -czf "$BACKUP" "$CONF_DIR"
|
|
chmod 0600 "$BACKUP"
|
|
# keep the five most recent backups
|
|
ls -1t /var/backups/daynivo-kiosk-*.tar.gz 2>/dev/null | tail -n +6 | xargs -r rm -f
|
|
fi
|
|
|
|
"$SRC/install.sh" --upgrade
|
|
|
|
echo "==> Bijgewerkt: $BEFORE → $(cat /usr/share/daynivo-kiosk/VERSION)"
|