如何检查MacOS Terminal是否可以连接互联网?

问题描述 投票:-2回答:1

我使用了Ping命令:

ping -c1 -W1 8.8.8.8

如果在线,效果很好,但是在Internet不可用或LAN关闭的情况下的情况下,终端需要较长时间回复并显示结果。]

我希望终端机回复在[[最长时间1或0​​.5秒中在我的结果中使用结果>]

ExtendScript

代码:var command = "ping -c1 -W1 8.8.8.8"; var result= system.callSystem(command);

我尝试使用-t或-W设置超时,但失败了

我使用了Ping命令:ping -c1 -W1 8.8.8.8如果在线可以很好地工作,但是如果无法使用Internet或LAN关闭,则终端会花很长时间回复结果。 ..

macos terminal ping extendscript ecmascript-3
1个回答
0
投票
如果您在MacOS终端上,则可以通过以下方式检查Internet连接:
© www.soinside.com 2019 - 2024. All rights reserved.