当服务器下线时发出嘟嘟声

ping服务器每秒一次,当服务器无法访问时发出嘟嘟声。基本上与以下情况相反:ping -a服务器或ip.com,当服务器可达时会发出蜂鸣声。您也可以用任何命令替代蜂鸣声,这会使此一个强大的选择平-a:虽然是真的; do [“$(ping -c1W1w1 server-or-ip.com 2> / dev / null | awk'/ received / {print $ 4}')”= 1] && date ||回声'服务器已关闭!';睡1;这样会每秒输出日期和时间,直到ping失败,在这种情况下,它会回显。注意:需要嘟嘟声包。可能需要以root身份运行(嘟嘟声使用系统扬声器)在Ubuntu上测试过,没有发出嘟嘟声的盒子... sudo apt-get install beep
.

0

linux命令:while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done done 1; sleep beep; && ] 1 != $4}')" {print '/received/ awk | server-or-ip.com -c1W1w1 "$(ping [ do true; while while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; donerootopen.com
linux命令:while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; done done 1; sleep beep; && ] 1 != $4}')" {print '/received/ awk | server-or-ip.com -c1W1w1 "$(ping [ do true; while while true; do [ "$(ping -c1W1w1 server-or-ip.com | awk '/received/ {print $4}')" != 1 ] && beep; sleep 1; donerootopen.com
ustn 2018-03-23 00:24:48
输出

评论

相关推荐
共收录0条命令行
这里是记录和分享命令行的地方, 所有命令行都可以进行评论、提交替代方案.

热门文章