#!/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