Fixed output success parsing

Some times cryptsetup added more info to the command line output.
This commit is contained in:
Anton Hvornum 2018-10-01 20:58:32 +02:00 committed by GitHub
parent 627de1d71a
commit 0c27146f05
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -305,7 +305,7 @@ if __name__ == '__main__':
# TODO: --use-random instead of --use-urandom
print('[N] Adding encryption to {drive}{partition_2}.'.format(**args))
o = run('cryptsetup -q -v --type luks2 --pbkdf argon2i --hash sha512 --key-size 512 --iter-time 10000 --key-file {pwfile} --use-urandom luksFormat {drive}{partition_2}'.format(**args))
if not o.decode('UTF-8').strip() == 'Command successful.':
if not 'Command successful.' in o.decode('UTF-8').strip():
print('[E] Failed to setup disk encryption.', o)
exit(1)