#! /bin/sh
# Set the timezone.
set -e

. /usr/share/debconf/confmodule

TZSETUP_ARGS='-y -g'

if db_get debian-installer/country && [ "$RET" ]; then
	TZSETUP_ARGS="$TZSETUP_ARGS -c $RET"
fi

CODE=0
/usr/sbin/tzsetup $TZSETUP_ARGS || CODE="$?"
if [ "$CODE" -eq 30 ]; then
	exit 10 # back up to menu
else
	exit "$CODE"
fi

# TODO: deal with modules.conf/modules.dep timestamps, like base-config
