From f2e0d41b1f6fbc478df146a0c58b84e9c0027fc7 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 9 Oct 2016 15:01:32 +0100 Subject: [PATCH] Add quotes to parameter values if needed --- src/freedombone-utils-config | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/freedombone-utils-config b/src/freedombone-utils-config index 91e56633..9858dc21 100755 --- a/src/freedombone-utils-config +++ b/src/freedombone-utils-config @@ -110,7 +110,12 @@ function read_config_param { if [ $CONFIGURATION_FILE ]; then if [ -f $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