From b645fd71c599b04e4ebd314f225b0f727d815af9 Mon Sep 17 00:00:00 2001 From: dylan araps Date: Mon, 4 Jan 2016 00:01:44 +1100 Subject: [PATCH] Added the start of OpenBSD support --- fetch.sh | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/fetch.sh b/fetch.sh index 32894f68..06c13a52 100755 --- a/fetch.sh +++ b/fetch.sh @@ -192,6 +192,10 @@ case "$(uname)" in "Darwin") os="Mac OS X" ;; + + "OpenBSD") + os="OpenBSD" + ;; esac # Get Title @@ -212,6 +216,12 @@ getuptime () { uptime="Unknown" ;; + "OpenBSD") + uptime=$(uptime | awk -F, '{ print $1 }') + uptime=${uptime# } + uptime="${uptime# * up }" + ;; + *) uptime="$(uptime -p)" ;; esac } @@ -252,6 +262,10 @@ getpackages () { packages=${packages//[[:blank:]]/} ;; + "OpenBSD") + packages=$(pkg_info | wc -l) + ;; + *) packages="Unknown" ;; esac }