#!/bin/sh
#
# Ask the user to inset the CD

set -e

pkglibdir=/usr/lib/debian-edu-install

. $pkglibdir/debian-edu-common

init_debconf

#set -x

load_config

print "info: Ask the user to insert the install CD"

# Make sure the frontend is interactive if we loop back from 65debian-edu-inst.
db_get debconf/frontend || true
if test "$RET" = "Noninteractive" || test "$RET" = "noninteractive" ; then
    debconf-set-frontend Dialog
    # Restart this script with Dialog frontend
    jump_to 125 debian-edu-insert-cd
fi

db_fset debian-edu-install/insert-cd seen false || true
db_input critical debian-edu-install/insert-cd || [ $? -eq 30 ]
db_go || true

# Enable noninteractive frontend if it worked to set default answers
debconf-set-frontend Noninteractive

exit 0
