Check network bash
1 2 3 4 5 6 7 |
#!/bin/bash timestamp=$(date +%Y/%m/%d_%T%Z) ping -c5 www.ustc.edu.cn if [ $? -ne 0 ]; then echo "[${timestamp}] Can't Connect to internate, reboot now..." >> /var/log/checknet.log /sbin/reboot fi |
本作品采用创作共用版权协议, 要求署名、非商业用途和保持一致. 转载本站内容必须也遵循署名-非商业用途-保持一致的创作共用协议.
发表回复