The get* functions now fallback to 'Unknown' instead of printing nothing

This commit is contained in:
dylan araps 2016-01-04 09:25:30 +11:00
parent cd4848e27c
commit c034067573
1 changed files with 11 additions and 1 deletions

View File

@ -212,6 +212,10 @@ getdistro () {
"OpenBSD") "OpenBSD")
distro="OpenBSD" distro="OpenBSD"
;; ;;
*)
distro="Unknown"
;;
esac esac
} }
@ -242,6 +246,10 @@ getuptime () {
uptime=${uptime# } uptime=${uptime# }
uptime="${uptime# * up }" uptime="${uptime# * up }"
;; ;;
*)
uptime="Unknown"
;;
esac esac
} }
@ -285,7 +293,9 @@ getpackages () {
packages=$(pkg_info | wc -l) packages=$(pkg_info | wc -l)
;; ;;
*) packages="Unknown" ;; *)
packages="Unknown"
;;
esac esac
} }