From 6eac9538c4d11013e76127dc5b35a632f64d245a Mon Sep 17 00:00:00 2001 From: Alain Reguera Delgado Date: Oct 02 2012 20:07:48 +0000 Subject: Update `Functions/Commons/cli_getConfigValue.sh' file. --- diff --git a/Scripts/Bash/Functions/Commons/cli_getConfigValue.sh b/Scripts/Bash/Functions/Commons/cli_getConfigValue.sh index 01c0fcd..c559f6c 100755 --- a/Scripts/Bash/Functions/Commons/cli_getConfigValue.sh +++ b/Scripts/Bash/Functions/Commons/cli_getConfigValue.sh @@ -1,9 +1,9 @@ #!/bin/bash # -# cli_getConfigValue.sh -- This function retrives configuration values -# from configuration files. As arguments, the configuration file -# absolute path, the configuration section name, and the configuration -# variable name must be provided. +# cli_getConfigValue.sh -- This function standardizes the way are +# retrieved from configuration files. As arguments, the configuration +# file absolute path, the configuration section name, and the +# configuration option name must be provided. # # Copyright (C) 2009, 2010, 2011, 2012 The CentOS Project # @@ -35,19 +35,19 @@ function cli_getConfigValue { local CONFIG_SECTION="$2" # Initialize variable name we want to retrive value from. - local CONFIG_VARNAME="$3" + local CONFIG_OPTION="$3" # Retrive configuration lines from configuration file. local CONFIG_LINES=$(cli_getConfigLines \ - "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_VARNAME") + "$CONFIG_ABSPATH" "$CONFIG_SECTION" "$CONFIG_OPTION") # Parse configuration lines to retrive the values of variable # names. - local CONFIG_VARVALUE=$(echo $CONFIG_LINES \ + local CONFIG_VALUE=$(echo $CONFIG_LINES \ | cut -d'=' -f2- \ | sed -r 's/^"(.*)"$/\1/') # Output values related to variable name. - echo "$CONFIG_VARVALUE" + echo "$CONFIG_VALUE" }