mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-02-08 12:54:54 +01:00
16 lines
352 B
Bash
16 lines
352 B
Bash
#!/bin/bash
|
|
|
|
##########################
|
|
# Read all addon options #
|
|
##########################
|
|
|
|
# For all keys in options.json
|
|
JSONSOURCE="/data/options.json"
|
|
mapfile -t arr < <(jq -r 'keys[]' ${JSONSOURCE})
|
|
|
|
# Export keys as env variables
|
|
for KEYS in ${arr[@]}; do
|
|
# export key
|
|
export $(echo "${KEYS}=$(jq .$KEYS ${JSONSOURCE})")
|
|
done
|