#!/usr/bin/bash

set -e

PROGNAME=$(basename "$0")
debconf_BOOTSTRAPPED=0
AUTO_CONFIG=false

. /usr/share/grommunio-pkg-bits/scripts/setup-include.sh

# This case statements prevents execution if script is included
case "$PROGNAME" in
	setup-grommunio-debconf)
		check_if_root
		start_debconf -t -x 'grommunio-debconf' -y 'debconf' -z 'debconf' "$@"
		# Load pkg-bits template file
		db_x_loadtemplatefile /var/lib/dpkg/info/grommunio-pkg-bits.templates grommunio-pkg-bits
	;;
	clean-debconf-db)
		check_if_root
		clean_debconf_db "$1"
	;;
esac

