#! /bin/sh

set -e

addgroup --system --quiet dirmngr
adduser --system --quiet --ingroup dirmngr --no-create-home --home /var/cache/dirmngr --shell /bin/sh dirmngr

if dpkg --compare-versions "$2" lt-nl 1.1.0-3; then
	if [ -e /var/log/dirmngr.log ]; then
		mv /var/log/dirmngr.log* /var/log/dirmngr/
	fi
fi

chown -R dirmngr:dirmngr /var/cache/dirmngr/ /var/log/dirmngr/

#DEBHELPER#
