From e34e76e30d031656cd6f24943cd4801b8698b549 Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Thu, 18 Nov 2021 16:01:33 +0100 Subject: [PATCH] Update 99-run.sh --- enedisgateway2mqtt/rootfs/scripts/99-run.sh | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/enedisgateway2mqtt/rootfs/scripts/99-run.sh b/enedisgateway2mqtt/rootfs/scripts/99-run.sh index 26c7ee246..baf4e6a7b 100644 --- a/enedisgateway2mqtt/rootfs/scripts/99-run.sh +++ b/enedisgateway2mqtt/rootfs/scripts/99-run.sh @@ -66,8 +66,11 @@ fi ################ if bashio::config.has_value "TZ"; then TZ=$(bashio::config "TZ") - bashio::log.info "Timezone set to $TZ" - ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + if [ -f /usr/share/zoneinfo/$TZ ]; then + bashio::log.info "Timezone set from $(cat /etc/timezone) to $TZ" + ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone + else + bashio::log.warning "Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)" fi ##############