diff options
Diffstat (limited to 'agl-basefiles/bin')
-rw-r--r-- | agl-basefiles/bin/launch_xml2cfg.sh | 26 |
1 files changed, 11 insertions, 15 deletions
diff --git a/agl-basefiles/bin/launch_xml2cfg.sh b/agl-basefiles/bin/launch_xml2cfg.sh index dfa1fa9..54bb1cc 100644 --- a/agl-basefiles/bin/launch_xml2cfg.sh +++ b/agl-basefiles/bin/launch_xml2cfg.sh @@ -22,17 +22,17 @@ main_file=system_launcher_main.xml body_file=system_launcher_body.xml -#check xmllint is exist +#check xmllint is exist if ! which xmllint > /dev/null ; then echo "It need xmllint. Please install it." exit 1; -fi +fi -#check xpath is exist +#check xpath is exist if ! which xpath > /dev/null ; then echo "It need xpath Please install it." exit 1; -fi +fi #arg check if ! [[ "$infile" =~ .+\.xml ]] ;then @@ -43,10 +43,9 @@ elif ! [ -e $infile ];then exit 1 fi -cp -f `dirname $0`/$main_file `dirname $1` cp -f $infile $body_file -#check xml vaild +#check xml vaild if ! xmllint --noout --valid $main_file ;then echo "XML is Invalid. " exit 1; @@ -64,7 +63,7 @@ group_num=`echo $xmem | xpath -e /system_launcher/group 2>&1 | grep Found | cut l_idx=1 cur_group=1 -until [ $cur_group -gt $group_num ]; +until [ $cur_group -gt $group_num ]; do #LAUNCH LOOP group_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]` #ALL XML text for group @@ -76,11 +75,11 @@ do # echo $g_name $g_wait_time $g_trigger l_launch_num=`echo $xmem | xpath -e /system_launcher/group[$cur_group]/launch 2>&1 | grep Found | cut -d ' ' -f2` - - cur_launch=1; + + cur_launch=1; until [ $cur_launch -gt $l_launch_num ]; do - launch_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]/launch[$cur_launch]` - + launch_text=`echo $xmem | xpath -q -e /system_launcher/group[$cur_group]/launch[$cur_launch]` + l_attr="Launch${l_idx}=$g_name|$cur_group|$g_wait_time|$g_trigger" l_attr+="|"`echo $launch_text | sed 's/\(.* name="\)\([^"]*\)\(.*\)/\2/g'` l_attr+="|"`echo $launch_text | sed 's/\(.* path="\)\([^"]*\)\(.*\)/\2/g'` @@ -115,7 +114,7 @@ do else l_attr+="|" fi - + if echo "$launch_text" | grep -sq 'cpu_assign=' ; then l_attr+="|"`echo $launch_text | sed 's/\(.* cpu_assign="\)\([^"]*\)\(.*\)/\2/g'` else @@ -133,6 +132,3 @@ done rm $body_file -rm $main_file - - |