Merge pull request #164 from iandrewt/osx_uptime
changed osx_uptime parsing of seconds from case to if
This commit is contained in:
commit
60ce0d14e5
30
neofetch
30
neofetch
|
@ -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")
|
||||||
|
|
Reference in New Issue