init.qti.write.sh 517 B

123456789101112131415161718192021222324252627
  1. #!/vendor/bin/sh
  2. #=============================================================================
  3. # Copyright (c) 2021 Qualcomm Technologies, Inc.
  4. # All Rights Reserved.
  5. # Confidential and Proprietary - Qualcomm Technologies, Inc.
  6. #=============================================================================
  7. write_with_check() {
  8. local i=60
  9. while [ $i -gt 0 ]
  10. do
  11. if [ -f "$1" ]; then
  12. break
  13. fi
  14. sleep 1
  15. i=$(($i-1))
  16. done
  17. if [ ! -f "$1" ]; then
  18. exit 1
  19. fi
  20. echo $2 > $1
  21. }
  22. write_with_check "$1" "$2"