diff --git a/gazpar2mqtt/rootfs/scripts/99-run.sh b/gazpar2mqtt/rootfs/scripts/99-run.sh index 9c6f23345..e58831665 100644 --- a/gazpar2mqtt/rootfs/scripts/99-run.sh +++ b/gazpar2mqtt/rootfs/scripts/99-run.sh @@ -70,6 +70,18 @@ for word in $(parse_yaml "$CONFIGSOURCE" ""); do fi done +################ +# Set timezone # +################ +if bashio::config.has_value "TZ"; then + TZ=$(bashio::config "TZ") + 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 + ############## # Launch App # ##############