#!/bin/sh # postinst script for dmarcts-report-parser # # see: dh_installdeb(1) set -e # summary of how this script can be called: # * `configure' # * `abort-upgrade' # * `abort-remove' `in-favour' # # * `abort-remove' # * `abort-deconfigure' `in-favour' # `removing' # # for details, see https://www.debian.org/doc/debian-policy/ or # the debian-policy package case "${1}" in 'configure') # setup dmarcts-report-parser system user account if ! getent 'passwd' '_dmarcts' >'/dev/null'; then echo 'Creating _dmarcts system user.' >&2 # if adduser >= 3.122; then use --allow-bad-names # if not; then use --force-badname badname_option="--allow-bad-names" version=`dpkg-query --show --showformat='${Version}' adduser` if dpkg --compare-versions "$version" "lt" "3.122"; then badname_option="--force-badname" fi adduser --system \ --disabled-password --disabled-login \ --shell /bin/false --group \ --home /var/lib/dmarcts \ "$badname_option" \ _dmarcts fi ;; 'abort-upgrade'|'abort-remove'|'abort-deconfigure') ;; *) echo "postinst called with unknown argument '${1}'" >&2 exit 1 ;; esac #DEBHELPER# exit 0