Sign inSign up

chko/captive

By chko

Updated over 6 years ago

captive portal checker

Image
0

1.0K

chko/captive repository overview

captive portal checker

captive is a tiny cmdline tool to check if the system it is running on has working Internet access. Useful to detect captive portals on public WiFis and corporate networks. Checks http://captive.apple.com (which powers the Captive Portal Assistant on Apple devices).

Intended to be used in shell scripts: Single binary/no dependencies, cross-platform and returns the online status as exit code.

usage

Run captive (there are no parameters). It will return with exit code 0 when online or exit code 1 when offline.

$ captive
online
$ echo $?    #check exit code
0
$ ifconfig eth0 down    #break Internet connection
$ captive
offline
$ echo $?    #check exit code
1

run with Docker

docker run --rm chko/captive

Tag summary

Content type

Image

Digest

Size

3.6 MB

Last updated

over 6 years ago

docker pull chko/captive