1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
  | #!/bin/bash 
 |    
 |  function test_wifi() { 
 |          ifconfig wlan0 down && ifconfig wlan0 up && ifconfig wlan0 | grep UP 
 |          if [ $? -ne 0 ];then 
 |                  echo "The wifi test fail !!!" 
 |                  dmesg > /userdata/rockchip-test/wifi_dmesg.txt 
 |                  exit 11 
 |          fi 
 |  } 
 |    
 |  function main() { 
 |          while true; do 
 |                  test_wifi 
 |                  sleep 1 
 |                  cnt=$((cnt + 1)) 
 |                  echo " 
 |          ################################################# 
 |          # The WiFi has been tuned on/off for $cnt times # 
 |          ################################################# 
 |                  " 
 |          done 
 |  } 
 |    
 |  main 
 |  
  |