openwrt有线网卡的停用与开启
一、有线网卡
1、开启
ifup lan
2、关闭
ifdown lan
二、无线网卡
1、开启
ifup wwan
wifi up
2、关闭
ifdown wwan
wifi down
三、外网连接测试
local server="www.baidu.com"
status=$(ping -q -c 10 -W 1 $server > /dev/null 2>&1 && echo "ok" || echo "fail")
if [ "$status" = "fail" ]; then
echo "************************[net_test]:server:"$server" network error" > /dev/console
fi