Add debian preinst script to move old gpg.conf files out of the way.
[monkeysphere.git] / debian / monkeysphere.preinst
1 #!/bin/sh -e
2
3 # preinst script for monkeysphere
4
5 # Author: Jameson Rollins <jrollins@fifthhorseman.net>
6 # Copyright 2008
7
8 ETC="/etc/monkeysphere"
9 VARLIB="/var/lib/monkeysphere"
10
11 # move the gpg.conf files from the GNUPGHOMEs if they're there to
12 # /etc, where they will be linked back into the GNUPGHOMEs later
13 if [ -f "$VARLIB"/gnupg-host/gpg.conf -a ! -L "$VARLIB"/gnupg-host/gpg.conf ] ; then
14     mv "$VARLIB"/gnupg-host/gpg.conf "$ETC"/gpg-host.conf
15 fi
16 if [ -f "$VARLIB"/gnupg-authentication/gpg.conf -a ! -L "$VARLIB"/gnupg-authentication/gpg.conf ] ; then
17     mv "$VARLIB"/gnupg-authentication/gpg.conf "$ETC"/gnupg-authentication.conf 
18 fi