Browse Source

Fix uptime value in Solaris

matt 2 years ago
parent
commit
624bd97045
1 changed files with 4 additions and 2 deletions
  1. 4 2
      neofetch

+ 4 - 2
neofetch

@@ -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)