Skip to content

Commit

Permalink
fix setting timezone as Java option
Browse files Browse the repository at this point in the history
Signed-off-by: Markus Storm <[email protected]>
  • Loading branch information
mstormi authored Sep 9, 2024
1 parent 6dc0ffd commit fd421f3
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion functions/system.bash
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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.
Expand Down

0 comments on commit fd421f3

Please sign in to comment.