How can I tell if OS X is connected to a VPN network from the command line?
ifconfig without any arguments when I am connected, I see that there is a
utun0 interface which appears to be the VPN connection. When I disconnect it goes away.
I believe I could use something like this to check for the string
utun0 and count the occurrences:
ifconfig | grep -c utun0
But is there an easier or more effective way to check for this? If
utun0 is a device, or even a pseudo device, shouldn't I be able to check if it exists with something like:
if [ -a '/dev/utun0' ]
Unfortunately I don't see any changes in that directory when connecting and disconnecting, I just see
/dev/tun15 and I can't
cat them even with
Is there a simpler way to tell if I have a VPN connection?