#!/bin/sh set -e DB_DIR_OLD=/var/db/tang DB_DIR=/var/lib/tang case "$1" in configure) if ! getent passwd _tang >/dev/null; then adduser --quiet --system --group --no-create-home --home /nonexistent --force-badname _tang fi # Migrate tang db: # * Change location # * Give it to _tang user # (Retire after bookworm release) if \ dpkg --compare-versions "$2" lt "10-3" && [ -d "$DB_DIR_OLD" ] && [ ! -d "$DB_DIR" ] then echo 'I: Migrating tang db' mv "$DB_DIR_OLD" "$DB_DIR" chown -R _tang:_tang "$DB_DIR" fi # Possibly remove /var/db/ # (Retire after bookworm release) if \ dpkg --compare-versions "$2" lt "10-3" && [ -d /var/db/ ] then rmdir /var/db/ >/dev/null 2>&1 || : fi # assert db directory mkdir -p "$DB_DIR" chown _tang:_tang "$DB_DIR" ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac #DEBHELPER# exit 0