|
@@ -18,6 +18,8 @@ TRY_AND_RETRY () {
|
|
|
}
|
|
}
|
|
|
|
|
|
|
|
sudo_prog='sudo --prompt=Sudo_Password:'
|
|
sudo_prog='sudo --prompt=Sudo_Password:'
|
|
|
|
|
+cur_uid="$(id -u)"
|
|
|
|
|
+cur_gid="$(id -g)"
|
|
|
|
|
|
|
|
_MOUNT () {
|
|
_MOUNT () {
|
|
|
echo "Mounting ${1} into ${2}"
|
|
echo "Mounting ${1} into ${2}"
|
|
@@ -34,7 +36,7 @@ _LUKS_OPEN () {
|
|
|
_CHECK_DIR_PERM () {
|
|
_CHECK_DIR_PERM () {
|
|
|
dir_perm="$(stat -c '%u:%g' "${1}")"
|
|
dir_perm="$(stat -c '%u:%g' "${1}")"
|
|
|
cur_perm="${cur_uid}:${cur_gid}"
|
|
cur_perm="${cur_uid}:${cur_gid}"
|
|
|
- test "$dir_perm" = "$cur_perm" || return 0
|
|
|
|
|
|
|
+ test "$dir_perm" = "$cur_perm" && return 0
|
|
|
echo -n "Directory ${1} is not owned by current user. Want to change direcory owner? (Y/n) "
|
|
echo -n "Directory ${1} is not owned by current user. Want to change direcory owner? (Y/n) "
|
|
|
read choose
|
|
read choose
|
|
|
case "$choose" in
|
|
case "$choose" in
|
|
@@ -51,8 +53,6 @@ name="$(echo "$file" | cut -d. -f1)"
|
|
|
_name="__${name}__"
|
|
_name="__${name}__"
|
|
|
ext="$(echo "$file" | cut -d. -f2)"
|
|
ext="$(echo "$file" | cut -d. -f2)"
|
|
|
block_dev="/dev/mapper/${_name}"
|
|
block_dev="/dev/mapper/${_name}"
|
|
|
-cur_uid="$(id -u)"
|
|
|
|
|
-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
|
|
|
|
|
|