allow expansion

This commit is contained in:
Alexandre
2022-01-20 09:56:39 +01:00
parent 18c38c3350
commit efb8e3df98
3 changed files with 3 additions and 3 deletions

View File

@@ -11,7 +11,7 @@ JSONSOURCE="/data/options.json"
# Export keys as env variables
# echo "All addon options were exported as variables"
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
for KEYS in "${arr[@]}"; do
for KEYS in ${arr[@]}; do
# export key
VALUE=$(jq ."$KEYS" ${JSONSOURCE})
line="${KEYS}=${VALUE//[\"\']/}"

View File

@@ -22,7 +22,7 @@ if [ -f ${JSONTOCHECK} ]; then
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
# Check if all keys are still there, or add them
for KEYS in "${arr[@]}"; do
for KEYS in ${arr[@]}; do
# Check if key exists
KEYSTHERE=$(jq "has(\"${KEYS}\")" ${JSONTOCHECK})
if [ "$KEYSTHERE" != "true" ]; then

View File

@@ -22,7 +22,7 @@ if [ -f ${JSONTOCHECK} ]; then
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
# Check if all keys are still there, or add them
for KEYS in "${arr[@]}"; do
for KEYS in ${arr[@]}; do
# Check if key exists
KEYSTHERE=$(jq "has(\"${KEYS}\")" ${JSONTOCHECK})
if [ "$KEYSTHERE" != "true" ]; then