#!/bin/sh -e
. /usr/share/debconf/confmodule

db_title 'Debian System Configuration'

# Test to see if this package is being installed in debconf's noninteractive
# mode. If so, there is no root password, and they didn't see this question.
# And the package is probably being installed into the base chroot as the
# boot floppies build. If so, let the postinst know by returning an error code
db_fget base-config/root-password isdefault
if [ -z "`fgrep root /etc/passwd | cut -d : -f 2`" -a "$RET" = true ]; then
	exit 1
fi

# Turn shadow on/off                                            
if [ -x /usr/sbin/shadowconfig ]; then
	db_get base-config/shadow
	if [ "$RET" = true ]; then
		shadowconfig on >/dev/null
	else
		shadowconfig off >/dev/null
	fi
fi 
