Last active
February 21, 2021 09:41
-
-
Save nguyenthang98/18a9e4e528413dd0c8f2bc3e02a7e79c to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| #!/bin/bash | |
| attemp=5 | |
| count=0 | |
| while ! $(./check_script.sh >/tmp/script_stdout.log 2>/tmp/script_stderr.log) && [[ $count -lt $attemp ]]; do | |
| count=$((count + 1)) | |
| echo "Check failed. Retrying ($(($attemp - count)) attemp remaining)..." | |
| echo "==================DEBUG===================" | |
| echo "STDOUT:" | |
| cat /tmp/script_stdout.log | |
| >&2 echo "STDERR:" | |
| >&2 cat /tmp/script_stderr.log | |
| echo "==========================================" | |
| sleep 1 | |
| done | |
| echo "STDOUT: " | |
| cat /tmp/script_stdout.log | |
| >&2 echo "STDERR: " | |
| >&2 cat /tmp/script_stderr.log |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment