Last active
May 31, 2020 02:29
-
-
Save nirui/6b01864cc047b19a01b69bc8f232acd5 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 | |
TEST_TARGET=$1 | |
RECOVER_COMMANDS=("${@:2}") | |
while true; do | |
for RECOVER_CMD in "${RECOVER_COMMANDS[@]}"; do | |
while true; do | |
sleep 1 | |
(eval $TEST_TARGET) | |
if [[ $? -eq 0 ]]; then | |
continue 3 | |
fi | |
(eval $RECOVER_CMD) | |
break | |
done | |
done | |
done |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment