Hiya Bubbagump!
The way that it's written, it really should sleep for 20 seconds there. It does in my test environment. I have to make a couple of alterations for it to run in my shell though. Newer versions of bash don't like the double equal "==". I also removed the "$" from the echo lines, though I don't think that's affecting how your script runs:
Code:
#!/bin/bash
status=$(curl -s -k https://somesite.com/heartbeat)
if [ "$status" = "alive" ]; then
echo 'Alive!'
exit 0
else
echo 'We may have a problem, let me check again in 20 secs before freaking out.'
sleep 20
fi
status2=$(curl -s -k https://somesite.com/heartbeat)
if [ "$status2" = "alive" ]; then
echo 'Nah, we cool. Alive!'
exit 0
else
echo 'No, this is for reals! Evasive maneuvers!'
#/etc/init.d/cmm_prod_1 force-reload;
echo '<do stuff here>'
fi
You don't get any errors or anything, it just skips to the next 'if'?