Merge Mac OS and FreeBSD brances of a case block

This commit is contained in:
Jonathan Neuschäfer
2014-08-21 16:47:05 +02:00
parent 02bb47e8ef
commit c4cce47ecb

View File

@@ -705,13 +705,12 @@ detectkernel () {
# Uptime Detection - Begin
detectuptime () {
unset uptime
if [ "$distro" == "Mac OS X" ]; then
if [[ "${distro}" == "Mac OS X" || "${distro}" == "FreeBSD" ]]; then
boot=$(sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1)
now=$(date +%s)
uptime=$(($now-$boot))
elif [[ "${distro}" == "FreeBSD" || "${distro}" == "OpenBSD" ]]; then
if [[ "${distro}" == "FreeBSD" ]]; then boot=$(sysctl -n kern.boottime | cut -d "=" -f 2 | cut -d "," -f 1)
else boot=$(sysctl -n kern.boottime); fi
elif [[ "${distro}" == "OpenBSD" ]]; then
boot=$(sysctl -n kern.boottime)
now=$(date +%s)
uptime=$((${now} - ${boot}))
else