Created
October 16, 2020 20:10
-
-
Save zfogg/f7fae4492cf7d6c2bcf68ee25ccbd28e to your computer and use it in GitHub Desktop.
network testing on any UNIX system without calling any binaries
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env sh | |
address=${1:-localhost} | |
port=${2:-53} | |
proto=${3:-tcp} | |
(echo > "/dev/$proto/$address/$port") >/dev/null 2>&1 \ | |
&& echo "✅ $address:$port is ONline ✅" \ | |
|| echo "⛔ $address:$port is OFFline ⛔" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment