summaryrefslogtreecommitdiff
path: root/debian/monkeysphere.preinst
blob: 860286b069de5db0927b9bd527d80a1404bd2a9a (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