summaryrefslogtreecommitdiff
path: root/.local/bin/cryptusb/mount-cryptusb
blob: 299ad15aaca73d1825b660aa2e26d4626b88200b (plain)
1
2
3
4
5
6
7
8
9
#!/bin/sh
# Mounts LUKS encrypted USB

devs="$(lsblk -lp | grep -E "(disk|part) $" | awk '{print $1,"-",$4}')"
[ "$devs" = "" ] && exit 0
dev="$(echo "$devs" | dmenu -i -p "Select device" | cut -d ' ' -f 1)"
[ "$dev" = "" ] && exit 0
lsblk | grep -q "cryptusb" || sudo cryptsetup open $dev cryptusb
sudo mount /dev/mapper/cryptusb /mnt/cryptusb