rc.common 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/sh
  2. source /opt/wz_mini/wz_mini.conf
  3. #Set module dir depending on platform
  4. if [ -f /opt/wz_mini/tmp/.T20 ]; then
  5. KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14"
  6. else
  7. KMOD_PATH="/opt/wz_mini/lib/modules/3.10.14__isvp_swan_1.0__"
  8. fi
  9. if [[ "$ENABLE_USB_ETH" == "true" ]]; then
  10. ALT_IFACE=eth0
  11. elif [[ "$ENABLE_USB_DIRECT" == "true" ]] || [[ "$ENABLE_USB_RNDIS" == "true" ]]; then
  12. ALT_IFACE=usb0
  13. fi
  14. #Set the correct GPIO for the audio driver (T31 only)
  15. if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
  16. GPIO=7
  17. elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
  18. GPIO=63
  19. fi
  20. wait_for_wlan() {
  21. while true; do
  22. if ifconfig wlan0 | grep "HWaddr"; then
  23. break
  24. fi
  25. echo "Network HW not ready yet, try again in 5 seconds"
  26. sleep 5
  27. done
  28. }
  29. wait_for_wlan_wpa() {
  30. while true; do
  31. if [ -e /tmp/wpa_supplicant.conf ]; then
  32. break
  33. fi
  34. echo "wpa_supplicant not initialized yet, try again in 5 seconds"
  35. sleep 5
  36. done
  37. }
  38. wait_for_wlan_ip() {
  39. while true; do
  40. if ifconfig wlan0 | grep "inet addr"; then
  41. break
  42. fi
  43. echo "IP Address not aquired yet, try again in 5 seconds"
  44. sleep 5
  45. done
  46. }