mirror of
https://github.com/dustinkirkland/byobu
synced 2025-08-21 14:03:18 -07:00
Add FreeBSD uptime, fix formatting again
This commit is contained in:
parent
262906b6c1
commit
6f577c0610
2 changed files with 69 additions and 68 deletions
|
@ -30,6 +30,9 @@ __uptime() {
|
|||
if [ -r /proc/uptime ]; then
|
||||
read u idle < /proc/uptime
|
||||
u=${u%.*}
|
||||
elif [ $(uname) = "FreeBSD" ]; then
|
||||
u=$( sysctl -n kern.boottime | sed -En 's:.*sec = ([[:digit:]]+),.*:\1:p' )
|
||||
u=$(($(date +%s) - $u))
|
||||
elif [ -x /usr/sbin/sysctl ]; then
|
||||
# MacOS support
|
||||
u=$(/usr/sbin/sysctl -n kern.boottime | cut -f4 -d' ' | cut -d',' -f1)
|
||||
|
@ -52,5 +55,3 @@ __uptime() {
|
|||
[ -n "$str" ] || return
|
||||
color w b; printf "%s" "${str}"; color --
|
||||
}
|
||||
|
||||
# vi: syntax=sh ts=4 noexpandtab
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue