代码: 全选
testing=$(ethtool eth0 | grep 'Link detected' | cut -d ':' -f 2)
if [ "$testing"=="yes" ];then
mentohust
fi
代码: 全选
testing=$(ethtool eth0 | grep 'Link detected' | cut -d ':' -f 2)
if [ "$testing"=="yes" ];then
mentohust
fi
原来这个命令这么好用。━┳━ ━┳━。菜鸟表示好多命令没见过。YeLee 写了:表示一直用的NM,直接用nm-tool的State信息就可以了。
代码: 全选
testing=$(ifconfig eth0 | grep "RUNNING")
if [ "$testing" != "" ];then
mentohust
fi