I had a simple zsh script before, but with LUKS support that would have become more complex, so I just copied the relevant code from the backup script.