Skip to content

Commit 26edb3c

Browse files
committed
CLOUDSTACK-1340: Just take the first of results, query and remove shared folders
Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
1 parent 0f30c1e commit 26edb3c

1 file changed

Lines changed: 4 additions & 5 deletions

File tree

tools/appliance/build.sh

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -42,14 +42,13 @@ done
4242
machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'`
4343
hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1`
4444
hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-`
45-
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host | cut -c 8- | cut -d \' -f 1`
45+
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
4646

4747
# Remove any shared folder
48-
while [[ $shared_folders != "" ]]
48+
while [ "$shared_folders" != "" ]
4949
do
50-
folder=`echo $shared_folders | head -1`
51-
vboxmanage sharedfolder remove systemvmtemplate --name $folder
52-
shared_folders=`echo $shared_folders | grep -v $folder`
50+
vboxmanage sharedfolder remove systemvmtemplate --name "`echo $shared_folders | head -1 | cut -c 8- | cut -d \' -f 1`"
51+
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
5352
done
5453

5554
# Compact the virtual hdd

0 commit comments

Comments
 (0)