Created
December 8, 2016 16:49
-
-
Save pboothe/b095ce0aac3a713f5373e12120f4f360 to your computer and use it in GitHub Desktop.
This file contains 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
did_they_come_back() { | |
echo "#### Starting did_they_come_back() ####" | |
#TODO: Make this take out bad entries from $REBOOT_CANDIDATES | |
for line in `cat "${REBOOT_ATTEMPTED}"`; do | |
attempted_host=`echo $line | awk -F: '{ print $1 }'` | |
if grep -q "${attempted_host}" "${REBOOT_CANDIDATES}" ; then | |
echo "${attempted_host} still not up but requested during last run:" \ | |
$line |tee -a ${PROBLEMATIC} "${NOTIFICATION_EMAIL}" > /dev/null | |
else | |
echo $line >> "${REBOOT_LOG}" | |
fi | |
done | |
for candidate in `cat "${REBOOT_CANDIDATES}"`; do | |
if grep -q $candidate "${REBOOT_ATTEMPTED}" ; then | |
echo "$candidate still not up but requested during last run:" \ | |
$line |tee -a ${PROBLEMATIC} "${NOTIFICATION_EMAIL}" > /dev/null | |
fi | |
done | |
# Write this backwards, so that if a line in reboot candidates is also found in | |
# REBOOT_ATTEMPTED, then write it out to problematic? | |
# TODO: Is it ok to leave it on the REBOOT_CANDIDATES list to try again, even | |
# if it didn't come back right from the last run? | |
} | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment