[PATCH] 273: don't delete everything if $SCRATCH_MNT isn't set
Bryan Schumaker
bjschuma at netapp.com
Mon Apr 9 13:36:21 CDT 2012
The cleanup function is trapped before _require_scratch() is called, and
then expands "rm -rf $SCRATCH_MNT/*" to "rm -rf /*"
Signed-off-by: Bryan Schumaker <bjschuma at netapp.com>
---
273 | 6 +++++-
1 file changed, 5 insertions(+), 1 deletion(-)
diff --git a/273 b/273
index 2965132..8889f5a 100755
--- a/273
+++ b/273
@@ -35,7 +35,11 @@ trap "_cleanup; exit \$status" 0 1 2 3 15
_cleanup()
{
cd /
- rm -rf $SCRATCH_MNT/* $tmp.*
+ if [ ! -z $SCRATCH_DEV ] && [ ! -z $SCRATCH_MNT ];
+ then
+ rm -rf $SCRATCH_MNT
+ fi
+ rm -rf $tmp.*
_scratch_unmount
}
--
1.7.10
More information about the xfs
mailing list