计算机技术

Linux下ping指定ip,若出错自动重启系统,适用于bbr

新建ping.sh

内容:

#!/bin/sh
if ! ping -c 5 10.0.0.2 > /dev/null
then
echo `date` >>/pingtest.log
echo -e “The network is down! Now try restarting!n” >>/pingtest.log
/sbin/reboot
fi

 

crontab设置定期执行ping.sh即可

https://blog.csdn.net/weixin_34195364/article/details/92545198

Related Articles

发表回复

Check Also
Close
Back to top button