export locally

This commit is contained in:
Alexandre
2022-03-31 21:19:44 +02:00
committed by GitHub
parent 59efd67f12
commit 0e2c5c0a6b

View File

@@ -16,12 +16,14 @@ for KEYS in "${arr[@]}"; do
# export key
VALUE=$(jq ."$KEYS" "${JSONSOURCE}")
line="${KEYS}='${VALUE//[\"\']/}'"
# Use locally
# text
if bashio::config.false "verbose" || [[ "${KEYS}" == *"PASS"* ]]; then
bashio::log.blue "${KEYS}=******"
else
bashio::log.blue "$line"
fi
# Use locally
export "${KEYS}='${VALUE//[\"\']/}'"
# Export the variable to run scripts
if cat /etc/services.d/*/*run* &>/dev/null; then sed -i "1a export $line" /etc/services.d/*/*run* 2>/dev/null; fi
if cat /etc/cont-init.d/*run* &>/dev/null; then sed -i "1a export $line" /etc/cont-init.d/*run* 2>/dev/null; fi