]> gitweb.morketsmerke.org Git - backup.git/commitdiff
searx-motd - BT#118
authorxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 Sep 2023 08:36:30 +0000 (10:36 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 Sep 2023 08:36:30 +0000 (10:36 +0200)
searx-motd

index d0e75bfb82c268938c884d55ef3320f154d2aaa8..5efdf76ad04c009c68ad8ea3ad82514ce8804092 100755 (executable)
@@ -23,11 +23,16 @@ for mountPoint in $mountPointsList; do
   fi
 done
 echo -e "  \tPROCESSES: $(ps -aux | wc -l | awk '{printf $1}')";
-utime=$(uptime | awk '{printf $3}' | sed 's/,//');
-if $(echo $utime | grep -q ":"); then
-  echo -e "  \tUPTIME: ${utime}";
+if $(uptime | grep -q 'day'); then
+  utime=$(uptime | awk '{printf $3" "$4" "$5}' | sed -e 's/\,$//' -e 's,:,h ,');
+  echo -e "\tUPTIME: ${utime}m";
 else
-  echo -e "  \tUPTIME: 0:${utime}";
+  utime=$(uptime | awk '{printf $3}' | sed -e 's/,//' -e 's,:,h ,');
+  if $(echo $utime | grep -q ":"); then
+    echo -e "  \tUPTIME: ${utime}m";
+  else
+    echo -e "  \tUPTIME: 0h ${utime}m";
+  fi
 fi
 echo -e " \t$(uptime | grep -o "load.*$" | tr [a-z] [A-Z])";
 echo;