From: xf0r3m Date: Thu, 28 Sep 2023 09:41:34 +0000 (+0200) Subject: Aktualizacja immudex-motd2, poprawienia wyƛwietlania uptime-u X-Git-Url: https://gitweb.morketsmerke.org/?a=commitdiff_plain;h=48ae74fce81c76c9972394bebf42bdfd145cd003;p=immudex-testing.git Aktualizacja immudex-motd2, poprawienia wyƛwietlania uptime-u --- 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;