4 # Copyright (c) 2019-2020 TOYOTA MOTOR CORPORATION
6 # Licensed under the Apache License, Version 2.0 (the "License");
7 # you may not use this file except in compliance with the License.
8 # You may obtain a copy of the License at
10 # http://www.apache.org/licenses/LICENSE-2.0
12 # Unless required by applicable law or agreed to in writing, software
13 # distributed under the License is distributed on an "AS IS" BASIS,
14 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15 # See the License for the specific language governing permissions and
16 # limitations under the License.
22 if ! [[ "$infile" =~ .+\.cfg ]] ;then
23 echo "$infile is not *.cfg"
25 elif ! [ -e $infile ];then
26 echo "$infile not found"
31 cat ${infile} | while read line
33 if ! [[ "${line}" =~ ^[#\[] ]]; then #Remove first #[
34 echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f1-4
36 done | uniq | while read line
38 echo "<!-- group_id=$g_group -->"
39 echo "<group name=\"`echo $line | cut -d '|' -f1`\" wait_time=\"`echo $line | cut -d '|' -f3`\" trigger=\"`echo $line | cut -d '|' -f4`\" >"
41 cat ${infile} | while read line
43 if ! [[ "${line}" =~ ^[#\[] ]]; then #Remove first #[
44 l_group=`echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f2`
46 #Extract only LAUNCH applicable to g_group
47 if [ ${l_group} = ${g_group} ]; then
48 echo $line | sed 's/Launch[0-9]\+=//g' | cut -d '|' -f5-
51 done | while read line
54 echo " name=\"`echo $line | cut -d '|' -f1`\" path=\"`echo $line | cut -d '|' -f2`\" priority=\"`echo $line | cut -d '|' -f3`\""
55 echo " critical=\"`echo $line | cut -d '|' -f4`\" retry_cnt=\"`echo $line | cut -d '|' -f5`\" arguments=\"`echo $line | cut -d '|' -f6`\""
56 echo " logging_mask=\"`echo $line | cut -d '|' -f7`\" restart=\"`echo $line | cut -d '|' -f8`\" is_start_required=\"`echo $line | cut -d '|' -f9`\""
57 echo " shutdown_critical=\"`echo $line | cut -d '|' -f10`\" shutdown_wait_time=\"`echo $line | cut -d '|' -f11`\" fast_shutdown_wait_time=\"`echo $line | cut -d '|' -f12`\""
58 echo " user_name=\"`echo $line | cut -d '|' -f13`\""
64 g_group=$(($g_group + 1))