summaryrefslogtreecommitdiff
path: root/packaging/debian/monkeysphere.preinst
blob: 528da84ed9d6b594b4d86a886470becc77b2665b (plain)
  1. #!/bin/sh -e
  2. # preinst script for monkeysphere
  3. # Author: Jameson Rollins <jrollins@fifthhorseman.net>
  4. # Copyright 2008
  5. ETC="/etc/monkeysphere"
  6. VARLIB="/var/lib/monkeysphere"
  7. # move the gpg.conf files from the GNUPGHOMEs if they're there to
  8. # /etc, where they will be linked back into the GNUPGHOMEs later
  9. if [ -f "$VARLIB"/gnupg-host/gpg.conf -a ! -L "$VARLIB"/gnupg-host/gpg.conf ] ; then
  10. mv "$VARLIB"/gnupg-host/gpg.conf "$ETC"/gpg-host.conf
  11. chown root:root "$ETC"/gpg-host.conf
  12. ln -s "$ETC"/gpg-host.conf "$VARLIB"/gnupg-host/gpg.conf
  13. fi
  14. if [ -f "$VARLIB"/gnupg-authentication/gpg.conf -a ! -L "$VARLIB"/gnupg-authentication/gpg.conf ] ; then
  15. mv "$VARLIB"/gnupg-authentication/gpg.conf "$ETC"/gpg-authentication.conf
  16. chown root:root "$ETC"/gpg-authentication.conf
  17. ln -s "$ETC"/gpg-authentication.conf "$VARLIB"/gnupg-authentication/gpg.conf
  18. fi
  19. # dh_installdeb will replace this with shell code automatically
  20. # generated by other debhelper scripts.
  21. #DEBHELPER#
  22. exit 0