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 if [ -n "$UTC" ] ; then
14 echo "Setting hwclock parameter UTC to $UTC"
15 sed -i "s|^UTC=.*$|UTC="$UTC"|" $target/etc/default/rcS
18 # default timezone settings
19 if [ -n "$TIMEZONE" ] ; then
20 echo "Setting default timezone to $TIMEZONE"
22 area=$(echo $TIMEZONE | cut -d '/' -f1)
23 zone=$(echo $TIMEZONE | cut -d '/' -f2)
24 echo "tzdata tzdata/Areas select $area" | $ROOTCMD debconf-set-selections
25 echo "tzdata tzdata/Zones/$area select $zone" | $ROOTCMD debconf-set-selections
27 echo $TIMEZONE > $target/etc/timezone
28 rm -f $target/etc/localtime
29 cp -f $target/usr/share/zoneinfo/$TIMEZONE $target/etc/localtime
32 ## END OF FILE ################################################################
33 # vim:ft=sh expandtab ai tw=80 tabstop=4 shiftwidth=3