# Create an empty file of $FILES_SIZE
dd if=/dev/zero of=${TMP_FILE} bs=1024k count=${FILES_SIZE}
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
echo "Error while creating empty file..."
rm -f ${TMP_FILE}
exit 1
# Create an extended-2 filesystem on this file
echo y | /sbin/mke2fs -m 0 -b 2048 ${TMP_FILE}
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
echo "Error creating file system on empty file..."
rm -f ${TMP_FILE}
exit 1
# Mount this empty file through the loopback device.
mkdir -p ${TMP_MOUNT}
mount -o loop -t ext2 ${TMP_FILE} ${TMP_MOUNT}
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
echo "Error mounting empty file..."
rm -f ${TMP_FILE}
rm -rf $TMP_MOUNT
# Copy files to $TMP_MOUNT and umount it afterwards.
echo "Copying files..."
cp -a --parents ${FILES_WRITE_LIST} ${TMP_MOUNT}
-if [ $? != 0 ]; then
+if [ $? -ne 0 ]; then
echo "Error while copying files..."
umount ${TMP_MOUNT}
rm -rf ${TMP_MOUNT}