How do you check in a script for internet connectivity?

Kind of: If you have internet do your thing, else exit here and do nothing.

(My solution was a ping, but then I get `ping: sendmsg: No route to host` in my cronjobs.)

Follow

Okay. It seems to work with ping and `if [ $? -eq 0 ]`. I just did the wrong check.

Sign in to participate in the conversation
chaos.social

chaos.social - because anarchy is much more fun with friends.
chaos.social is a small Mastodon instance for and by the Chaos community surrounding the Chaos Computer Club. We provide a small community space - Be excellent to each other, and have a look at what that means around here.
Follow @ordnung for low-traffic instance-related updates.
The primary instance languages are German and English.