Simplify uptime for OSX / BSD
This commit is contained in:
parent
36ca05dba5
commit
eefca64248
14
neofetch
14
neofetch
|
@ -587,22 +587,24 @@ getuptime () {
|
|||
|
||||
# Format the output like Linux's "uptime -p" cmd.
|
||||
if [ "$mins" == 1 ]; then
|
||||
uptime="up $mins minute"
|
||||
mins+=" minute"
|
||||
elif [ "$mins" != 0 ]; then
|
||||
uptime="up $mins minutes"
|
||||
mins+=" minutes"
|
||||
fi
|
||||
|
||||
if [ "$hours" == 1 ]; then
|
||||
uptime="up $hours hour, ${uptime/up }"
|
||||
hours+=" hour,"
|
||||
elif [ "$mins" != 0 ]; then
|
||||
uptime="up $hours hours, ${uptime/up }"
|
||||
hours+=" hours,"
|
||||
fi
|
||||
|
||||
if [ "$days" == 1 ]; then
|
||||
uptime="up $days day, ${uptime/up }"
|
||||
days+=" day,"
|
||||
elif [ "$days" != 0 ]; then
|
||||
uptime="up $days days, ${uptime/ up}"
|
||||
days+=" days,"
|
||||
fi
|
||||
|
||||
uptime="up $days $hours $mins"
|
||||
;;
|
||||
|
||||
"Windows")
|
||||
|
|
Reference in New Issue