Solved passphrase error

Solved 'Illegal option' error when passphrase starts with hyphen
This commit is contained in:
andycandy-de 2023-12-01 01:03:26 +01:00 committed by GitHub
parent 39703cabb7
commit 890ffa7f24
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -108,8 +108,8 @@ freeloop=$(losetup -f)
losetup $freeloop "$outputfile"
if [ ! -z "$passphrase" ]; then
printf "$passphrase" | cryptsetup -q --verbose luksFormat $freeloop -
printf "$passphrase" | cryptsetup -q --verbose luksOpen $freeloop persist_decrypted -
printf -- "$passphrase" | cryptsetup -q --verbose luksFormat $freeloop -
printf -- "$passphrase" | cryptsetup -q --verbose luksOpen $freeloop persist_decrypted -
_freeloop=$freeloop
freeloop="/dev/mapper/persist_decrypted"
fi