I am having a problem with my bash script. My script, among other things, starts a server, which takes some time. To combat a long run, I set up a while loop that the server asks to see if it works.
while [ $running -eq 0 ]; do echo "===" $response "==="; if [ "$response" == "" ] || [ "$response" == *"404 Not Found"* ]; then sleep 1; response=$(curl $ip:4502/libs/granite/core/content/login.html); else running=1; fi done
When exiting the loop $ response is equal to the line "404". If so, the thing should still be in a loop, right? My loop seems to be coming out prematurely.
Joe
source share