Sample Header Ad - 728x90

What is the simplest way to detect internet connectivity on macOS with a script?

2 votes
1 answer
458 views
I know I can use **ping** or **nc**, but macOS itself must be storing the state of internet connection somewhere right? For example, when you connect to Wifi, with no internet, macOS gives an indication (in Control Center) that it has connected to the Wifi but there is no internet. That's the kind of use case I want to verify by determining internet connectivity: Wi-Fi information in Control Center displaying Can that information be accessed through Terminal or by a script to determine if an internet connection exists?
Asked by sfxedit (1897 rep)
Sep 21, 2024, 07:16 AM
Last activity: Sep 22, 2024, 11:54 PM