From 7338380b4ee90b647c9058a7c91c584b1e32345a Mon Sep 17 00:00:00 2001 From: Alexandre Date: Fri, 19 Nov 2021 11:02:42 +0100 Subject: [PATCH] TZ if possible --- cloudcommander/rootfs/entrypoint.sh | 4 ++-- enedisgateway2mqtt/rootfs/entrypoint.sh | 4 ++-- filebrowser/rootfs/entrypoint.sh | 4 ++-- gazpar2mqtt/rootfs/entrypoint.sh | 4 ++-- 4 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cloudcommander/rootfs/entrypoint.sh b/cloudcommander/rootfs/entrypoint.sh index 8c723434b..635dbc865 100644 --- a/cloudcommander/rootfs/entrypoint.sh +++ b/cloudcommander/rootfs/entrypoint.sh @@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) for KEYS in ${arr[@]}; do # export key VALUE=$(jq .$KEYS ${JSONSOURCE}) - export ${KEYS}=${VALUE//[\"\']/} + export ${KEYS}=${VALUE//[\"\']/} &>/dev/null done ################ # Set timezone # ################ -if [ ! -z "TZ" ]; then +if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then if [ -f /usr/share/zoneinfo/$TZ ]; then echo "Timezone set from $(cat /etc/timezone) to $TZ" ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone diff --git a/enedisgateway2mqtt/rootfs/entrypoint.sh b/enedisgateway2mqtt/rootfs/entrypoint.sh index 8c723434b..635dbc865 100644 --- a/enedisgateway2mqtt/rootfs/entrypoint.sh +++ b/enedisgateway2mqtt/rootfs/entrypoint.sh @@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) for KEYS in ${arr[@]}; do # export key VALUE=$(jq .$KEYS ${JSONSOURCE}) - export ${KEYS}=${VALUE//[\"\']/} + export ${KEYS}=${VALUE//[\"\']/} &>/dev/null done ################ # Set timezone # ################ -if [ ! -z "TZ" ]; then +if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then if [ -f /usr/share/zoneinfo/$TZ ]; then echo "Timezone set from $(cat /etc/timezone) to $TZ" ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone diff --git a/filebrowser/rootfs/entrypoint.sh b/filebrowser/rootfs/entrypoint.sh index 8c723434b..635dbc865 100644 --- a/filebrowser/rootfs/entrypoint.sh +++ b/filebrowser/rootfs/entrypoint.sh @@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) for KEYS in ${arr[@]}; do # export key VALUE=$(jq .$KEYS ${JSONSOURCE}) - export ${KEYS}=${VALUE//[\"\']/} + export ${KEYS}=${VALUE//[\"\']/} &>/dev/null done ################ # Set timezone # ################ -if [ ! -z "TZ" ]; then +if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then if [ -f /usr/share/zoneinfo/$TZ ]; then echo "Timezone set from $(cat /etc/timezone) to $TZ" ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone diff --git a/gazpar2mqtt/rootfs/entrypoint.sh b/gazpar2mqtt/rootfs/entrypoint.sh index 8c723434b..635dbc865 100644 --- a/gazpar2mqtt/rootfs/entrypoint.sh +++ b/gazpar2mqtt/rootfs/entrypoint.sh @@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) for KEYS in ${arr[@]}; do # export key VALUE=$(jq .$KEYS ${JSONSOURCE}) - export ${KEYS}=${VALUE//[\"\']/} + export ${KEYS}=${VALUE//[\"\']/} &>/dev/null done ################ # Set timezone # ################ -if [ ! -z "TZ" ]; then +if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then if [ -f /usr/share/zoneinfo/$TZ ]; then echo "Timezone set from $(cat /etc/timezone) to $TZ" ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone