bml-cli/osdetect.sh

27 lines
688 B
Bash
Raw Normal View History

2021-04-29 15:23:59 +05:00
#!/bin/bash
2021-05-12 00:01:49 +05:00
WSL1=$(uname -r | grep -oE Microsoft)
WSL2=$(uname -r | grep -oE microsoft)
MAC=$(uname -a | grep -oE Darwin | tail -n1)
ANDROID=$(uname -a | grep -oE Android)
if [ "$WSL1" = "Microsoft" ] || [ "$WSL2" = "microsoft" ]
2021-04-29 15:23:59 +05:00
then
2021-05-12 00:01:49 +05:00
OS=windows
2021-05-10 22:14:08 +05:00
#echo ${red}WSL Not Supported!${reset} 1>&2
#exit
2021-05-12 00:01:49 +05:00
elif [ "$MAC" = "Darwin" ]
2021-04-29 15:23:59 +05:00
then
2021-05-12 00:01:49 +05:00
OS=macos
export PATH="/usr/local/opt/openssl@1.1/bin:$PATH"
2021-05-10 22:14:08 +05:00
#echo ${red}MacOS Not Supported!${reset} 1>&2
#exit
2021-05-12 00:01:49 +05:00
elif [ "$ANDROID" = "Android" ]
then
OS=android
2021-04-29 15:23:59 +05:00
else
:
fi
source readpass.sh
2021-05-12 00:01:49 +05:00