summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSam Chudnick <sam@chudnick.com>2021-11-21 21:14:57 -0500
committerSam Chudnick <sam@chudnick.com>2021-11-21 21:14:57 -0500
commit36b90e5aeaadfc157add46583beb58b622846453 (patch)
tree2abbcda224d66543c50f09d412ee2b0bc0c7f69e
parent875d03a83c5fb42f526ffecb014bb62fc1705249 (diff)
Check if USB has already been mapped and skip to mount command if it has been.
-rwxr-xr-x.local/bin/cryptusb/mount-cryptusb2
1 files changed, 1 insertions, 1 deletions
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 @@
1#!/bin/sh 1#!/bin/sh
2# Mounts LUKS encrypted USB 2# Mounts LUKS encrypted USB
3 3
4sudo cryptsetup open /dev/sdc cryptusb 4lsblk | grep -q "cryptusb" || sudo cryptsetup open /dev/sdc cryptusb
5sudo mount /dev/mapper/cryptusb /mnt/cryptusb 5sudo mount /dev/mapper/cryptusb /mnt/cryptusb