Start of Windows support (experimental, needs testing)
This commit is contained in:
parent
0145b678ac
commit
0d18832f71
1 changed files with 22 additions and 0 deletions
22
fetch.sh
22
fetch.sh
|
@ -205,6 +205,10 @@ case "$(uname)" in
|
|||
"OpenBSD")
|
||||
os="OpenBSD"
|
||||
;;
|
||||
|
||||
"CYGWIN"*)
|
||||
os="Windows"
|
||||
;;
|
||||
esac
|
||||
|
||||
# Get Distro
|
||||
|
@ -228,6 +232,15 @@ getdistro () {
|
|||
distro="OpenBSD"
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
# TODO: Detect XP/7
|
||||
if [ "$(wmic os get version | grep -o '^10')" ]; then
|
||||
distro="Windows 10"
|
||||
else
|
||||
distro="Windows"
|
||||
fi
|
||||
;;
|
||||
|
||||
*)
|
||||
distro="Unknown"
|
||||
;;
|
||||
|
@ -291,6 +304,10 @@ getuptime () {
|
|||
uptime=${uptime# }
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}')
|
||||
;;
|
||||
|
||||
*)
|
||||
uptime="Unknown"
|
||||
;;
|
||||
|
@ -344,6 +361,10 @@ getpackages () {
|
|||
packages=$(pkg_info | wc -l)
|
||||
;;
|
||||
|
||||
"Windows"*)
|
||||
packages=$(cygcheck -cd | wc -l)
|
||||
;;
|
||||
|
||||
*)
|
||||
packages="Unknown"
|
||||
;;
|
||||
|
@ -890,3 +911,4 @@ printf "\e[$(tput lines)H\e[1A\e[?25h"
|
|||
# }}}
|
||||
|
||||
|
||||
|
||||
|
|
Loading…
Reference in a new issue