#!/bin/sh -e

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

printername=""
zephyrclass=""
hostname=""

if [ -e /usr/lib/gutenbach/config/printername ]; then
    printername=$(cat /usr/lib/gutenbach/config/printername)
    db_set gutenbach-server/printername "$printername"
fi

if [ -e /usr/lib/gutenbach/config/zephyrclass ]; then
    zephyrclass=$(cat /usr/lib/gutenbach/config/zephyrclass)
    db_set gutenbach-server/zephyrclass "$zephyrclass"
fi

if [ -e /usr/lib/gutenbach/config/hostname ]; then
    hostname=$(cat /usr/lib/gutenbach/config/hostname)
    db_set gutenbach-server/hostname "$hostname"
fi

db_input high gutenbach-server/printername || true
db_input high gutenbach-server/zephyrclass || true
db_input high gutenbach-server/hostname || true
db_go || true

