Added masking for secure params

This commit is contained in:
Alexey Pustovalov 2020-06-23 16:28:09 +03:00
parent c1fd2e544a
commit 293d2192ef

View File

@ -44,12 +44,18 @@ update_config_var() {
local var_value=$3 local var_value=$3
local is_multiple=$4 local is_multiple=$4
local masklist=("TLSPSKIdentity")
if [ ! -f "$config_path" ]; then if [ ! -f "$config_path" ]; then
echo "**** Configuration file '$config_path' does not exist" echo "**** Configuration file '$config_path' does not exist"
return return
fi fi
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'... " if [[ " ${masklist[@]} " =~ " $var_name " ]] && [ ! -z "$var_value" ]; then
echo -n "** Updating '$config_path' parameter \"$var_name\": '****'. Enable DEBUG_MODE to view value ..."
else
echo -n "** Updating '$config_path' parameter \"$var_name\": '$var_value'..."
fi
# Remove configuration parameter definition in case of unset parameter value # Remove configuration parameter definition in case of unset parameter value
if [ -z "$var_value" ]; then if [ -z "$var_value" ]; then