#!/bin/sh
set -e

. /usr/share/debconf/confmodule

# Although main-menu now does the same, this is still needed as this script is
# run *before* main-menu and might not be in the correct language without it.
if db_get debconf/language && [ "$RET" ] ; then
        db_set debconf/language $RET
fi

TEMPLATE_ROOT=network-console

db_input critical $TEMPLATE_ROOT/login
db_go
db_get $TEMPLATE_ROOT/login

if [ "$RET" = 'Start installer' ]; then
	exec main-menu
elif [ "$RET" = 'Start installer (expert mode)' ]; then
	db_set debconf/priority low
	exec main-menu
elif [ "$RET" = 'Start shell' ]; then
	# WORKAROUND
	export UDPKG_QUIET=1
	exec udpkg --configure --force-configure di-utils-shell
fi
