Added the start of OpenBSD support

This commit is contained in:
dylan araps 2016-01-04 00:01:44 +11:00
parent 572062d98b
commit b645fd71c5
1 changed files with 14 additions and 0 deletions

View File

@ -192,6 +192,10 @@ case "$(uname)" in
"Darwin") "Darwin")
os="Mac OS X" os="Mac OS X"
;; ;;
"OpenBSD")
os="OpenBSD"
;;
esac esac
# Get Title # Get Title
@ -212,6 +216,12 @@ getuptime () {
uptime="Unknown" uptime="Unknown"
;; ;;
"OpenBSD")
uptime=$(uptime | awk -F, '{ print $1 }')
uptime=${uptime# }
uptime="${uptime# * up }"
;;
*) uptime="$(uptime -p)" ;; *) uptime="$(uptime -p)" ;;
esac esac
} }
@ -252,6 +262,10 @@ getpackages () {
packages=${packages//[[:blank:]]/} packages=${packages//[[:blank:]]/}
;; ;;
"OpenBSD")
packages=$(pkg_info | wc -l)
;;
*) packages="Unknown" ;; *) packages="Unknown" ;;
esac esac
} }