diff options
-rw-r--r-- | .zsh.after/functions.zsh | 22 |
1 files 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 |