diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-08-28 09:57:05 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2021-08-28 10:28:10 +0000 |
commit | 4673fc80dddafa45ce8d577d572323eec9fdfe2e (patch) | |
tree | 8b0321145abdb8f23436ea849b865fb4f8768526 | |
parent | Allowing to specify 'ALL' in dehydrated hooks preseeding. (diff) | |
download | open-infrastructure-service-tools-4673fc80dddafa45ce8d577d572323eec9fdfe2e.tar.xz open-infrastructure-service-tools-4673fc80dddafa45ce8d577d572323eec9fdfe2e.zip |
Run dehydration registration only when no account is already present.
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
-rw-r--r-- | debian/open-infrastructure-dehydrated-tools.config | 9 | ||||
-rwxr-xr-x | debian/open-infrastructure-dehydrated-tools.postinst | 13 |
2 files changed, 14 insertions, 8 deletions
diff --git a/debian/open-infrastructure-dehydrated-tools.config b/debian/open-infrastructure-dehydrated-tools.config index dfccb77..e795e68 100644 --- a/debian/open-infrastructure-dehydrated-tools.config +++ b/debian/open-infrastructure-dehydrated-tools.config @@ -53,8 +53,11 @@ db_settitle open-infrastructure-dehydrated-tools/title db_input low open-infrastructure-dehydrated-tools/basedir || true db_go -db_settitle open-infrastructure-dehydrated-tools/title -db_input low open-infrastructure-dehydrated-tools/register || true -db_go +if ! ls /var/lib/dehydrated/accounts/*/account_key.pem > /dev/null 2>&1 +then + db_settitle open-infrastructure-dehydrated-tools/title + db_input low open-infrastructure-dehydrated-tools/register || true + db_go +fi db_stop diff --git a/debian/open-infrastructure-dehydrated-tools.postinst b/debian/open-infrastructure-dehydrated-tools.postinst index fdf39dc..16f1e4d 100755 --- a/debian/open-infrastructure-dehydrated-tools.postinst +++ b/debian/open-infrastructure-dehydrated-tools.postinst @@ -143,11 +143,14 @@ case "${1}" in Install "${BASEDIR}" "${NEW_BASEDIR}" fi - case "${REGISTER}" in - true) - dehydrated --register --accept-terms - ;; - esac + if ! ls /var/lib/dehydrated/accounts/*/account_key.pem > /dev/null 2>&1 + then + case "${REGISTER}" in + true) + dehydrated --register --accept-terms + ;; + esac + fi ;; abort-upgrade|abort-remove|abort-deconfigure) |