zsh:funcs:crypt-*mount: Use err_return option
This commit is contained in:
@@ -253,12 +253,13 @@ safe-remove() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
crypt-mount() {
|
crypt-mount() {
|
||||||
[[ $# -gt 0 ]] || return 1
|
emulate -L zsh -o err_return
|
||||||
[[ -e "$1" ]] || return 1
|
[[ $# -gt 0 ]]
|
||||||
|
[[ -e "$1" ]]
|
||||||
|
|
||||||
local name=crypt_"${1##*/}"
|
local name=crypt_"${1##*/}"
|
||||||
sudo cryptsetup open "$1" "$name" || return 1
|
sudo cryptsetup open "$1" "$name"
|
||||||
udisksctl mount -b /dev/mapper/"$name" || return 1
|
udisksctl mount -b /dev/mapper/"$name"
|
||||||
local mount_point="$(
|
local mount_point="$(
|
||||||
findmnt -lo SOURCE,TARGET \
|
findmnt -lo SOURCE,TARGET \
|
||||||
| grep -F /dev/mapper/"$name" \
|
| grep -F /dev/mapper/"$name" \
|
||||||
@@ -268,8 +269,9 @@ crypt-mount() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
crypt-umount() {
|
crypt-umount() {
|
||||||
[[ $# -gt 0 ]] || return 1
|
emulate -L zsh -o err_return
|
||||||
[[ -e "$1" ]] || return 1
|
[[ $# -gt 0 ]]
|
||||||
|
[[ -e "$1" ]]
|
||||||
|
|
||||||
sync
|
sync
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user