#!/bin/sh

set -e

case "$1" in
configure)
	if ! getent group shadow | grep -q '^shadow:[^:]*:42'
	then
		groupadd -g 42 shadow || (
    			cat <<EOF
Group ID 42 has been allocated for the shadow group.  You have either
used 42 yourself or created a shadow group with a different ID.
Please correct this problem and reconfigure with ``dpkg --configure passwd''.

Note that both user and group IDs in the range 0-99 are globally
allocated by the Debian project and must be the same on every Debian
system.
EOF
    			exit 1
		)
	fi
    ;;
esac

# Run shadowconfig only on new installs
[ -z "$2" ] && shadowconfig on

# Automatically added by dh_installtmpfiles/13.6ubuntu1
if [ "$1" = "configure" ] || [ "$1" = "abort-upgrade" ] || [ "$1" = "abort-deconfigure" ] || [ "$1" = "abort-remove" ] ; then
	# In case this system is running systemd, we need to ensure that all
	# necessary tmpfiles (if any) are created before starting.
	if [ -z "${DPKG_ROOT:-}" ] && [ -d /run/systemd/system ] ; then
		systemd-tmpfiles --create passwd.conf >/dev/null || true
	fi
fi
# End automatically added section
# Automatically added by dh_installdeb/13.6ubuntu1
dpkg-maintscript-helper rm_conffile /etc/cron.daily/passwd 1:4.7-2\~ -- "$@"
dpkg-maintscript-helper rm_conffile /etc/init/passwd.conf 1:4.2-3.2ubuntu4\~ passwd -- "$@"
# End automatically added section


exit 0
