diff options
Diffstat (limited to 'ckt0.awk')
| -rw-r--r-- | ckt0.awk | 13 |
1 files changed, 13 insertions, 0 deletions
@@ -75,6 +75,7 @@ function ck_boottime(unm) { gsub(":", " ", t0_k_arr[4]) t0_k = sprintf("%04d %02d %02d %s", t0_k_arr[5], t0_k_arr[2], t0_k_arr[3], t0_k_arr[4]) t0_k = mktime(t0_k) + delete t0_k_arr } if (unm ~/FreeBSD/ || unm ~/Darwin/) { @@ -87,6 +88,18 @@ function ck_boottime(unm) { sub("^.*= ", "", t0_k_arr[n]) } t0_k = t0_k_arr[1] "." t0_k_arr[2] + delete t0_k_arr + } + + if (unm ~/Linux/) { + while( getline proc_stat < "/proc/stat" > 0 ) { + if (proc_stat ~ "btime") { + split(proc_stat, t0_k_arr) + t0_k = t0_k_arr[2] + delete t0_k_arr + } + } + close("/proc/stat") } else { |
