Add quotes to parameter values if needed

This commit is contained in:
Bob Mottram 2016-10-09 15:01:32 +01:00
parent 811a39a924
commit f2e0d41b1f
1 changed files with 6 additions and 1 deletions

View File

@ -110,7 +110,12 @@ function read_config_param {
if [ $CONFIGURATION_FILE ]; then if [ $CONFIGURATION_FILE ]; then
if [ -f $CONFIGURATION_FILE ]; then if [ -f $CONFIGURATION_FILE ]; then
if grep -q "${param_name}=" $CONFIGURATION_FILE; then if grep -q "${param_name}=" $CONFIGURATION_FILE; then
export ${param_name}=$(cat $CONFIGURATION_FILE | grep "${param_name}=" | head -n 1 | awk -F '=' '{print $2}') param_value=$(cat $CONFIGURATION_FILE | grep "${param_name}=" | head -n 1 | awk -F '=' '{print $2}')
if [[ "${param_value}" != *" "* ]]; then
export ${param_name}=${param_value}
else
export ${param_name}="${param_value}"
fi
fi fi
fi fi
fi fi