#!/bin/sh
set -e

. /usr/share/debconf/confmodule

db_get time/zone
zone="$RET"

if [ ! -e /usr/share/zoneinfo/$zone ]; then
	logger -t tzsetup "Warning: ignoring invalid time zone '$zone'"
	exit 0
fi

echo "$zone" > /etc/timezone
rm -f /etc/localtime
cp -f /usr/share/zoneinfo/$zone /etc/localtime
