Fixing OS detection on Cygwin

This commit is contained in:
deajan 2016-11-22 19:02:13 +01:00
parent b3d17f8fec
commit c3013347bb
1 changed files with 15 additions and 19 deletions

View File

@ -1,6 +1,6 @@
#### MINIMAL-FUNCTION-SET BEGIN #### #### MINIMAL-FUNCTION-SET BEGIN ####
## FUNC_BUILD=2016112204 ## FUNC_BUILD=2016112205
## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr ## BEGIN Generic bash functions written in 2013-2016 by Orsiris de Jong - http://www.netpower.fr - ozy@netpower.fr
## To use in a program, define the following variables: ## To use in a program, define the following variables:
@ -962,8 +962,7 @@ function GetLocalOS {
localOsVar="BusyBox" localOsVar="BusyBox"
else else
# Detecting the special ubuntu userland in Windows 10 bash # Detecting the special ubuntu userland in Windows 10 bash
if [ -f /proc/sys/kernel/osrelease ]; then if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then
if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null; then
localOsVar="Microsoft" localOsVar="Microsoft"
else else
localOsVar="$(uname -spio 2>&1)" localOsVar="$(uname -spio 2>&1)"
@ -975,7 +974,6 @@ function GetLocalOS {
fi fi
fi fi
fi fi
fi
case $localOsVar in case $localOsVar in
# Android uname contains both linux and android, keep it before linux entry # Android uname contains both linux and android, keep it before linux entry
@ -1033,8 +1031,7 @@ function GetOs {
localOsVar="BusyBox" localOsVar="BusyBox"
else else
# Detecting the special ubuntu userland in Windows 10 bash # Detecting the special ubuntu userland in Windows 10 bash
if [ -f /proc/sys/kernel/osrelease ]; then if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null 2>&1; then
if grep -i Microsoft /proc/sys/kernel/osrelease > /dev/null; then
localOsVar="Microsoft" localOsVar="Microsoft"
else else
localOsVar="$(uname -spio 2>&1)" localOsVar="$(uname -spio 2>&1)"
@ -1046,7 +1043,6 @@ function GetOs {
fi fi
fi fi
fi fi
fi
echo "$localOsVar" echo "$localOsVar"
} }