=== modified file 'TODO' --- TODO 2008-09-19 00:00:51 +0000 +++ TODO 2008-09-19 12:02:03 +0000 @@ -64,8 +64,8 @@ From XML sources directly? ** TODO unperish ** DONE bzr-builddeb -** TODO mandos user/group creation -** TODO Key creation in postinst +** DONE mandos user/group creation :test: +** DONE Key creation in postinst :test: * TODO Web site ** DONE http://www.fukt.bsnet.se/mandos === modified file 'debian/mandos-client.postinst' --- debian/mandos-client.postinst 2008-09-19 01:10:27 +0000 +++ debian/mandos-client.postinst 2008-09-19 12:02:03 +0000 @@ -17,24 +17,36 @@ . /usr/share/debconf/confmodule -# Update the initramfs +# Update the initial RAM filesystem image update_initramfs() { - if which update-initramfs >/dev/null 2>&1; then + if type update-initramfs >/dev/null 2>&1; then update-initramfs -u fi } +# Add user and group +add_mandos_user(){ + if ! getent passwd mandos >/dev/null; then + adduser --disabled-password --quiet --system \ + --home /var/run/mandos --no-create-home \ + --gecos "Mandos password daemon" --group mandos + fi +} + +# Create client key pair +create_key(){ + if type mandos-keygen >/dev/null 2>&1; then + mandos-keygen + fi +} + case "$1" in configure) - if ! getent passwd mandos >/dev/null; then - adduser --disabled-password --quiet --system \ - --home /var/run/mandos --no-create-home \ - --gecos "Mandos password daemon" --group mandos - fi + add_mandos_user + create_key update_initramfs ;; - abort-upgrade|abort-deconfigure|abort-remove) ;;