mirror of
https://github.com/nix-community/disko.git
synced 2026-12-01 05:23:28 +01:00
luks: retry the interactive password prompt on mismatch
This commit is contained in:
1 parent
ff8702b4de
commit
4084b6c7bd
2 files changed
+86
-1
No files matched your search
+7
-1
@@ -218,14 +218,20 @@ in
|
||||
export password
|
||||
# shellcheck disable=SC2154
|
||||
if [ "$password" != "$password_check" ]; then
|
||||
exit 1
|
||||
return 1
|
||||
fi
|
||||
set -x
|
||||
else
|
||||
export password=disko
|
||||
fi
|
||||
}
|
||||
attempts=0
|
||||
until askPassword; do
|
||||
attempts=$((attempts + 1))
|
||||
if [ "$attempts" -ge 3 ]; then
|
||||
echo "Too many mismatched password attempts for ${config.device}, aborting." >&2
|
||||
exit 1
|
||||
fi
|
||||
echo "Passwords did not match, please try again."
|
||||
done
|
||||
''}
|
||||
|
||||
Reference in new issue
Block a user