Whamcloud - gitweb
f7ad22743450b45e57b89f3ce2ad1dd6bd67554e
[fs/lustre-release.git] / lustre / demos / baseclean.sh
1 #!/bin/sh
2 # Script to remove the loopback device and temp file created in newtest.sh
3 OBDDIR="`dirname $0`/.."
4 . $OBDDIR/demos/config.sh
5
6
7 mount | grep "$MNTOBD " > /dev/null 2>&1
8 if [ x$? = x0 ]; then
9     echo "Stuff still mounted on $MNTOBD"
10     exit 1
11 fi
12
13 mount | grep "$MNTSNAP " > /dev/null 2>&1
14 if [ x$? = x0 ]; then
15     echo "Stuff still mounted on $MNTSNAP"
16     exit 2
17 fi
18
19 mount | grep "$MNTSNAP2 " > /dev/null 2>&1
20 if [ x$? = x0 ]; then
21     echo "Stuff still mounted on $MNTSNAP2"
22     exit 3
23 fi
24
25
26 [ "$LOOPDEV" ] && losetup -d $LOOPDEV
27 rmmod loop > /dev/null 2>&1
28
29 if [ "$TMPFILE" -a -f "$TMPFILE" ]; then
30     echo -n "Remove $TMPFILE [N/y]? "
31     read ANS
32     [ "`echo $ANS | cut -c1 | tr A-Z a-z`" = "y" ] && rm $TMPFILE
33 fi
34