mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-05-31 04:44:05 +02:00
TZ if possible
This commit is contained in:
@@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
|||||||
for KEYS in ${arr[@]}; do
|
for KEYS in ${arr[@]}; do
|
||||||
# export key
|
# export key
|
||||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||||
export ${KEYS}=${VALUE//[\"\']/}
|
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
# Set timezone #
|
# Set timezone #
|
||||||
################
|
################
|
||||||
if [ ! -z "TZ" ]; then
|
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
|
||||||
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
||||||
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
||||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
|||||||
for KEYS in ${arr[@]}; do
|
for KEYS in ${arr[@]}; do
|
||||||
# export key
|
# export key
|
||||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||||
export ${KEYS}=${VALUE//[\"\']/}
|
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
# Set timezone #
|
# Set timezone #
|
||||||
################
|
################
|
||||||
if [ ! -z "TZ" ]; then
|
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
|
||||||
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
||||||
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
||||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
|||||||
for KEYS in ${arr[@]}; do
|
for KEYS in ${arr[@]}; do
|
||||||
# export key
|
# export key
|
||||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||||
export ${KEYS}=${VALUE//[\"\']/}
|
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
# Set timezone #
|
# Set timezone #
|
||||||
################
|
################
|
||||||
if [ ! -z "TZ" ]; then
|
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
|
||||||
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
||||||
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
||||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
||||||
|
|||||||
@@ -15,13 +15,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
|||||||
for KEYS in ${arr[@]}; do
|
for KEYS in ${arr[@]}; do
|
||||||
# export key
|
# export key
|
||||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||||
export ${KEYS}=${VALUE//[\"\']/}
|
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
|
||||||
done
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
# Set timezone #
|
# Set timezone #
|
||||||
################
|
################
|
||||||
if [ ! -z "TZ" ]; then
|
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; then
|
||||||
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
if [ -f /usr/share/zoneinfo/$TZ ]; then
|
||||||
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
echo "Timezone set from $(cat /etc/timezone) to $TZ"
|
||||||
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ >/etc/timezone
|
||||||
|
|||||||
Reference in New Issue
Block a user