Longer variable names

This commit is contained in:
Bob Mottram 2016-10-11 15:07:02 +01:00
parent 67b515d24b
commit ab5fc8ca9d
1 changed files with 8 additions and 8 deletions

View File

@ -53,14 +53,14 @@ fi
function app_load_variables { function app_load_variables {
app_name=$1 app_name=$1
var_name=${app_name}_variables config_var_name=${app_name}_variables
if [ ! ${!var_name} ]; then if [ ! ${!config_var_name} ]; then
echo $"${app_name}_variables was not found" echo $"${app_name}_variables was not found"
return return
fi fi
eval "varname=(\${$var_name[@]})" eval "configvarname=(\${$config_var_name[@]})"
for v in "${varname[@]}" for v in "${configvarname[@]}"
do do
read_config_param $v read_config_param $v
done done
@ -70,13 +70,13 @@ function app_load_variables {
function app_save_variables { function app_save_variables {
app_name=$1 app_name=$1
var_name=${app_name}_variables config_var_name=${app_name}_variables
if [ ! ${!var_name} ]; then if [ ! ${!config_var_name} ]; then
return return
fi fi
eval "varname=(\${$var_name[@]})" eval "configvarname=(\${$config_var_name[@]})"
for v in "${varname[@]}" for v in "${configvarname[@]}"
do do
write_config_param $v "${!v}" write_config_param $v "${!v}"
done done