소스 검색

Fix uptime value in Solaris

matt 2 년 전
부모
커밋
624bd97045
1개의 변경된 파일4개의 추가작업 그리고 2개의 파일을 삭제
  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)