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