From fa7b76d57bf8aa2403879ec3bcad02b2a517d1b4 Mon Sep 17 00:00:00 2001 From: deajan Date: Fri, 22 Sep 2017 10:37:00 +0200 Subject: [PATCH] Rebuilt targets --- dev/debug_osync.sh | 11 ++++++++--- install.sh | 9 +++++++-- osync.sh | 11 ++++++++--- 3 files changed, 23 insertions(+), 8 deletions(-) diff --git a/dev/debug_osync.sh b/dev/debug_osync.sh index 76d3ebb..165f422 100755 --- a/dev/debug_osync.sh +++ b/dev/debug_osync.sh @@ -41,7 +41,7 @@ IS_STABLE=yes _OFUNCTIONS_VERSION=2.1.4-rc1 -_OFUNCTIONS_BUILD=2017060801 +_OFUNCTIONS_BUILD=2017092201 _OFUNCTIONS_BOOTSTRAP=true ## 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 if [ -f "/etc/os-release" ]; then localOsName=$(GetConfFileValue "/etc/os-release" "NAME") - localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION") + localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true) fi # Add a global variable for statistics in installer @@ -1940,6 +1940,7 @@ function VerComp () { function GetConfFileValue () { local file="${1}" local name="${2}" + local noError="${3:-false}" local value value=$(grep "^$name=" "$file") @@ -1947,7 +1948,11 @@ function GetConfFileValue () { value="${value##*=}" echo "$value" else - Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + if [ $noError == true ]; then + Logger "Cannot get value for [$name] in config file [$file]." "NOTICE" + else + Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + fi fi } diff --git a/install.sh b/install.sh index a5365e1..17ed354 100755 --- a/install.sh +++ b/install.sh @@ -185,7 +185,7 @@ function GetLocalOS { # Get linux versions if [ -f "/etc/os-release" ]; then localOsName=$(GetConfFileValue "/etc/os-release" "NAME") - localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION") + localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true) fi # Add a global variable for statistics in installer @@ -198,6 +198,7 @@ function GetLocalOS { function GetConfFileValue () { local file="${1}" local name="${2}" + local noError="${3:-false}" local value value=$(grep "^$name=" "$file") @@ -205,7 +206,11 @@ function GetConfFileValue () { value="${value##*=}" echo "$value" else - Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + if [ $noError == true ]; then + Logger "Cannot get value for [$name] in config file [$file]." "NOTICE" + else + Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + fi fi } diff --git a/osync.sh b/osync.sh index d66173f..f08465e 100755 --- a/osync.sh +++ b/osync.sh @@ -10,7 +10,7 @@ IS_STABLE=yes _OFUNCTIONS_VERSION=2.1.4-rc1 -_OFUNCTIONS_BUILD=2017060801 +_OFUNCTIONS_BUILD=2017092201 _OFUNCTIONS_BOOTSTRAP=true ## 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 if [ -f "/etc/os-release" ]; then localOsName=$(GetConfFileValue "/etc/os-release" "NAME") - localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION") + localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION" true) fi # Add a global variable for statistics in installer @@ -1780,6 +1780,7 @@ function VerComp () { function GetConfFileValue () { local file="${1}" local name="${2}" + local noError="${3:-false}" local value value=$(grep "^$name=" "$file") @@ -1787,7 +1788,11 @@ function GetConfFileValue () { value="${value##*=}" echo "$value" else - Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + if [ $noError == true ]; then + Logger "Cannot get value for [$name] in config file [$file]." "NOTICE" + else + Logger "Cannot get value for [$name] in config file [$file]." "ERROR" + fi fi }