#!/bin/sh -e

. /usr/share/debconf/confmodule || exit

db_version 2.0

arch=`dpkg --print-installation-architecture`
case $arch in
    alpha)
    db_input high openafs-fileserver/alpha-broken ||true
;;
esac

if [ -r /etc/openafs/server/ThisCell ] ; then
    read cell </etc/openafs/server/ThisCell || true # error if no newline is ignore
    db_set openafs-fileserver/thiscell $cell
    fi

db_get openafs-fileserver/thiscell || true
if [ "x$RET" = "x" ] ; then
	db_get openafs-client/thiscell ||true
	db_set openafs-fileserver/thiscell "$RET"
	fi

db_input low openafs-fileserver/thiscell || true
if [ "x$2" != "x" ] ; then
    if dpkg --compare-versions $2 lt 1.2.0-1 ; then
	db_input high openafs-fileserver/bosconfig_moved ||true
	fi
fi

db_go

db_get openafs-fileserver/bosconfig_moved
if [ $RET = "false" ] ; then
    db_reset openafs-fileserver/bosconfig_moved
    exit 2
fi
