2 # Filename: /etc/grml/fai/config/scripts/GRMLBASE/18-timesetup
3 # Purpose: apply default time and timezone settings
4 # Authors: (c) Thomas Lehmann <thomas.lehmann@kvt.de>
5 # Bug-Reports: send to author and see http://grml.org/bugs/
6 # License: This file is licensed under the GPL v2 or any later version.
7 ###############################################################################
12 # tell if hwclock is running in UTC or local time
13 # by default it's set to UTC=yes, we usually want UTC=no
14 if [ -n "$UTC" ] ; then
15 echo "Setting hwclock parameter UTC to $UTC"
16 sed -i "s|^UTC=.*$|UTC="$UTC"|" $target/etc/default/rcS
19 # default timezone settings
20 if [ -n "$TIMEZONE" ] ; then
21 echo "Setting default timezone to $TIMEZONE"
23 area=$(echo $TIMEZONE | cut -d '/' -f1)
24 zone=$(echo $TIMEZONE | cut -d '/' -f2)
25 echo "tzdata tzdata/Areas select $area" | $ROOTCMD debconf-set-selections
26 echo "tzdata tzdata/Zones/$area select $zone" | $ROOTCMD debconf-set-selections
28 echo $TIMEZONE > $target/etc/timezone
29 rm -f $target/etc/localtime
30 cp -f $target/usr/share/zoneinfo/$TIMEZONE $target/etc/localtime
33 ## END OF FILE ################################################################
34 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3