Commit 141f6f12 authored by Muhammad Herdiansyah's avatar Muhammad Herdiansyah

Uptime: Added support for AIX

parent 2b13b8a9
...@@ -349,6 +349,14 @@ get_uptime() { ...@@ -349,6 +349,14 @@ get_uptime() {
seconds="$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')" seconds="$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')"
seconds="${seconds/.*}" seconds="${seconds/.*}"
;; ;;
"AIX")
t="$(LC_ALL=POSIX ps -o etime= -p 1)"
d="0" h="0"
case "$t" in *"-"*) d="${t%%-*}"; t="${t#*-}";; esac
case "$t" in *":"*":"*) h="${t%%:*}"; t="${t#*:}";; esac
seconds="$((d*86400 + h*3600 + ${t%%:*}*60 + ${t#*:}))"
;;
esac esac
days="$((seconds / 60 / 60 / 24)) days" days="$((seconds / 60 / 60 / 24)) days"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment