From 48ae74fce81c76c9972394bebf42bdfd145cd003 Mon Sep 17 00:00:00 2001 From: xf0r3m Date: Thu, 28 Sep 2023 11:41:34 +0200 Subject: [PATCH] =?utf8?q?Aktualizacja=20immudex-motd2,=20poprawienia=20wy?= =?utf8?q?=C5=9Bwietlania=20uptime-u?= MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit --- tools/immudex-motd2 | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/tools/immudex-motd2 b/tools/immudex-motd2 index da11dcc..9878c1d 100755 --- a/tools/immudex-motd2 +++ b/tools/immudex-motd2 @@ -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; -- 2.39.5