I would comment, but I do not have enough points for this. I still want to contribute. Thus, this makes it work even if the while loop is nested in another loop. before breaking, the variable c is reset to zero. @anubhava loans that came up with an original solution.
#!/bin/sh while ! test -d /somemount/share/folder do echo "Waiting for mount /somemount/share/folder..." ((c++)) && ((c==10)) && c=0 && break sleep 1 done
source share