#! /bin/sh
# Create the initial user.
set -e

# Ideally, dpkg-reconfigure wouldn't create a new frontend every time. In
# the meantime, we reimplement a couple of bits of it.

version="$(dpkg --status passwd | grep ^Version: | sed 's/^Version: //')"
CODE=0
DEBCONF_RECONFIGURE=1 /var/lib/dpkg/info/passwd.config reconfigure "$version" \
	|| CODE="$?"
if [ "$CODE" = 30 ]; then
	exit 10
else
	exit $CODE
fi
