mirror of
https://github.com/dylanaraps/neofetch.git
synced 2025-12-14 04:32:12 +00:00
Uptime: Added support for AIX
This commit is contained in:
8
neofetch
8
neofetch
@@ -349,6 +349,14 @@ get_uptime() {
|
||||
seconds="$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')"
|
||||
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
|
||||
|
||||
days="$((seconds / 60 / 60 / 24)) days"
|
||||
|
||||
Reference in New Issue
Block a user