Fix uptime value in Solaris

This commit is contained in:
matt 2022-09-12 11:27:03 +00:00
parent 45ea478414
commit 624bd97045

View file

@ -1446,8 +1446,10 @@ get_uptime() {
;;
Solaris)
s=$(kstat -p unix:0:system_misc:snaptime | awk '{print $2}')
s=${s/.*}
boot=$(kstat -p unix:0:system_misc:boot_time | awk '{print $2}')
now=$(date +%s)
s=$((now - boot))
;;
AIX|IRIX)