#! /bin/sh -e
#
# Last finishing touch before rebooting into the installed system.

log() {
    logger -t 19debian-edu-profile-udeb "$@"
}

# Make sure that the interfaces are there for the cfengine run if
# network isn't already configured
if route | grep -q default ; then
  log "Not restarting network, as it seem to be up already."
else
  log "Restarting network to prepare for cfengine run."
  in-target /etc/init.d/networking start || true
fi

# libnss-ldap seem to remove this while when it is installed.  Reinsert it to
# make cfengine can do its stuff without hanging.
touch /target/var/lib/nss-ldap/bind_policy_soft

in-target cfengine-debian-edu -D installation || true

exit 0
