Added Win10 bash detection
This commit is contained in:
parent
2f9f2f4f57
commit
9fb9d3504e
|
@ -1,6 +1,6 @@
|
||||||
#### MINIMAL-FUNCTION-SET BEGIN ####
|
#### MINIMAL-FUNCTION-SET BEGIN ####
|
||||||
|
|
||||||
## FUNC_BUILD=2016112201
|
## FUNC_BUILD=2016112202
|
||||||
## 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:
|
||||||
|
@ -960,6 +960,9 @@ function GetLocalOS {
|
||||||
# There's no good way to tell if currently running in BusyBox shell. Using sluggish way.
|
# 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
|
if ls --help 2>&1 | grep -i "BusyBox" > /dev/null; then
|
||||||
localOsVar="BusyBox"
|
localOsVar="BusyBox"
|
||||||
|
# Detecting the special ubuntu userland in Windows 10 bash
|
||||||
|
elif [ -f /proc/sys/kernel/osrelease ]; then
|
||||||
|
localOsVar="$(cat /proc/sys/kernel/osrelease)"
|
||||||
else
|
else
|
||||||
localOsVar="$(uname -spio 2>&1)"
|
localOsVar="$(uname -spio 2>&1)"
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
|
@ -984,6 +987,9 @@ function GetLocalOS {
|
||||||
*"MINGW32"*|*"CYGWIN"*)
|
*"MINGW32"*|*"CYGWIN"*)
|
||||||
LOCAL_OS="msys"
|
LOCAL_OS="msys"
|
||||||
;;
|
;;
|
||||||
|
*"Microsoft"*)
|
||||||
|
LOCAL_OS)="WinNT10"
|
||||||
|
;;
|
||||||
*"Darwin"*)
|
*"Darwin"*)
|
||||||
LOCAL_OS="MacOSX"
|
LOCAL_OS="MacOSX"
|
||||||
;;
|
;;
|
||||||
|
@ -1021,6 +1027,9 @@ function GetOs {
|
||||||
# There's no good way to tell if currently running in BusyBox shell. Using sluggish way.
|
# 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
|
if ls --help 2>&1 | grep -i "BusyBox" > /dev/null; then
|
||||||
localOsVar="BusyBox"
|
localOsVar="BusyBox"
|
||||||
|
elif [ -f /proc/sys/kernel/osrelease ]; then
|
||||||
|
localOsVar="$(cat /proc/sys/kernel/osrelease)"
|
||||||
|
|
||||||
else
|
else
|
||||||
localOsVar="$(uname -spio 2>&1)"
|
localOsVar="$(uname -spio 2>&1)"
|
||||||
if [ $? != 0 ]; then
|
if [ $? != 0 ]; then
|
||||||
|
@ -1053,6 +1062,9 @@ ENDSSH
|
||||||
*"MINGW32"*|*"CYGWIN"*)
|
*"MINGW32"*|*"CYGWIN"*)
|
||||||
REMOTE_OS="msys"
|
REMOTE_OS="msys"
|
||||||
;;
|
;;
|
||||||
|
*"Microsoft"*)
|
||||||
|
REMOTE_OS="WinNT10"
|
||||||
|
;;
|
||||||
*"Darwin"*)
|
*"Darwin"*)
|
||||||
REMOTE_OS="MacOSX"
|
REMOTE_OS="MacOSX"
|
||||||
;;
|
;;
|
||||||
|
|
Loading…
Reference in New Issue