dut-init.sh 1.0 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. #!/bin/sh
  2. ./boot-fs.sh &
  3. sleep 2
  4. if [ `./PurpleExec --list | grep UDID | wc -l` -eq 0 ]; then
  5. kk=1;
  6. while [ $kk -lt 10 ]; do
  7. kk=$(($kk+1))
  8. echo "Trial $kk"
  9. sleep 2
  10. [ `./PurpleExec --list | grep UDID | wc -l` -eq 1 ] && break;
  11. done
  12. if [ `./PurpleExec --list | grep UDID | wc -l` -eq 0 ]; then
  13. exit 1
  14. fi
  15. fi
  16. udid=`./PurpleExec --list | grep UDID | cut -d":" -f2 | awk '{print $1}'`
  17. ./PurpleExec --pair $udid
  18. sleep 2
  19. if [ `./PurpleExec --list | grep unpaired | wc -l` -eq 1 ]; then
  20. ./PurpleExec --pair $udid
  21. sleep 2
  22. if [ `./PurpleExec --list | grep unpaired | wc -l` -eq 1 ]; then
  23. ./PurpleExec --pair $udid
  24. sleep 2
  25. if [ `./PurpleExec --list | grep unpaired | wc -l` -eq 1 ]; then
  26. exit 2;
  27. fi
  28. fi
  29. fi
  30. ./PurpleExec /bin/rm --args "-r","/var/root/CoEx"
  31. ./tcprelay --portoffset 10000 23 873 &
  32. sleep 2
  33. ./rsync.sh
  34. checkrsync=`./PurpleExec /bin/ls --args "/var/root" | grep CoEx | wc -l`
  35. if [ $checkrsync -eq 0 ]; then
  36. exit 3;
  37. fi
  38. ./PurpleExec /bin/chmod --args "755,/var/root/CoEx/chm.sh"
  39. ./PurpleExec /var/root/CoEx/chm.sh