I'm trying to make a decryption software for my NAS, so that it automatically mounts all drives and decrypts them. But, I need to know if the sudo cryptsetup luksOpen /dev/blahblahblah dev0 exists after it had attempted to open it. How do I detect that in Bash? I've attempted: if [ -e /dev/mapper/dev0 ]; then Then but that didn't seem to work. Anybody have any ideas? This is the whole code: fail="true" LUKS_PASSWORD1="" while [ $fail="true" ];...
Originally asked by Novum Gain on Stack Exchange (superuser) (CC BY-SA 4.0).