aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid Runge <david.runge@frqrec.com>2013-12-16 09:48:36 +0100
committerDavid Runge <david.runge@frqrec.com>2013-12-16 09:48:36 +0100
commit809bc5ee38aaedb89292d4e2892dc8624cb47131 (patch)
tree561246271880aebebf8703113f390e4018fca2dd
parent33c0d79d872b01eca800afa1d013ffe4adc56998 (diff)
downloaddotfiles-809bc5ee38aaedb89292d4e2892dc8624cb47131.tar.gz
dotfiles-809bc5ee38aaedb89292d4e2892dc8624cb47131.tar.bz2
dotfiles-809bc5ee38aaedb89292d4e2892dc8624cb47131.tar.xz
dotfiles-809bc5ee38aaedb89292d4e2892dc8624cb47131.zip
Updated devices per host for cryptsetup
-rw-r--r--.zsh.after/functions.zsh42
1 files changed, 34 insertions, 8 deletions
diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh
index 5867ce4..9839658 100644
--- a/.zsh.after/functions.zsh
+++ b/.zsh.after/functions.zsh
@@ -222,23 +222,49 @@ function tar_tlz {
##CRYPTSETUP AND LUKS
function lopen () {
- case $1 in
- "music")
- sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE152RS $1
- ;;
- "photos")
- sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE457TN $1
+ case $HOST in
+ "homey")
+ case $1 in
+ "video-backup")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-SAMSUNG_HD153WI_S1UVJ1VZ400797 $1
+ ;;
+ "video")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-SAMSUNG_HD153WI_S1UVJ1VZ400798 $1
+ ;;
+ "photos")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1FQ104574 $1
+ ;;
+ "music")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-SAMSUNG_HD501LJ_S0MUJ1FPB87663 $1
+ ;;
+ "music-external")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE152RS $1
+ ;;
+ "photos-external")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE457TN $1
+ ;;
+ esac
;;
+ "dvzrv")
+ case $1 in
+ "music")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE152RS $1
+ ;;
+ "photos")
+ sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE457TN $1
+ ;;
+ esac
esac
sudo mount /dev/mapper/$1 /mnt/$1
}
function lclose () {
notmounted=$(mountpoint /mnt/$1)
- echo $notmounted
- if [[ $notmounted != 0 ]] ; then
+ if [ "$?" -eq 0 ]; then
sudo umount /mnt/$1
sudo cryptsetup luksClose $1
+ else
+ echo "/mnt/$1 is not a mountpoint"
fi
}