diff options
author | katherine <ageha@airen-no-jikken.icu> | 2021-09-06 17:58:19 -0700 |
---|---|---|
committer | katherine <ageha@airen-no-jikken.icu> | 2021-09-06 17:58:19 -0700 |
commit | 2e17e24b5a8d03311caa9998aebb14e847ab68a6 (patch) | |
tree | 3cf770b82822537493e1364231e9c34c57d990b7 /.zshrc-linux-desktop | |
parent | 6fdf6744650e35387c69b2cf84e4be3921490794 (diff) | |
download | dotfiles-2e17e24b5a8d03311caa9998aebb14e847ab68a6.tar.gz |
encrypted mount
Diffstat (limited to '.zshrc-linux-desktop')
-rw-r--r-- | .zshrc-linux-desktop | 14 |
1 files changed, 14 insertions, 0 deletions
diff --git a/.zshrc-linux-desktop b/.zshrc-linux-desktop index 3b717a4..5b1e593 100644 --- a/.zshrc-linux-desktop +++ b/.zshrc-linux-desktop @@ -22,3 +22,17 @@ if [[ $(whence timew) != "" ]] then alias tt='timew track' alias tu='timew undo' fi + +if [[ -f $HOME/mount/enc.iso && $(whence cryptsetup) ]] then +emount() { + mkdir -p $HOME/enc || return 1 + sudo cryptsetup luksOpen $HOME/mount/enc.iso enc || { rmdir $HOME/enc; return 1 } + sudo mount /dev/mapper/enc $HOME/enc || { sudo cryptsetup luksClose enc; rmdir $HOME/enc; return 1 } +} + +eumount() { + [[ -d $HOME/enc ]] && sudo umount $HOME/enc + sudo cryptsetup luksClose enc + [[ -d $HOME/enc ]] && rmdir $HOME/enc +} +fi |