#!/bin/bash

set -e

if [[ "${is_minimal}" == "true" ]]; then
  return 0
elif [[ "${is_ghost}" == "true" ]]; then
  return 0
fi

TIMEZONE=$(get_value timezone)

msg "设置时区为 ${TIMEZONE}"
ln -sf /usr/share/zoneinfo/"${TIMEZONE}" /etc/localtime

# 写入硬件时间
if [[ -f /dev/rtc0 ]]; then
  hwclock -w
fi
