1 个不稳定版本
0.1.0 | 2022年10月9日 |
---|
#71 在 #online
16KB
352 行
is-online
一个命令行界面,用于检查一个或多个主机上的端口号是否在线。
示例
检查通过IPv4和IPv6在1秒内是否可访问端口443
$ is-online --all google.ch -p 443
google.ch:80 is online
等待 gateway.example.org 通过SSH可访问(假设它当前处于离线状态)
$ is-online gateway.example.org --wait
gateway.example.org:22 is offline
gateway.example.org:22 is offline
gateway.example.org:22 is online
如果任何主机通过SSH不可访问,则退出码为1
$ is-online --fail node-1.example.org node-2.example.org node-3.example.org
通过stdin检查主机的在线状态
cat hosts.txt | is-online
依赖项
~6–17MB
~204K SLoC