#!/bin/bash

# Source debconf library.
. /usr/share/debconf/confmodule

# Only run, if not executed on UCS
if [ ! -f '/usr/sbin/udm' ]
then
	db_input high m23/experimentalWarn || true
	db_go


	db_input high m23/configMySQL || true
	db_go

	db_input high m23/configDHCP || true
	db_go

	db_input high m23/configureSSH || true
	db_go

# 	db_input high m23/configureSquid || true
# 	db_go

	db_input high m23/configureAPTCacherNG || true
	db_go

	if ! /m23/bin/isLibreworkspace
	then
		db_input high m23/configureSSL || true
		db_go
	fi

	db_input high m23/configureApache || true
	db_go

	db_input high m23/configureSudo || true
	db_go

	if ! /m23/bin/isLibreworkspace
	then
		db_input high m23/configureBackupPC || true
		db_go
	fi

	# Ask for a new password for the pi user, if it is still the default password
	if [ -d /home/pi ] && [ -e /run/sshwarn ]
	then
		db_input high m23/PIpass || true
		db_go
	fi
fi

if test `grep address /etc/network/interfaces | wc -l` -eq 0
then
	db_input high m23/warnDHCP || true
	db_go
fi