Update 00-global_var.sh

This commit is contained in:
Alexandre
2022-01-14 18:46:22 +01:00
committed by GitHub
parent c6dc70d698
commit 89d644be6c

View File

@@ -10,9 +10,9 @@ JSONSOURCE="/data/options.json"
# Export keys as env variables # Export keys as env variables
# echo "All addon options were exported as variables" # echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE}) 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})
line="${KEYS}=${VALUE//[\"\']/}" line="${KEYS}=${VALUE//[\"\']/}"
# Use locally # Use locally
if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi if ! bashio::config.false "verbose"; then bashio::log.blue "$line"; fi
@@ -26,8 +26,8 @@ done
# Set timezone # # Set timezone #
################ ################
if [ ! -z "TZ" ] && [ -f /etc/localtime ]; 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
fi fi
fi fi