From fd421f3531285ee403a63188f2f5ebc1d1f13f5f Mon Sep 17 00:00:00 2001 From: Markus Storm Date: Mon, 9 Sep 2024 17:42:10 +0200 Subject: [PATCH] fix setting timezone as Java option Signed-off-by: Markus Storm --- functions/system.bash | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/functions/system.bash b/functions/system.bash index 585592da1..cfbdb9e81 100644 --- a/functions/system.bash +++ b/functions/system.bash @@ -100,7 +100,7 @@ timezone_setting() { elif [[ -n $timezone ]]; then echo -n "$(timestamp) [openHABian] Setting timezone based on openhabian.conf... " if ! running_in_docker && ! running_on_github; then - if cond_redirect timedatectl set-timezone "$timezone"; then echo "OK ($(timedatectl | grep zone | cut -d: -f2))"; else echo "FAILED"; return 1; fi + if cond_redirect timedatectl set-timezone "$timezone"; then echo "OK ($timezone)"; else echo "FAILED"; return 1; fi else echo "SKIPPED" fi @@ -114,6 +114,8 @@ timezone_setting() { if ! cond_redirect pip3 install --upgrade tzupdate; then echo "FAILED (update tzupdate)"; return 1; fi if cond_redirect tzupdate; then echo "OK ($(cat /etc/timezone))"; else echo "FAILED"; return 1; fi fi + + sed -ri "s|^(EXTRA_JAVA_OPTS.*interning=true)|\1 -Duser.timezone=${timezone:-Europe/London}|g" /etc/default/openhab } ## Function for setting the locale of the current system.