„gaboshlib/g_runcmd.bashfunc“ ändern
This commit is contained in:
parent
196b705a5f
commit
e0753f91d7
@ -1,24 +1,15 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
function g_runcmd {
|
function g_runcmd {
|
||||||
|
|
||||||
g_echo "running $@"
|
g_echo "running $@"
|
||||||
$@ 2>&1 | tee $g_tmp/g_runcmd-output
|
$@ 2>&1 | tee $g_tmp/g_runcmd-output
|
||||||
g_runcmd_exitcode=$?
|
g_runcmd_exitcode=$?
|
||||||
|
|
||||||
g_echo "running $@"
|
if [ $g_runcmd_exitcode -eq 0 ]
|
||||||
|
|
||||||
if egrep -q -i "warn|error|fail|fatal" $g_tmp/g_runcmd-output
|
|
||||||
then
|
then
|
||||||
g_echo_warn "$@:
|
g_echo_ok "$@"
|
||||||
$(cat $g_tmp/g_runcmd-output)"
|
|
||||||
elif [ $g_runcmd_exitcode -eq 0 ]
|
|
||||||
then
|
|
||||||
g_echo_ok "$@:
|
|
||||||
$(cat $g_tmp/g_runcmd-output)"
|
|
||||||
else
|
else
|
||||||
g_echo_error "$@:
|
g_echo_error "$@"
|
||||||
$(cat $g_tmp/g_runcmd-output)"
|
|
||||||
fi
|
fi
|
||||||
return $g_runcmd_exitcode
|
return $g_runcmd_exitcode
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user