Whamcloud - gitweb
Pass inline data from filesystem through obdo to VFS.
[fs/lustre-release.git] / lustre / demos / basesetup.sh
index 7cecc93..be60196 100755 (executable)
@@ -1,7 +1,6 @@
 #! /bin/sh
 # Get the locations for the files from a single place to avoid confusion
 OBDDIR="`dirname $0`/.."
-[ "$OBDDIR" = "./.." ] && OBDDIR=".."
 
 # source config info
 . $OBDDIR/demos/config.sh
@@ -13,8 +12,9 @@ OBDDIR="`dirname $0`/.."
 
 # temp file
 if [ "$TMPFILE" -a -f $TMPFILE ]; then 
-    echo "$TMPFILE exists; I'm unwilling to overwrite it." 1>&2
-    exit 1
+    echo "$TMPFILE exists; I'm unwilling to overwrite it.  Remove [N/y]?" 1>&2
+    rm -i $TMPFILE
+    [ -f $TMPFILE ] && exit 1
 fi
 [ "$TMPFILE" ] && dd if=/dev/zero of=$TMPFILE bs=1k count=10k
 
@@ -26,7 +26,7 @@ if [ "$LOOPDEV" -a "`losetup $LOOPDEV 2> /dev/null`" ]; then
     echo "You need to clean up $LOOPDEV (via cleanup.sh),"
     echo "or you can change which device is used in demos/config.sh" 1>&2
     # undo previous
-    rm $TMPFILE
+    [ "$TMPFILE" ] && rm $TMPFILE
     exit 2
 fi
 
@@ -42,6 +42,6 @@ if [ "$BASEDEV" ]; then
 else
     echo "\$BASEDEV not defined in demos/config.sh.  Please fix!"
     [ "$LOOPDEV" ] && losetup -d $LOOPDEV 
-    rm $TMPFILE
+    [ "$TMPFILE" ] && rm $TMPFILE
     exit 3
 fi