Added global local os variables

This commit is contained in:
deajan 2016-12-27 12:52:59 +01:00
parent 549bb803dd
commit e3c6ae3a40
1 changed files with 7 additions and 4 deletions

View File

@ -3,7 +3,7 @@
#### OFUNCTIONS MINI SUBSET #### #### OFUNCTIONS MINI SUBSET ####
_OFUNCTIONS_VERSION=2.1-RC1+dev _OFUNCTIONS_VERSION=2.1-RC1+dev
_OFUNCTIONS_BUILD=2016122303 _OFUNCTIONS_BUILD=2016122701
#### _OFUNCTIONS_BOOTSTRAP SUBSET #### #### _OFUNCTIONS_BOOTSTRAP SUBSET ####
_OFUNCTIONS_BOOTSTRAP=true _OFUNCTIONS_BOOTSTRAP=true
#### _OFUNCTIONS_BOOTSTRAP SUBSET END #### #### _OFUNCTIONS_BOOTSTRAP SUBSET END ####
@ -150,7 +150,7 @@ function RemoteLogger {
local retval="${3:-undef}" # optional return value of command local retval="${3:-undef}" # optional return value of command
if [ "$_LOGGER_PREFIX" == "time" ]; then if [ "$_LOGGER_PREFIX" == "time" ]; then
prefix="RTIME: $SECONDS - " prefix="TIME: $SECONDS - "
elif [ "$_LOGGER_PREFIX" == "date" ]; then elif [ "$_LOGGER_PREFIX" == "date" ]; then
prefix="R $(date) - " prefix="R $(date) - "
else else
@ -1098,7 +1098,7 @@ function GetLocalOS {
if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then
localOsVar="Microsoft" localOsVar="Microsoft"
else else
localOsVar="$(uname -spio 2>&1)" localOsVar="$(uname -spior 2>&1)"
if [ $? != 0 ]; then if [ $? != 0 ]; then
localOsVar="$(uname -v 2>&1)" localOsVar="$(uname -v 2>&1)"
if [ $? != 0 ]; then if [ $? != 0 ]; then
@ -1148,6 +1148,9 @@ function GetLocalOS {
if [ "$_OFUNCTIONS_VERSION" != "" ]; then if [ "$_OFUNCTIONS_VERSION" != "" ]; then
Logger "Local OS: [$localOsVar]." "DEBUG" Logger "Local OS: [$localOsVar]." "DEBUG"
fi fi
# Add a global variable for statistics in installer
LOCAL_OS_FULL="$localOsVar"
} }
#### GetLocalOS SUBSET END #### #### GetLocalOS SUBSET END ####
@ -1175,7 +1178,7 @@ function GetOs {
if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then
localOsVar="Microsoft" localOsVar="Microsoft"
else else
localOsVar="$(uname -spio 2>&1)" localOsVar="$(uname -spior 2>&1)"
if [ $? != 0 ]; then if [ $? != 0 ]; then
localOsVar="$(uname -v 2>&1)" localOsVar="$(uname -v 2>&1)"
if [ $? != 0 ]; then if [ $? != 0 ]; then