Closed baylanger closed 2 months ago
Actually the code to declare the variables could run only for the add-on and we'd continue to use what we have now for standalone, aka regular shell env. variables.
# Are we in a HA addon Docker instance
if [ -f /tmp/.bashio/addons.self.options.config.cache ]; then
addos_config_file=/tmp/.bashio/addons.self.options.config.cache
# get list of all settings found in the config file
settings_list="$(jq '.' $addos_config_file | awk -F\" '{print $2}'| grep -v '^$')"
# for each setting, assign a shell variable (uppercase) with the value from the config file
for keyword in $settings_list; do
UPPER_keyword=$(echo $keyword | tr '[:lower:]' '[:upper:]')
...
Sticking to bashio for addon
Using the code below, at the top of run.sh, it allows to drop bashio+bash for the addon image and instead simply use "sh".
With the below change, how far would we be to use the add-on image for the standalone installation?
The script below reads directly from the add-on's config file and populates shell variables like we must use in the standalone version.
Example: