From e0753f91d748bf6b4583c19cf8ae62a00e613132 Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 1 Dec 2022 13:27:35 +0100 Subject: [PATCH] =?UTF-8?q?=E2=80=9Egaboshlib/g=5Fruncmd.bashfunc=E2=80=9C?= =?UTF-8?q?=20=C3=A4ndern?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gaboshlib/g_runcmd.bashfunc | 17 ++++------------- 1 file changed, 4 insertions(+), 13 deletions(-) diff --git a/gaboshlib/g_runcmd.bashfunc b/gaboshlib/g_runcmd.bashfunc index 90a1a38..6479f1e 100644 --- a/gaboshlib/g_runcmd.bashfunc +++ b/gaboshlib/g_runcmd.bashfunc @@ -1,24 +1,15 @@ #!/bin/bash function g_runcmd { - g_echo "running $@" - $@ 2>&1 | tee $g_tmp/g_runcmd-output + $@ 2>&1 | tee $g_tmp/g_runcmd-output g_runcmd_exitcode=$? - g_echo "running $@" - - if egrep -q -i "warn|error|fail|fatal" $g_tmp/g_runcmd-output + if [ $g_runcmd_exitcode -eq 0 ] then - g_echo_warn "$@: -$(cat $g_tmp/g_runcmd-output)" - elif [ $g_runcmd_exitcode -eq 0 ] - then - g_echo_ok "$@: -$(cat $g_tmp/g_runcmd-output)" + g_echo_ok "$@" else - g_echo_error "$@: -$(cat $g_tmp/g_runcmd-output)" + g_echo_error "$@" fi return $g_runcmd_exitcode }