summaryrefslogtreecommitdiff
path: root/debian/monkeysphere.postinst
blob: 02d63046ff66db0cfc2ffbd457f30cfba4b8131c (plain)
  1. #!/bin/sh -e
  2. # postinst script for monkeysphere
  3. # Author: Jameson Rollins <jrollins@fifthhorseman.net>
  4. # Copyright 2008
  5. ETC="/etc/monkeysphere"
  6. VARLIB="/var/lib/monkeysphere"
  7. if ! getent passwd monkeysphere >/dev/null ; then
  8. echo "adding monkeysphere user..."
  9. adduser --quiet --system --no-create-home --group \
  10. --home "$VARLIB" \
  11. --shell '/bin/bash' \
  12. --gecos 'monkeysphere authentication user,,,' \
  13. monkeysphere
  14. fi
  15. # install host gnupg home directory
  16. install --owner root --group monkeysphere --mode 750 -d "$VARLIB"/gnupg-host
  17. # link in the gpg.conf
  18. ln -sTf "$ETC"/gnupg-host.conf "$VARLIB"/gnupg-host/gpg.conf
  19. # install authentication gnupg home directory
  20. install --owner monkeysphere --group monkeysphere --mode 700 -d "$VARLIB"/gnupg-authentication
  21. # link in the gpg.conf
  22. ln -sTf "$ETC"/gnupg-authentication.conf "$VARLIB"/gnupg-authentication/gpg.conf