summaryrefslogtreecommitdiff
path: root/debian/monkeysphere.postinst
blob: ad96a22bb6a04c498d20c29cee06c01400bb64a6 (plain)
  1. #!/bin/sh -e
  2. # postinst script for monkeysphere
  3. # Author: Jameson Rollins <jrollins@fifthhorseman.net>
  4. # (c) 2008
  5. VARLIB="/var/lib/monkeysphere"
  6. if ! getent passwd monkeysphere >/dev/null ; then
  7. echo "adding monkeysphere user..."
  8. adduser --quiet --system --no-create-home --group \
  9. --home '/var/lib/monkeysphere' \
  10. --shell '/bin/sh' \
  11. --gecos 'monkeysphere authentication user,,,' \
  12. monkeysphere
  13. fi
  14. # install host gnupg home directory
  15. install --owner root --group monkeysphere --mode 750 -d "$VARLIB"/gnupg-host
  16. # install host gpg.conf
  17. cat <<EOF > "$VARLIB"/gnupg-host/gpg.conf
  18. list-options show-uid-validity
  19. EOF
  20. # install authentication gnupg home directory
  21. install --owner monkeysphere --group monkeysphere --mode 700 -d "$VARLIB"/gnupg-authentication
  22. # install authentication gpg.conf
  23. cat <<EOF > "$VARLIB"/gnupg-authentication/gpg.conf
  24. list-options show-uid-validity
  25. primary-keyring $VARLIB/gnupg-authentication/pubring.gpg
  26. keyring $VARLIB/gnupg-host/pubring.gpg
  27. EOF
  28. chown monkeysphere:monkeysphere "$VARLIB"/gnupg-authentication/gpg.conf