1
0

tang-common.postinst 637 B

123456789101112131415161718192021222324252627282930
  1. #!/bin/sh
  2. set -eu
  3. db_dir_old='/var/db/tang'
  4. db_dir='/var/lib/tang'
  5. case "$1" in
  6. configure)
  7. if ! getent passwd _tang >/dev/null; then
  8. adduser --quiet --system --group --no-create-home --home /nonexistent --force-badname _tang
  9. fi
  10. # assert db directory
  11. mkdir -m0750 -p "$db_dir"
  12. # assert restrictive permissions upon upgrade
  13. chmod 0750 "$db_dir"
  14. chown _tang:_tang "$db_dir"
  15. ;;
  16. abort-upgrade | abort-remove | abort-deconfigure) ;;
  17. *)
  18. echo "postinst called with unknown argument '$1'" >&2
  19. exit 1
  20. ;;
  21. esac
  22. #DEBHELPER#
  23. exit 0