„gaboshlib/g_runcmd.bashfunc“ ändern
This commit is contained in:
parent
196b705a5f
commit
e0753f91d7
@ -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
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user