• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1#!/bin/bash
2
3# This script is used to generate uwb conuntry configuration file,
4# and the PRODUCT_COPY_FILES list in uwb.mk based on uwb_country.conf
5# Bug: 196073172, 233619860
6
7count=1
8
9mkdir -p $2
10
11while read line ; do
12    if [[ "$line" =~ ^"*" ]]; then
13        header=${line:1}
14    elif [[ "$line" =~ ^"\"" ]]; then
15        #line=$(echo ${line/,} | tr -d "\"")
16        country[count]=$(echo $line | cut -d ':' -f1 | tr -d "\"")
17        code[count]=$(echo $line | cut -d ':' -f2 | tr -d "\"" | tr -d " ")
18            if [ "$header" = "FCC" ]; then
19                cp $1/UWB-calibration-fcc.conf $2/UWB-calibration-${code[$count]}.conf
20            elif [ "$header" = "CE" ]; then
21                cp $1/UWB-calibration-ce.conf $2/UWB-calibration-${code[$count]}.conf
22            elif [ "$header" = "JP" ]; then
23                cp $1/UWB-calibration-jp.conf $2/UWB-calibration-${code[$count]}.conf
24            elif [ "$header" = "TW" ]; then
25                cp $1/UWB-calibration-tw.conf $2/UWB-calibration-${code[$count]}.conf
26            elif [ "$header" = "Restricted" ]; then
27                cp $1/UWB-calibration-restricted.conf $2/UWB-calibration-${code[$count]}.conf
28            fi
29    fi
30((count++))
31done < $1/uwb_country.conf
32