diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh index 3df77478a1c..3dcb0446d8a 100755 --- a/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh +++ b/scripts/vm/hypervisor/xenserver/copy_vhd_from_secondarystorage.sh @@ -12,7 +12,7 @@ cleanup() if [ ! -z $localmp ]; then umount -fl $localmp if [ $? -eq 0 ]; then - rm $localmp -rf + rmdir $localmp fi fi } diff --git a/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh b/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh index 79160010430..59af2e0fa01 100755 --- a/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh +++ b/scripts/vm/hypervisor/xenserver/copy_vhd_to_secondarystorage.sh @@ -12,7 +12,7 @@ cleanup() if [ ! -z $localmp ]; then umount $localmp if [ $? -eq 0 ]; then - rm $localmp -rf + rmdir $localmp fi fi } diff --git a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh index 162905caecf..1b55501e7f4 100755 --- a/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh +++ b/scripts/vm/hypervisor/xenserver/create_privatetemplate_from_snapshot.sh @@ -12,13 +12,13 @@ cleanup() if [ ! -z $snapshotdir ]; then umount $snapshotdir if [ $? -eq 0 ]; then - rm $snapshotdir -rf + rmdir $snapshotdir fi fi if [ ! -z $templatedir ]; then umount $templatedir if [ $? -eq 0 ]; then - rm $templatedir -rf + rmdir $templatedir fi fi } @@ -49,7 +49,7 @@ fi mount $snapshoturl $snapshotdir if [ $? -ne 0 ]; then - rm -rf $snapshotdir + rmdir $snapshotdir echo "5#can not mount $snapshoturl to $snapshotdir" exit 0 fi @@ -65,7 +65,7 @@ fi mount $templateurl $templatedir if [ $? -ne 0 ]; then - rm -rf $templatedir + rmdir $templatedir templatedir="" cleanup echo "7#can not mount $templateurl to $templatedir" diff --git a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh index a210c5a962c..0da5debb77e 100755 --- a/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh +++ b/scripts/vm/hypervisor/xenserver/upgrade_snapshot.sh @@ -11,13 +11,13 @@ cleanup() if [ ! -z $snapshotdir ]; then umount $snapshotdir if [ $? -eq 0 ]; then - rm $snapshotdir -rf + rmdir $snapshotdir fi fi if [ ! -z $templatedir ]; then umount $templatedir if [ $? -eq 0 ]; then - rm $templatedir -rf + rmdir $templatedir fi fi } @@ -48,7 +48,7 @@ fi mount $snapshoturl $snapshotdir if [ $? -ne 0 ]; then - rm -rf $snapshotdir + rmdir $snapshotdir echo "5#can not mount $snapshoturl to $snapshotdir" exit 0 fi @@ -64,7 +64,7 @@ fi mount $templateurl $templatedir if [ $? -ne 0 ]; then - rm -rf $templatedir + rmdir $templatedir templatedir="" cleanup echo "7#can not mount $templateurl to $templatedir" @@ -97,7 +97,7 @@ upgradeSnapshot() exit 0 fi - rm -rf $parent + rm -f $parent else upgradeSnapshot $parent fi