Add windows support to getbirthday

This commit is contained in:
Dylan 2016-01-30 23:51:12 +11:00
parent 7ecd42fa09
commit dac7f5768f

9
fetch
View file

@ -1195,11 +1195,18 @@ getbirthday () {
date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")"
;;
"Mac OS X" | *"BSD")
"Mac OS X")
birthday="$(ls -alctT /var/log/CDIS.custom | tail -1 | awk '{printf $6 " " $7 " " $9 " " $8}')"
date_cmd="$(date -j -f "%b %d %Y" "$birthday" "+%a %d %b %Y %l:%M %p")"
;;
"Windows")
birhday="$(cmd /K WMIC OS GET InstallDate)"
birthday=${birthday/InstallDate }
birthday=${birthday//[[:space:]]/ }
date_cmd="$(date -d"$birthday" "+%a %d %b %Y %l:%M %p")"
;;
*)
birthday="Unknown"
;;