Skip to content

Commit d971796

Browse files
lijianpiacrnsi
authored andcommitted
dm:add grep -w option for uos launch sh
for vm_name with vxworks_vm1 or zephyr_vm1 or vm1 grep "vm1" will match three of them, add -w option fix this issue Tracked-On:#3081 Signed-off-by: zhangyun <yunx.zhang@intel.com>
1 parent 4c28a37 commit d971796

File tree

5 files changed

+7
-7
lines changed

5 files changed

+7
-7
lines changed

devicemodel/samples/apl-mrb/launch_uos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,7 @@ fi
7575

7676
#check if the vm is running or not
7777
vm_ps=$(pgrep -a -f acrn-dm)
78-
result=$(echo $vm_ps | grep "${vm_name}")
78+
result=$(echo $vm_ps | grep -w "${vm_name}")
7979
if [[ "$result" != "" ]]; then
8080
echo "$vm_name is running, can't create twice!"
8181
exit
@@ -223,7 +223,7 @@ ser=$mmc_name$mmc_serial
223223

224224
#check if the vm is running or not
225225
vm_ps=$(pgrep -a -f acrn-dm)
226-
result=$(echo $vm_ps | grep "${vm_name}")
226+
result=$(echo $vm_ps | grep -w "${vm_name}")
227227
if [[ "$result" != "" ]]; then
228228
echo "$vm_name is running, can't create twice!"
229229
exit

devicemodel/samples/apl-up2/launch_uos.sh

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -64,7 +64,7 @@ fi
6464

6565
#check if the vm is running or not
6666
vm_ps=$(pgrep -a -f acrn-dm)
67-
result=$(echo $vm_ps | grep "${vm_name}")
67+
result=$(echo $vm_ps | grep -w "${vm_name}")
6868
if [[ "$result" != "" ]]; then
6969
echo "$vm_name is running, can't create twice!"
7070
exit
@@ -208,7 +208,7 @@ ser=$mmc_name$mmc_serial
208208

209209
#check if the vm is running or not
210210
vm_ps=$(pgrep -a -f acrn-dm)
211-
result=$(echo $vm_ps | grep "${vm_name}")
211+
result=$(echo $vm_ps | grep -w "${vm_name}")
212212
if [[ "$result" != "" ]]; then
213213
echo "$vm_name is running, can't create twice!"
214214
exit

devicemodel/samples/nuc/launch_uos.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ mac_seed=${mac:9:8}-${vm_name}
1515

1616
#check if the vm is running or not
1717
vm_ps=$(pgrep -a -f acrn-dm)
18-
result=$(echo $vm_ps | grep "${vm_name}")
18+
result=$(echo $vm_ps | grep -w "${vm_name}")
1919
if [[ "$result" != "" ]]; then
2020
echo "$vm_name is running, can't create twice!"
2121
exit

devicemodel/samples/nuc/launch_vxworks.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vm_name=vxworks_vm$1
66

77
#check if the vm is running or not
88
vm_ps=$(pgrep -a -f acrn-dm)
9-
result=$(echo $vm_ps | grep "${vm_name}")
9+
result=$(echo $vm_ps | grep -w "${vm_name}")
1010
if [[ "$result" != "" ]]; then
1111
echo "$vm_name is running, can't create twice!"
1212
exit

devicemodel/samples/nuc/launch_zephyr.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ vm_name=zephyr_vm$1
66

77
#check if the vm is running or not
88
vm_ps=$(pgrep -a -f acrn-dm)
9-
result=$(echo $vm_ps | grep "${vm_name}")
9+
result=$(echo $vm_ps | grep -w "${vm_name}")
1010
if [[ "$result" != "" ]]; then
1111
echo "$vm_name is running, can't create twice!"
1212
exit

0 commit comments

Comments
 (0)