本文共 566 字,大约阅读时间需要 1 分钟。
ref:
while :do for interface in $(ls /sys/class/net/ | grep -v lo | grep -v p2p0| grep -v wlan0); do status=$( /bin/cat /sys/class/net/"${interface}"/carrier ) if [ $status == 1 ]; then if [ $eth0_old_status == 0 ]; then eth0_old_status=1 udhcpc -i "${interface}" else echo "${interface} already connected" fi fi done sleep 10done
转载地址:http://pwpgi.baihongyu.com/