|
@@ -54,7 +54,6 @@ block_dev="/dev/mapper/${_name}"
|
|
|
cur_uid="$(id -u)"
|
|
cur_uid="$(id -u)"
|
|
|
cur_gid="$(id -g)"
|
|
cur_gid="$(id -g)"
|
|
|
|
|
|
|
|
-
|
|
|
|
|
test "$ext" = 'luks' || ERR "File $file_path does not have extencion .luks." 1
|
|
test "$ext" = 'luks' || ERR "File $file_path does not have extencion .luks." 1
|
|
|
|
|
|
|
|
if test -e ./"$name"
|
|
if test -e ./"$name"
|
|
@@ -69,11 +68,11 @@ then
|
|
|
N|n) exit 0 ;;
|
|
N|n) exit 0 ;;
|
|
|
esac
|
|
esac
|
|
|
echo "Unmounting ./${name}"
|
|
echo "Unmounting ./${name}"
|
|
|
- $sudo_prog umount ./"$name" || ERR "Failed to unmount ./${name}." 1
|
|
|
|
|
|
|
+ TRY_AND_RETRY "${sudo_prog} umount ./${name}" "Failed to unmount ./${name}."
|
|
|
|
|
+ echo "Succesfully Unmounted ./${name}"
|
|
|
|
|
|
|
|
echo "Closing luks block dev ${block_dev}"
|
|
echo "Closing luks block dev ${block_dev}"
|
|
|
- $sudo_prog cryptsetup close "$block_dev" || ERR "Failed to close luks file: ${file_path}." 1
|
|
|
|
|
-
|
|
|
|
|
|
|
+ TRY_AND_RETRY "${sudo_prog} cryptsetup close ${block_dev}" "Failed to close luks file: ${file_path}."
|
|
|
echo "Succesfully Closed ${file_path}."
|
|
echo "Succesfully Closed ${file_path}."
|
|
|
|
|
|
|
|
echo -n "Delete directory ./${name}? (Y/n) "
|
|
echo -n "Delete directory ./${name}? (Y/n) "
|
|
@@ -82,10 +81,9 @@ then
|
|
|
N|n) exit 0 ;;
|
|
N|n) exit 0 ;;
|
|
|
esac
|
|
esac
|
|
|
|
|
|
|
|
- rmdir ./$name || ERR "Failed to remove directory: ./${name}" 1
|
|
|
|
|
|
|
+ TRY_AND_RETRY rmdir "./${name}" "Failed to remove directory: ./${name}"
|
|
|
exit 0
|
|
exit 0
|
|
|
fi
|
|
fi
|
|
|
-
|
|
|
|
|
else
|
|
else
|
|
|
mkdir ./"$name"
|
|
mkdir ./"$name"
|
|
|
fi
|
|
fi
|