diff options
author | Dirk Engling <erdgeist@erdgeist.org> | 2024-09-21 01:11:56 +0200 |
---|---|---|
committer | Dirk Engling <erdgeist@erdgeist.org> | 2024-09-21 01:11:56 +0200 |
commit | 4133b3f3488b0b2df8ea6e63d2dd871dc4a977ce (patch) | |
tree | 4e091c6e33e7650ddcf5a4d13e911a8d0b0a936b | |
parent | 7790d80daf888a6882115608ce5e5eec6b305e26 (diff) |
Use two digit precision for uptime, thanks to D.Marck
-rwxr-xr-x | minimunin | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -70,7 +70,8 @@ swap) | |||
70 | ;; | 70 | ;; |
71 | uptime) | 71 | uptime) |
72 | boot=$(get_sys kern.boottime); boot=${boot#*sec =}; boot=${boot%%,*} | 72 | boot=$(get_sys kern.boottime); boot=${boot#*sec =}; boot=${boot%%,*} |
73 | printf "uptime.value %d\n" $(( ( `/bin/date +%s` - boot ) / 86400 )) | 73 | uptime=$(( ( `/bin/date +%s` - boot ) / 864 )) |
74 | printf "uptime.value %.$((${#uptime} - 2))s.%d\n" ${uptime} ${uptime#${uptime%??}} | ||
74 | ;; | 75 | ;; |
75 | memory) | 76 | memory) |
76 | pagesize=$(get_sys vm.stats.vm.v_page_size) | 77 | pagesize=$(get_sys vm.stats.vm.v_page_size) |