#!/bin/sh
#
# Restore overrided default values.

set -e

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

. $pkglibdir/skolelinux-common

load_config

if test "$NONINTERACTIVE" = true; then
    debconf-set-frontend Dialog
fi

# Eject CD, as it is not needed anymore.
eject || true

# Workaround for Skolelinux bug #286, Debian bug 156332
if [ -f /var/run/dhcpd.pid ] ; then
    dhcpdpid=`cat /var/run/dhcpd.pid`
    if [ "$dhcpdpid" ] ; then
        echo "info: Making sure dhcpd is stopped before reloading services."
        /etc/init.d/dhcp stop || true
        sleep 1
        kill -9 "$dhcpdpid" > /dev/null 2>&1 || true
    fi
fi

skolelinux-restart-services || true

exit 0
