Fixed GetRemoteOS os-release getinfo
This commit is contained in:
parent
bc3b6b3a5d
commit
402adba191
|
@ -2,8 +2,8 @@
|
|||
#### OFUNCTIONS FULL SUBSET ####
|
||||
#### OFUNCTIONS MINI SUBSET ####
|
||||
|
||||
_OFUNCTIONS_VERSION=2.1.2
|
||||
_OFUNCTIONS_BUILD=2017052604
|
||||
_OFUNCTIONS_VERSION=2.1.3
|
||||
_OFUNCTIONS_BUILD=2017052605
|
||||
#### _OFUNCTIONS_BOOTSTRAP SUBSET ####
|
||||
_OFUNCTIONS_BOOTSTRAP=true
|
||||
#### _OFUNCTIONS_BOOTSTRAP SUBSET END ####
|
||||
|
@ -1179,9 +1179,6 @@ function GetLocalOS {
|
|||
exit 1
|
||||
;;
|
||||
esac
|
||||
if [ "$_OFUNCTIONS_VERSION" != "" ]; then
|
||||
Logger "Local OS: [$localOsVar]." "DEBUG"
|
||||
fi
|
||||
|
||||
# Get linux versions
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
|
@ -1191,6 +1188,10 @@ function GetLocalOS {
|
|||
|
||||
# Add a global variable for statistics in installer
|
||||
LOCAL_OS_FULL="$localOsVar ($localOsName $localOsVer)"
|
||||
|
||||
if [ "$_OFUNCTIONS_VERSION" != "" ]; then
|
||||
Logger "Local OS: [$LOCAL_OS_FULL]." "DEBUG"
|
||||
fi
|
||||
}
|
||||
#### GetLocalOS SUBSET END ####
|
||||
|
||||
|
@ -1263,11 +1264,14 @@ function GetRemoteOS {
|
|||
|
||||
$SSH_CMD env _REMOTE_TOKEN="$_REMOTE_TOKEN" bash -s << 'ENDSSH' >> "$RUN_DIR/$PROGRAM.${FUNCNAME[0]}.$SCRIPT_PID.$TSTAMP" 2>&1
|
||||
|
||||
|
||||
function GetOs {
|
||||
local localOsVar
|
||||
local localOsName
|
||||
local localOsVer
|
||||
|
||||
local osInfo="/etc/os-release"
|
||||
|
||||
# There's no good way to tell if currently running in BusyBox shell. Using sluggish way.
|
||||
if ls --help 2>&1 | grep -i "BusyBox" > /dev/null; then
|
||||
localOsVar="BusyBox"
|
||||
|
@ -1286,9 +1290,11 @@ function GetOs {
|
|||
fi
|
||||
fi
|
||||
# Get linux versions
|
||||
if [ -f "/etc/os-release" ]; then
|
||||
localOsName=$(GetConfFileValue "/etc/os-release" "NAME")
|
||||
localOsVer=$(GetConfFileValue "/etc/os-release" "VERSION")
|
||||
if [ -f "$osInfo" ]; then
|
||||
localOsName=$(grep "^NAME=" "$osInfo")
|
||||
localOsName="${localOsName##*=}"
|
||||
localOsVer=$(grep "^VERSION=" "$osInfo")
|
||||
localOsVer="${localOsVer##*=}"
|
||||
fi
|
||||
|
||||
echo "$localOsVar ($localOsName $localOsVer)"
|
||||
|
|
Loading…
Reference in New Issue