From 36b90e5aeaadfc157add46583beb58b622846453 Mon Sep 17 00:00:00 2001 From: Sam Chudnick Date: Sun, 21 Nov 2021 21:14:57 -0500 Subject: Check if USB has already been mapped and skip to mount command if it has been. --- .local/bin/cryptusb/mount-cryptusb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to '.local/bin/cryptusb') diff --git a/.local/bin/cryptusb/mount-cryptusb b/.local/bin/cryptusb/mount-cryptusb index 882734c..ea44967 100755 --- a/.local/bin/cryptusb/mount-cryptusb +++ b/.local/bin/cryptusb/mount-cryptusb @@ -1,5 +1,5 @@ #!/bin/sh # Mounts LUKS encrypted USB -sudo cryptsetup open /dev/sdc cryptusb +lsblk | grep -q "cryptusb" || sudo cryptsetup open /dev/sdc cryptusb sudo mount /dev/mapper/cryptusb /mnt/cryptusb -- cgit v1.2.3