#!/bin/sh set -eu 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 #DEBHELPER# exit 0