]> gitweb.morketsmerke.org Git - immudex-testing.git/commitdiff
Aktualizacja immudex-motd2, poprawienia wyƛwietlania uptime-u
authorxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 Sep 2023 09:41:34 +0000 (11:41 +0200)
committerxf0r3m <jakubstasinski@protonmail.com>
Thu, 28 Sep 2023 09:41:34 +0000 (11:41 +0200)
tools/immudex-motd2

index da11dccc506dfa0e2f0663eea52acd23e8d4d1f0..9878c1da30a3cfa8607502414d9a90abaa3b4e89 100755 (executable)
@@ -25,11 +25,16 @@ else
   echo -e "  \tCRYPT_PART: N/A";
 fi
 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 "h"); 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;