From 8911d8ff4b381b6d44b6617dfca7c0fa351f35ca Mon Sep 17 00:00:00 2001 From: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> Date: Sat, 4 Jul 2020 22:14:12 +0200 Subject: [PATCH] Fix timezone configuration Signed-off-by: Tanya Degurechaff <34323200+TanyaEleventhGoddess@users.noreply.github.com> --- templates/lxc-debian.in | 2 ++ templates/lxc-kali.in | 2 ++ 2 files changed, 4 insertions(+) diff --git a/templates/lxc-debian.in b/templates/lxc-debian.in index a3603c1..ca767ab 100644 --- a/templates/lxc-debian.in +++ b/templates/lxc-debian.in @@ -186,10 +186,12 @@ EOF # set initial timezone as on host if [ -f /etc/timezone ]; then cat /etc/timezone > "$rootfs/etc/timezone" + rm -f "$rootfs/etc/localtime" chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata elif [ -f /etc/sysconfig/clock ]; then . /etc/sysconfig/clock echo "$ZONE" > "$rootfs/etc/timezone" + rm -f "$rootfs/etc/localtime" chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata else echo "Timezone in container is not configured. Adjust it manually." diff --git a/templates/lxc-kali.in b/templates/lxc-kali.in index 491198e..89338f6 100755 --- a/templates/lxc-kali.in +++ b/templates/lxc-kali.in @@ -181,10 +181,12 @@ EOF # set initial timezone as on host if [ -f /etc/timezone ]; then cat /etc/timezone > "$rootfs/etc/timezone" + rm -f "$rootfs/etc/localtime" chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata elif [ -f /etc/sysconfig/clock ]; then . /etc/sysconfig/clock echo "$ZONE" > "$rootfs/etc/timezone" + rm -f "$rootfs/etc/localtime" chroot "$rootfs" dpkg-reconfigure -f noninteractive tzdata else echo "Timezone in container is not configured. Adjust it manually."