我实现了一个功能,以便将我的设备连接到一个接入点,其中包含:
iw mlan0 connect $SSID
udhcpc -i mlan0
while : ; do
echo "Pausing until connection established"
mlan0_ip=`/sbin/ifconfig mlan0 | grep 'inet addr:' | cut -d: -f2 | awk '{ print $1}'`
if [ -z "$mlan0_ip" ]
then
sleep 1
else
break
fi
done
我不明白为什么 iw mlan0 connect $SSID 命令保持提示。确实被屏蔽了
[ 6231.764960] wlan: SCAN COMPLETED: scanned AP count=9
[ 6231.798636] wlan: Connected to bssid 1a:XX:XX:XX:52:66 successfully
[ 6231.808511] IPv6: ADDRCONF(NETDEV_CHANGE): mlan0: link becomes ready
udhcpc (v1.22.1) started
Sending discover...
Sending discover...
Sending discover...
[ 6241.126472] ADDBA RSP: Failed(1a:XX:XX:XX:52:66 tid=6)
Sending discover...
[ 6264.263093] ADDBA RSP: Failed(1a:XX:XX:XX:52:66 tid=6)
Sending select for 192.168.50.33...
[ 6264.497054] ADDBA RSP: Failed(1a:XX:XX:XX:52:66 tid=6)
Lease of 192.168.50.33 obtained, lease time 43200
基本上我从不进入while循环。我想在网络配置后执行一些其他命令