qtisetprop 659 B

12345678910111213141516171819202122232425262728293031
  1. #!/bin/sh --
  2. # Copyright (c) 2019-2020 Qualcomm Technologies, Inc.
  3. # All Rights Reserved.
  4. # Confidential and Proprietary - Qualcomm Technologies, Inc.
  5. ril_db="/data/vendor/radio/qcrilNr.db"
  6. help() {
  7. echo "Syntax error! Example: qtisetprop config_name config_val"
  8. }
  9. if [ $# -ne 2 ]; then
  10. help
  11. exit 1
  12. fi
  13. # Disable exit on non 0
  14. set +e
  15. query_result="0"
  16. if [[ -f $ril_db ]]; then
  17. query_result=`echo "SELECT 1 FROM qcril_properties_table WHERE property='$1';" | sqlite3 $ril_db`
  18. fi
  19. if [[ $query_result == "1" ]]; then
  20. echo "UPDATE qcril_properties_table SET value='$2' WHERE property='$1';" | sqlite3 $ril_db
  21. else
  22. setprop $1 $2
  23. fi