Better uptime command that will work accross uptime versions

This commit is contained in:
Dylan Araps 2016-08-28 12:03:23 +10:00
parent bd7ebdfe4b
commit 0a2fa2b558
1 changed files with 4 additions and 1 deletions

View File

@ -238,7 +238,10 @@ getuptime() {
;;
"Android"*)
uptime=$(uptime | awk -F ': |, ' '{printf $2}')
uptime=$(uptime | awk -F ' up' '{print $2}')
time="${time//[0-9] user*}"
time="${time//load average:*}"
time="${time%,*} ${time##*,}"
;;
*)