Check network connectivity and report via exit code
Download the latest release from https://github.com/jakewarren/amionline/releases/latest
go get github.com/jakewarren/amionline
Usage in a bash one-liner:
amionline -http && echo "connected" || echo "offline"
❯ amionline -h
Usage of amionline:
-dns
check dns resolution
-domain string
domain name to query (default "httpbin.org")
-http
check url for 200 status code
-verbose
verbose output
-version
display version
I created this utility for use in automated jobs that require internet connectivity to work; this program makes it easy to add connectivity checking to other programs.
All notable changes to this project will be documented in the changelog.
The format is based on Keep a Changelog and this project adheres to Semantic Versioning.
MIT © 2018 Jake Warren