From efc881a4348545508ea6a1ae36ae04075fc1d25f Mon Sep 17 00:00:00 2001 From: Alexandre <44178713+alexbelgium@users.noreply.github.com> Date: Tue, 16 Nov 2021 23:37:01 +0100 Subject: [PATCH] Create 00-aab.sh --- enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100644 enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh diff --git a/enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh b/enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh new file mode 100644 index 000000000..0597ccf48 --- /dev/null +++ b/enedisgateway2mqtt_test/rootfs/scripts/00-aab.sh @@ -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