From 45fae4d8f29848bd325180e7fe2c2368a3adc06a Mon Sep 17 00:00:00 2001 From: David Runge Date: Thu, 5 Nov 2015 13:55:04 +0100 Subject: .zsh.after/functions.zsh: Adding further device nodes as possible mounting points for certain luksOpen actions. --- .zsh.after/functions.zsh | 22 ++++++++++++++++++++-- 1 file changed, 20 insertions(+), 2 deletions(-) diff --git a/.zsh.after/functions.zsh b/.zsh.after/functions.zsh index 930815e..be862e8 100644 --- a/.zsh.after/functions.zsh +++ b/.zsh.after/functions.zsh @@ -269,10 +269,28 @@ lopen() { "dvzrv" | "trvlr") case $1 in "music") - sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE152RS $1 + if [ -L "/dev/disk/by-uuid/e0b19c7d-9e90-4117-aea1-7e4b321d9d5a" ]; then + sudo cryptsetup luksOpen /dev/disk/by-uuid/e0b19c7d-9e90-4117-aea1-7e4b321d9d5a $1 + elif [ -L "/dev/disk/by-id/ata-ST9500325AS_6VE152RS" ]; then + sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE152RS $1 + elif [ -L "/dev/disk/by-id/usb-Seagate_FreeAgent_Go_2GE36KXD-0:0" ]; then + sudo cryptsetup luksOpen "/dev/disk/by-id/usb-Seagate_FreeAgent_Go_2GE36KXD-0:0" $1 + else + echo "Error! Disk not available" + exit 1 + fi ;; "photos") - sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE457TN $1 + if [ -L "/dev/disk/by-uuid/b3c5a842-474b-4c2f-a246-abebe1da3450" ]; then + sudo cryptsetup luksOpen /dev/disk/by-uuid/b3c5a842-474b-4c2f-a246-abebe1da3450 $1 + elif [ -L "/dev/disk/by-id/ata-ST9500325AS_6VE457TN " ]; then + sudo cryptsetup luksOpen /dev/disk/by-id/ata-ST9500325AS_6VE457TN $1 + elif [ -L "/dev/disk/by-id/usb-Seagate_FreeAgent_Go_2GE4LCR0-0:0" ]; then + sudo cryptsetup luksOpen "/dev/disk/by-id/usb-Seagate_FreeAgent_Go_2GE4LCR0-0:0" $1 + else + echo "Error! Disk not available" + exit 1 + fi if [ ! -h ~/.cache/shotwell ]; then ln -s /mnt/photos/shotwell/ ~/.cache/shotwell fi -- cgit v1.2.3-70-g09d2