Start of Windows support

This commit is contained in:
dylan araps 2016-01-05 16:32:34 +11:00
parent c3c8c23d1d
commit 1059ccd566
1 changed files with 21 additions and 0 deletions

View File

@ -216,6 +216,10 @@ case "$(uname)" in
"OpenBSD")
os="OpenBSD"
;;
"CYGWIN"*)
os="Windows"
;;
esac
# Get Distro
@ -239,6 +243,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"
;;
@ -302,6 +315,10 @@ getuptime () {
uptime=${uptime# }
;;
"Windows")
uptime=$(uptime | awk -F ':[0-9]{2}+ |(, ){1}+' '{printf $2}')
;;
*)
uptime="Unknown"
;;
@ -355,6 +372,10 @@ getpackages () {
packages=$(pkg_info | wc -l)
;;
"Windows"*)
packages=$(cygcheck -cd | wc -l)
;;
*)
packages="Unknown"
;;