diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 14:14:45 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-17 14:14:45 +0000 |
commit | edee58e75c1715e38c92b310bf8d996cc4951f78 (patch) | |
tree | 8d673113d422f5b40ba646c504e0ffd10fc8904d /debian/cryptsetup-nuke-password.config | |
parent | Adding upstream version 4+nmu1. (diff) | |
download | cryptsetup-nuke-password-edee58e75c1715e38c92b310bf8d996cc4951f78.tar.xz cryptsetup-nuke-password-edee58e75c1715e38c92b310bf8d996cc4951f78.zip |
Adding debian version 4+nmu1.debian/4+nmu1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'debian/cryptsetup-nuke-password.config')
-rwxr-xr-x | debian/cryptsetup-nuke-password.config | 47 |
1 files changed, 47 insertions, 0 deletions
diff --git a/debian/cryptsetup-nuke-password.config b/debian/cryptsetup-nuke-password.config new file mode 100755 index 0000000..b082e77 --- /dev/null +++ b/debian/cryptsetup-nuke-password.config @@ -0,0 +1,47 @@ +#!/bin/sh + +set -e + +. /usr/share/debconf/confmodule || exit 0 + +if [ -s /etc/cryptsetup-nuke-password/password_hash ]; then + # What should we do if it's already + db_input low cryptsetup-nuke-password/already-configured || true + db_go +fi + +# Default value is to overwrite so it's fine to use it even +# if the question has not been asked. +db_get cryptsetup-nuke-password/already-configured +what="$RET" + +case "$what" in + keep|remove) + # No further questions need to be asked + exit 0 + ;; +esac + +while true; do + db_input low cryptsetup-nuke-password/password || true + db_input low cryptsetup-nuke-password/password-again || true + db_go + + db_get cryptsetup-nuke-password/password || true + NUKE_PASS="$RET" + db_get cryptsetup-nuke-password/password-again || true + NUKE_PASS_CONFIRMATION="$RET" + + if [ "$NUKE_PASS" = "$NUKE_PASS_CONFIRMATION" ]; then + break + fi + + db_fset cryptsetup-nuke-password/password-mismatch seen false + db_fset cryptsetup-nuke-password/password seen false + db_fset cryptsetup-nuke-password/password-again seen false + db_set cryptsetup-nuke-password/password '' + db_set cryptsetup-nuke-password/password-again '' + + db_input critical cryptsetup-nuke-password/password-mismatch || true + db_go +done |