2 #--------------------------------------------------------------------
6 # update a smack rule by putting an input txt file
7 # 0. sudo apt-get install xmlstarlet
8 # 1. edit smackinput.txt
9 # 2. run update_smacktest.sh smackinput.txt
12 # ./update_smacktest.sh smackinput.txt
14 # check the result with 'git diff'
15 #--------------------------------------------------------------------
16 filelist=`ls ./data/*.xml`
22 keyname=`echo $line | awk '{ print $1}'`
23 rulename=`echo $line | awk '{ print $2}'`
24 echo $keyname "----------->" $rulename
26 echo "xmlstarlet edit --pf --update "/vconfkeylists/vconfkey[@name='$keyname']/@label" -v '$rulename' $file > $file.temp"
27 xmlstarlet edit --pf --update "/vconfkeylists/vconfkey[@name='$keyname']/@label" -v $rulename $file > $file.temp