changed case to if, shaves 0.1 seconds from run time

This commit is contained in:
Andrew Titmuss 2016-03-19 13:32:33 +11:00
parent 438a3a2978
commit bb95137f01
1 changed files with 15 additions and 15 deletions

View File

@ -589,23 +589,23 @@ getuptime () {
days=$((uptime / 86400)) days=$((uptime / 86400))
# Format the output like Linux's "uptime -p" cmd. # Format the output like Linux's "uptime -p" cmd.
case "$mins" in if [ "$mins" == 1 ]; then
0) ;; uptime="up $mins minute"
1) uptime="up $mins minute" ;; elif [ "$mins" != 0 ]; then
*) uptime="up $mins minutes" ;; uptime="up $mins minutes"
esac fi
case "$hours" in if [ "$hours" == 1 ]; then
0) ;; uptime="up $hours hour, ${uptime/up }"
1) uptime="up $hours hour, ${uptime/up }" ;; elif [ "$mins" != 0 ]; then
*) uptime="up $hours hours, ${uptime/up }" ;; uptime="up $hours hours, ${uptime/up }"
esac fi
case "$days" in if [ "$days" == 1 ]; then
0) ;; uptime="up $days day, ${uptime/up }"
1) uptime="up $days day, ${uptime/up }" ;; elif [ "$days" != 0 ]; then
*) uptime="up $days days, ${uptime/up }" ;; uptime="up $days days, ${uptime/ up}"
esac fi
;; ;;
"Windows") "Windows")