12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849 |
- #!/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"
- ;;
- abort-upgrade|abort-remove|abort-deconfigure)
- ;;
- *)
- echo "postinst called with unknown argument '$1'" >&2
- exit 1
- ;;
- esac
- #DEBHELPER#
- exit 0
|