mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-11 10:21:02 +01:00
update global var
This commit is contained in:
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
###################################
|
||||
# Export all addon options as env #
|
||||
@@ -15,6 +15,7 @@ for KEYS in ${arr[@]}; do
|
||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||
line="${KEYS}=${VALUE//[\"\']/}"
|
||||
# Use locally
|
||||
bashio::log.blue "$line" 2>/dev/null || echo "$line"
|
||||
export $line
|
||||
# Export the variable to run scripts
|
||||
line="${KEYS}=${VALUE//[\"\']/} &>/dev/null"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
###################################
|
||||
# Export all addon options as env #
|
||||
@@ -15,6 +15,7 @@ for KEYS in ${arr[@]}; do
|
||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||
line="${KEYS}=${VALUE//[\"\']/}"
|
||||
# Use locally
|
||||
bashio::log.blue "$line" 2>/dev/null || echo "$line"
|
||||
export $line
|
||||
# Export the variable to run scripts
|
||||
line="${KEYS}=${VALUE//[\"\']/} &>/dev/null"
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
#!/bin/bash
|
||||
#!/usr/bin/with-contenv bashio
|
||||
|
||||
###################################
|
||||
# Export all addon options as env #
|
||||
@@ -13,7 +13,13 @@ mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
||||
for KEYS in ${arr[@]}; do
|
||||
# export key
|
||||
VALUE=$(jq .$KEYS ${JSONSOURCE})
|
||||
export ${KEYS}=${VALUE//[\"\']/} &>/dev/null
|
||||
line="${KEYS}=${VALUE//[\"\']/}"
|
||||
# Use locally
|
||||
bashio::log.blue "$line" 2>/dev/null || echo "$line"
|
||||
export $line
|
||||
# Export the variable to run scripts
|
||||
line="${KEYS}=${VALUE//[\"\']/} &>/dev/null"
|
||||
sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null || sed -i "1a export $line" /scripts/*run*
|
||||
done
|
||||
|
||||
################
|
||||
@@ -23,7 +29,5 @@ 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
|
||||
else
|
||||
echo "WARNING : Timezone $TZ is invalid, it will be kept to default value of $(cat /etc/timezone)"
|
||||
fi
|
||||
fi
|
||||
|
||||
Reference in New Issue
Block a user