CLOUDSTACK-1340: Just take the first of results, query and remove shared folders

Signed-off-by: Rohit Yadav <bhaisaab@apache.org>
This commit is contained in:
Rohit Yadav 2013-03-01 20:39:52 +05:30
parent 0f30c1e6b0
commit 26edb3c0aa
1 changed files with 4 additions and 5 deletions

View File

@ -42,14 +42,13 @@ done
machine_uuid=`vboxmanage showvminfo $appliance | grep UUID | head -1 | awk '{print $2}'`
hdd_uuid=`vboxmanage showvminfo $appliance | grep vdi | head -1 | awk '{print $8}' | cut -d ')' -f 1`
hdd_path=`vboxmanage list hdds | grep $appliance | grep vdi | cut -c 14-`
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host | cut -c 8- | cut -d \' -f 1`
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
# Remove any shared folder
while [[ $shared_folders != "" ]]
while [ "$shared_folders" != "" ]
do
folder=`echo $shared_folders | head -1`
vboxmanage sharedfolder remove systemvmtemplate --name $folder
shared_folders=`echo $shared_folders | grep -v $folder`
vboxmanage sharedfolder remove systemvmtemplate --name "`echo $shared_folders | head -1 | cut -c 8- | cut -d \' -f 1`"
shared_folders=`vboxmanage showvminfo $appliance | grep Name | grep Host`
done
# Compact the virtual hdd