mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-07-08 06:50:58 +02:00
Disable for arrays
This commit is contained in:
@@ -16,6 +16,11 @@ 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}")
|
||||||
|
# Check if the value is an array
|
||||||
|
if [[ "$VALUE" == \[* ]]; then
|
||||||
|
bashio::log.warning "$VALUE is an array, skipping"
|
||||||
|
else
|
||||||
|
# Continue for single values
|
||||||
VALUE="${VALUE//[\"\']/}"
|
VALUE="${VALUE//[\"\']/}"
|
||||||
line="${KEYS}='${VALUE}'"
|
line="${KEYS}='${VALUE}'"
|
||||||
# Check if secret
|
# Check if secret
|
||||||
@@ -59,7 +64,7 @@ for KEYS in "${arr[@]}"; do
|
|||||||
# For s6
|
# For s6
|
||||||
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
if [ -d /var/run/s6/container_environment ]; then printf "%s" "${VALUE}" > /var/run/s6/container_environment/"${KEYS}"; fi
|
||||||
echo "export ${KEYS}='${VALUE}'" >> ~/.bashrc
|
echo "export ${KEYS}='${VALUE}'" >> ~/.bashrc
|
||||||
|
fi
|
||||||
done
|
done
|
||||||
|
|
||||||
################
|
################
|
||||||
|
|||||||
Reference in New Issue
Block a user