Fixed #116 in master too

This commit is contained in:
deajan 2017-12-30 17:55:27 +01:00
parent 3ef4160cc8
commit 755edb0654
1 changed files with 11 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MINI SUBSET ####
_OFUNCTIONS_VERSION=2.1.4-rc1+ _OFUNCTIONS_VERSION=2.1.4-rc1+
_OFUNCTIONS_BUILD=2017112301 _OFUNCTIONS_BUILD=2017123001
#### _OFUNCTIONS_BOOTSTRAP SUBSET #### #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
#### _OFUNCTIONS_BOOTSTRAP SUBSET END #### #### _OFUNCTIONS_BOOTSTRAP SUBSET END ####
@ -1201,8 +1201,8 @@ function GetLocalOS {
# Get linux versions # Get linux versions
if [ -f "/etc/os-release" ]; then if [ -f "/etc/os-release" ]; then
localOsName=$(GetConfFileValue "/etc/os-release" "NAME") localOsName=$(GetConfFileValue "/etc/os-release" "NAME" true)
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION") localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true)
fi fi
# Add a global variable for statistics in installer # Add a global variable for statistics in installer
@ -1932,16 +1932,23 @@ function VerComp () {
function GetConfFileValue () { function GetConfFileValue () {
local file="${1}" local file="${1}"
local name="${2}" local name="${2}"
local noError="${3:-false}"
local value local value
value=$(grep "^$name=" "$file") value=$(grep "^$name=" "$file")
if [ $? == 0 ]; then if [ $? == 0 ]; then
value="${value##*=}" value="${value##*=}"
echo "$value" echo "$value"
else
if [ $noError == true ]; then
Logger "Cannot get value for [$name] in config file [$file]." "NOTICE"
else else
Logger "Cannot get value for [$name] in config file [$file]." "ERROR" Logger "Cannot get value for [$name] in config file [$file]." "ERROR"
fi fi
fi
} }
#### GetConfFileValue SUBSET END #### #### GetConfFileValue SUBSET END ####
#### SetConfFileValue SUBSET #### #### SetConfFileValue SUBSET ####