Product name (Daynivo Kiosk OS), default device name, kiosk screens, service descriptions, installer output and docs. Internal names (voxip-kiosk-*, /etc/voxip-kiosk, user voxip, VOXIP_* variables) stay. An update renames a device still called "VoxIP Kiosk" to the new default. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
39 lines
1.3 KiB
Bash
Executable File
39 lines
1.3 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/voxip-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/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
|
|
|
|
if [[ -d /etc/voxip-kiosk ]]; then
|
|
BACKUP="/var/backups/voxip-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" voxip-kiosk
|
|
chmod 0600 "$BACKUP"
|
|
# keep the five most recent backups
|
|
ls -1t /var/backups/voxip-kiosk-*.tar.gz 2>/dev/null | tail -n +6 | xargs -r rm -f
|
|
fi
|
|
|
|
"$SRC/install.sh" --upgrade
|
|
|
|
echo "==> Bijgewerkt: $BEFORE → $(cat /usr/share/voxip-kiosk/VERSION)"
|