#!/bin/sh
#
# Reboot machine to make sure all processes are using the same and
# correct content of /etc/resolv.conf and /etc/localtime.
#
# This must be done after 99inittab, to make sure base-config do not
# start again after the reboot.  Prefixing this package with 99z to
# make sure it is sorted after 99inittab.

set -e

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

. $pkglibdir/debian-edu-common

init_debconf

if [ -f /etc/inittab.real ] ; then
    # If inittab.real is still resent at this stage, we are probably installing
    # Sarge, where it at the moment (2004-12-31) is impossible to
    # reboot at the end of the installation.  Skipping this step. [bug #287964]

    # We could just move the real one into place, but this would skip the
    # last part of base-config, and we do not want that.
    #mv /etc/inittab.real /etc/inittab
    print "Skipping reboot, as /etc/inittab.real is still there!"
else
    # Report why we reboot.
    db_fset debian-edu-install/reboot seen false || true
    db_input critical debian-edu-install/reboot || [ $? -eq 30 ]
    db_go || true

    shutdown -r now
fi

exit 0
