#!/bin/sh -e

# Versioning
version=1:1.3.0-0.2.0

# Use debconf baby
. /usr/share/debconf/confmodule.sh


# Where the config file is that stores the previous selections
OPTIONS_FILE="/etc/horde/horde.options";
HORDE_FILE="/etc/horde/horde.php3";

db_version
db_input "low" horde/welcome
db_go

## Ok, now we need to run through the choices ##
for i in `cat $OPTIONS_FILE | grep -v "#"`; do
  # go get the value, prompt for it if we don't have it
  db_input "medium" "horde/$i"
  db_go
done

db_input medium horde/signup
db_go
db_get "horde/signup"
if [ "$RET" = false ]; then
  db_set horde/signup_email "root@localhost"
else
  db_input "medium" "horde/signup_email"
  db_go
fi
db_input medium horde/problem_reporting
db_go
db_get "horde/problem_reporting"
if [ "$RET" = false ]; then
  db_set horde/problem_email "root@localhost"
else
  db_input "medium" "horde/problem_email"
  db_go
fi
db_input "critical" "horde/database_type"
db_go
db_input "high" "horde/database_server"
db_go
db_input "high" "horde/database_name"
db_go
db_input "high" "horde/database_user"
db_go
db_input "high" "horde/database_pass"
db_go
db_input "critical" "horde/dbconfigured"
db_go
db_input "critical" "horde/webserver_type"
db_go


