#!/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 # This cannot be anchored to a version since the initial setup used # to be in the tang package. # (Retire after bookworm release) if \ [ -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 [ -d /var/db/ ] ; then rmdir /var/db/ >/dev/null 2>&1 || : fi # assert db directory mkdir -p "$DB_DIR" chown _tang:_tang "$DB_DIR" chmod 0750 "$DB_DIR" ;; abort-upgrade|abort-remove|abort-deconfigure) ;; *) echo "postinst called with unknown argument '$1'" >&2 exit 1 ;; esac exit 0