The get* functions now fallback to 'Unknown' instead of printing nothing
This commit is contained in:
parent
cd4848e27c
commit
c034067573
12
fetch.sh
12
fetch.sh
|
@ -212,6 +212,10 @@ getdistro () {
|
|||
"OpenBSD")
|
||||
distro="OpenBSD"
|
||||
;;
|
||||
|
||||
*)
|
||||
distro="Unknown"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -242,6 +246,10 @@ getuptime () {
|
|||
uptime=${uptime# }
|
||||
uptime="${uptime# * up }"
|
||||
;;
|
||||
|
||||
*)
|
||||
uptime="Unknown"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
@ -285,7 +293,9 @@ getpackages () {
|
|||
packages=$(pkg_info | wc -l)
|
||||
;;
|
||||
|
||||
*) packages="Unknown" ;;
|
||||
*)
|
||||
packages="Unknown"
|
||||
;;
|
||||
esac
|
||||
}
|
||||
|
||||
|
|
Reference in New Issue