summaryrefslogtreecommitdiff
path: root/packaging/debian/monkeysphere.postinst
blob: 8c6a555d2de8b52430a28cb87dceabaf087b269e (plain)
  1. #!/bin/sh
  2. # postinst script for monkeysphere
  3. # Author: Jameson Rollins <jrollins@finestructure.net>
  4. # Copyright 2008-2010
  5. set -e
  6. VARLIB="/var/lib/monkeysphere"
  7. case $1 in
  8. configure)
  9. # add a monkeysphere user if one does not already exist
  10. if ! getent passwd monkeysphere >/dev/null ; then
  11. echo "adding monkeysphere user..."
  12. adduser --quiet --system --no-create-home --group \
  13. --home "$VARLIB" \
  14. --shell '/bin/bash' \
  15. --gecos 'monkeysphere authentication user,,,' \
  16. monkeysphere
  17. fi
  18. # try all available transitions:
  19. for trans in 0.23 0.28 ; do
  20. /usr/share/monkeysphere/transitions/$trans || { \
  21. RET=$?
  22. echo "Failed running transition script /usr/share/monkeysphere/transitions/$trans" >&2
  23. exit $RET
  24. }
  25. done
  26. # setup monkeysphere authentication
  27. monkeysphere-authentication setup
  28. ;;
  29. esac
  30. # dh_installdeb will replace this with shell code automatically
  31. # generated by other debhelper scripts.
  32. #DEBHELPER#
  33. exit 0