make exitCodeOk work in chroot
This commit is contained in:
12
functions.sh
Normal file → Executable file
12
functions.sh
Normal file → Executable file
@@ -45,12 +45,14 @@ function fileNumLines {
|
||||
|
||||
|
||||
#ok if given program returns given code
|
||||
# arg1: program to run
|
||||
# arg2: expected return code (default 0)
|
||||
# arg1: chroot
|
||||
# arg2: program to run
|
||||
# arg2: expected return code
|
||||
function exitCodeOk {
|
||||
program=$1
|
||||
code=${2:=0}
|
||||
$program &> /dev/null
|
||||
chroot=$1
|
||||
program=$2
|
||||
code=${3}
|
||||
chroot ${chroot} bash -c "$program" &> /dev/null
|
||||
if [ $? -eq $code ] ; then echo -ne "1;" ; else echo -ne "0;" ; fi
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user