How-to ensure your Mac waits for internet connection before booting

One common issue among Macs is that the Wowza service tries to fire up prior to network availability.  To avoid this, you might write your own startup script that includes this very check.  This is one (of a million) ways you could check for internet connectivity before startup:


until wget -q -O – | grep Lucky > /dev/null; do
sleep 10

# continue with rest of startup script

This will attempt to load and look for the word “Lucky” in the markup.

Alternatively you could parse the headers in the wget response:

wget -SO- -T 1 -t 1 2>&1 >/dev/null | grep -c “HTTP/1.1 200 OK”

Would return “1″ if found etc.

Comments are closed.