If $TMPDIR is not set, use /tmp.
Signed-off-by: Stanislav Kholmanskikh <[email protected]>
---
testscripts/isofs.sh | 13 +++++++------
1 file changed, 7 insertions(+), 6 deletions(-)
diff --git a/testscripts/isofs.sh b/testscripts/isofs.sh
index e6a3b09..9031922 100755
--- a/testscripts/isofs.sh
+++ b/testscripts/isofs.sh
@@ -60,21 +60,22 @@ NO_CLEANUP=""
}
#Initialize directory variables
- MNT_POINT="/tmp/isofs_$$"
+ TMPDIR=${TMPDIR:-/tmp}
+ MNT_POINT="$TMPDIR/isofs_$$"
COPY_DIR="/etc/"
- TEMP_DIR="/tmp/for_isofs_test"
+ TEMP_DIR="$TMPDIR/for_isofs_test"
MAKE_FILE_SYS_DIR=$TEMP_DIR$COPY_DIR
while getopts :hnd: arg
do case $arg in
d)
COPY_DIR=$OPTARG
- MAKE_FILE_SYS_DIR="/tmp/for_isofs_test"$COPY_DIR
+ MAKE_FILE_SYS_DIR=${TEMP_DIR}${COPY_DIR}
;;
h)
echo ""
echo "n - The directories created will not be removed"
- echo "d - Specify a directory to copy into /tmp"
+ echo "d - Specify a directory to copy into $TEMP_DIR"
echo "h - Help options"
echo ""
usage
@@ -133,7 +134,7 @@ do
mkisofs -o isofs.iso -quiet $mkisofs_opt $MAKE_FILE_SYS_DIR
if [ $? != 0 ]
then
- rm -rf isofs.iso $MNT_POINT
+ rm -rf isofs.iso $MNT_POINT $TEMP_DIR
echo "FAILED: mkisofs -o isofs.iso $mkisofs_opt
$MAKE_FILE_SYS_DIR failed"
exit 1
fi
@@ -154,7 +155,7 @@ do
mount -t iso9660 -o $mount_opt isofs.iso $MNT_POINT
if [ $? != 0 ]
then
- rm -rf isofs.iso $MNT_POINT
+ rm -rf isofs.iso $MNT_POINT $TEMP_DIR
echo "FAILED: mount -t iso9660 -o $mount_opt isofs.iso
$MNT_POINT failed"
exit 1
fi
--
1.7.9.5
------------------------------------------------------------------------------
Learn Graph Databases - Download FREE O'Reilly Book
"Graph Databases" is the definitive new guide to graph databases and their
applications. Written by three acclaimed leaders in the field,
this first edition is now available. Download your free book today!
http://p.sf.net/sfu/13534_NeoTech
_______________________________________________
Ltp-list mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ltp-list