more detailed logging for the retry command

This commit is contained in:
m0duspwnens
2021-12-30 13:09:29 -05:00
parent d274615376
commit cc2f6e23ca

View File

@@ -311,12 +311,19 @@ retry() {
if [[ "$output" =~ "$expectedOutput" ]]; then if [[ "$output" =~ "$expectedOutput" ]]; then
return $exitcode return $exitcode
else else
echo "Expected '$expectedOutput' but got '$output'" echo "Did not find expectedOutput: '$expectedOutput' in the output below from running the command: '$cmd'"
echo "<Start of output>"
echo "$output"
echo "<End of output>"
fi fi
elif [ -n "$failedOutput" ]; then elif [ -n "$failedOutput" ]; then
if [[ "$output" =~ "$failedOutput" ]]; then if [[ "$output" =~ "$failedOutput" ]]; then
echo "Found failed output '$failedOutput' in '$output'. Setting exitcode to 1." echo "Found failedOutput: '$failedOutput' in the output below from running the command: '$cmd'"
echo "<Start of output>"
echo "$output"
echo "<End of output>"
if [[ $exitcode -eq 0 ]]; then if [[ $exitcode -eq 0 ]]; then
echo "The exitcode was 0, but we are setting to 1 since we found $failedOutput in the output."
exitcode=1 exitcode=1
fi fi
else else