mirror of
https://github.com/alexbelgium/hassio-addons.git
synced 2026-01-18 02:18:16 +01:00
Create 00-aab.sh
This commit is contained in:
15
enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh
Normal file
15
enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh
Normal file
@@ -0,0 +1,15 @@
|
||||
#!/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
|
||||
Reference in New Issue
Block a user