board_status.sh add non-fatal test_cmd
- add a non-fatal option to test_cmd. Change-Id: If74693ea7ec8ea24104d5836e4c24bfb135ef0e1 Signed-off-by: Martin Roth <martin.roth@se-eng.com> Reviewed-on: http://review.coreboot.org/6257 Tested-by: build bot (Jenkins) Reviewed-by: Paul Menzel <paulepanter@users.sourceforge.net> Reviewed-by: David Hendricks <dhendrix@chromium.org>
This commit is contained in:
parent
2fa8cc35a8
commit
be5340bad2
|
@ -17,11 +17,15 @@ UPLOAD_RESULTS=0
|
||||||
# if command should be run remoteley when a remote host is specified.
|
# if command should be run remoteley when a remote host is specified.
|
||||||
LOCAL=0
|
LOCAL=0
|
||||||
REMOTE=1
|
REMOTE=1
|
||||||
|
FATAL=0
|
||||||
|
NONFATAL=1
|
||||||
|
|
||||||
# test a command
|
# test a command
|
||||||
#
|
#
|
||||||
# $1: test command on remote host (0=no, 1=yes)
|
# $1: test command on remote host (0=no, 1=yes)
|
||||||
# $2: command to test
|
# $2: command to test
|
||||||
|
# $3: 0 ($FATAL) Exit with an error if the command fails
|
||||||
|
# 1 ($NONFATAL) Don't exit on command test failure
|
||||||
test_cmd()
|
test_cmd()
|
||||||
{
|
{
|
||||||
local rc
|
local rc
|
||||||
|
@ -39,7 +43,11 @@ test_cmd()
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ $rc -eq 0 ]; then
|
if [ $rc -eq 0 ]; then
|
||||||
return
|
return 0
|
||||||
|
fi
|
||||||
|
|
||||||
|
if [ $3 -eq 1 ]; then
|
||||||
|
return 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
echo "$2 not found"
|
echo "$2 not found"
|
||||||
|
|
Loading…
Reference in New Issue