From 96dcd7e68468b191df74606a7194bacdf8ab9e8f Mon Sep 17 00:00:00 2001 From: olli Date: Thu, 1 Dec 2022 10:29:21 +0100 Subject: [PATCH] added warning --- gaboshlib/g_runcmd.bashfunc | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/gaboshlib/g_runcmd.bashfunc b/gaboshlib/g_runcmd.bashfunc index 6b4a117..fa5876b 100644 --- a/gaboshlib/g_runcmd.bashfunc +++ b/gaboshlib/g_runcmd.bashfunc @@ -3,9 +3,13 @@ function g_runcmd { $@ >$g_tmp/g_runcmd-output 2>&1 g_runcmd_exitcode=$? - if [ $g_runcmd_exitcode -eq 0 ] + + if egrep -q -i "warn|error|fail|fatal" $g_tmp/g_runcmd-output then - g_echo_ok "$@: $(cat $g_tmp/g_runcmd-output)" + 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)" else g_echo_error "$@: $(cat $g_tmp/g_runcmd-output)" fi