Start of Windows support (experimental, needs testing)

This commit is contained in:
dylan araps 2016-01-05 11:46:08 +11:00
parent 0145b678ac
commit 0d18832f71

View file

@ -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"
# }}}