I'm mounting a bunch of encrypted disks like so
cryptsetup luksOpen some_source some_mapping && mount /dev/mapper/some_mapping /some_mountpoint
How can I abstract away the middle mapping?
I suppose I could do something like:
uuid=$(sudo some_device |head -n1) some_mapping=$uuid cryptsetup luksOpen some_source $some_mapping && mount /dev/mapper/$some_mapping /some_mountpoint
and put this in a script.
Is there a better way?
Can I also make sure that
automatically removes the middle mapping?