testing: tighten up the umask before sshd launch, so that the socket is not exposed...
[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     chown root:root "$ETC"/gpg-host.conf
16     ln -s "$ETC"/gpg-host.conf "$VARLIB"/gnupg-host/gpg.conf
17 fi
18 if [ -f "$VARLIB"/gnupg-authentication/gpg.conf -a ! -L "$VARLIB"/gnupg-authentication/gpg.conf ] ; then
19     mv "$VARLIB"/gnupg-authentication/gpg.conf "$ETC"/gpg-authentication.conf
20     chown root:root "$ETC"/gpg-authentication.conf
21     ln -s "$ETC"/gpg-authentication.conf "$VARLIB"/gnupg-authentication/gpg.conf
22 fi