Rebuilt targets

This commit is contained in:
deajan 2017-09-22 10:37:00 +02:00
parent c45d08e34e
commit fa7b76d57b
3 changed files with 23 additions and 8 deletions

View File

@ -41,7 +41,7 @@ IS_STABLE=yes
_OFUNCTIONS_VERSION=2.1.4-rc1 _OFUNCTIONS_VERSION=2.1.4-rc1
_OFUNCTIONS_BUILD=2017060801 _OFUNCTIONS_BUILD=2017092201
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
@ -1218,7 +1218,7 @@ 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")
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
@ -1940,15 +1940,20 @@ 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
} }
function SetConfFileValue () { function SetConfFileValue () {

View File

@ -185,7 +185,7 @@ 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")
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
@ -198,15 +198,20 @@ function GetLocalOS {
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
} }
function SetLocalOSSettings { function SetLocalOSSettings {

View File

@ -10,7 +10,7 @@ IS_STABLE=yes
_OFUNCTIONS_VERSION=2.1.4-rc1 _OFUNCTIONS_VERSION=2.1.4-rc1
_OFUNCTIONS_BUILD=2017060801 _OFUNCTIONS_BUILD=2017092201
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic bash functions written in 2013-2017 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
@ -1131,7 +1131,7 @@ 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")
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
@ -1780,15 +1780,20 @@ 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
} }
function SetConfFileValue () { function SetConfFileValue () {