rc.common 1.1 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849
  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. if [[ "$ENABLE_USB_ETH_ORIGINAL_MAC" == "true" ]]; then
  15. CONFIG="inet addr"
  16. else
  17. CONFIG="HWaddr"
  18. fi
  19. #Set the correct GPIO for the audio driver (T31 only)
  20. if [ -f /opt/wz_mini/tmp/.HL_PAN2 ]; then
  21. GPIO=7
  22. elif [ -f /opt/wz_mini/tmp/.WYZE_CAKP2JFUS ]; then
  23. GPIO=63
  24. fi
  25. wait_for_wlan() {
  26. while true; do
  27. if ifconfig wlan0 | grep "$CONFIG"; then
  28. break
  29. fi
  30. echo "Network not ready yet, try again in 5 seconds"
  31. sleep 5
  32. done
  33. }
  34. wait_for_wlan_ip() {
  35. while true; do
  36. if ifconfig wlan0 | grep "inet addr"; then
  37. break
  38. fi
  39. echo "IP Address not aquired yet, try again in 5 seconds"
  40. sleep 5
  41. done
  42. }