The get* functions now fallback to 'Unknown' instead of printing nothing
This commit is contained in:
parent
cd4848e27c
commit
c034067573
1 changed files with 11 additions and 1 deletions
12
fetch.sh
12
fetch.sh
|
@ -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
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue