Ensure Internet connection on Yun?

Hi, I am doing a Yun project that sends an email on startup. It works when it connects directly to my router. However, when I install it on site. The email does not get sent but follow up emails do. At the site the yun gets wifi from a repeater, not from the actual router. I think what is happening is the Yun thinks it is connected, but in only connected to the local wifi and not the external internet.

Is there a way to have the Yun ping an outside site, wait for a response, then begin looping?

You can try to run a ping command or a wget command in order to ping a site or trying to download something.
Then you have to parse the output to check if you are connected or not.

To run a command you can use the Process class provided by the Bridge Library http://arduino.cc/en/Tutorial/Process

Measuring if the Yun is internet connected: