标签:mii-tool
#!/bin/bash
neteth0=`/sbin/mii-tool eth0|awk ‘{print $5}‘`
neteth1=`/sbin/mii-tool eth1|awk ‘{print $5}‘`
if [[ $neteth0 == "ok" ]] || [[ $neteth1 == "ok" ]]; then
echo "Network is ok" >> /var/log/ha-net.log
echo "network good"
else [[ $neteth0 != "ok" ]] && [[ $neteth1 != "ok" ]]
echo "Network is down!" >> /var/log/ha-net.log
fi
sleep 5
注:在计划任务中,mii-tool需要加绝对路径,/sbin/mii-tool
本文出自 “未来时空” 博客,请务必保留此出处http://sjitwant.blog.51cto.com/3661219/1709743
标签:mii-tool
原文地址:http://sjitwant.blog.51cto.com/3661219/1709743