3 # This is a post-install script for monkeysphere, to transition an old
4 # (<=0.22) setup to the new (>0.22) setup
6 SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"}
8 MADATADIR="${SYSDATADIR}/authentication"
9 MHDATADIR="${SYSDATADIR}/host"
11 ############################################################
12 ### transfer host setup
14 if [ -d "$SYSDATADIR"/gnupg-host ] ; then
16 if [ -s "$SYSDATADIR"/ssh_host_rsa_key ] ; then
18 # This would be simple, but it would generate a new pgp key,
19 #and we don't want that, right?
20 #monkeysphere-host expert import_key "$SYSDATADIR"/ssh_host_rsa_key
23 mkdir -p "${MHDATADIR}"
24 mkdir -p "${MHTMPDIR}"
25 mkdir -p "${GNUPGHOME_HOST}"
26 chmod 700 "${GNUPGHOME_HOST}"
28 # transfer the host secret key from the old home to the new
29 GNUPGHOME="$SYSDATADIR"/gnupg-host gpg --export-secret-keys \
30 GNUPGHOME="$MHDATADIR" gpg --import
32 # make sure the ssh_host_rsa_key.pub and ssh_host_rsa_key.pub.gpg
39 #rm -rf "$SYSDATADIR"/gnupg-host
43 ############################################################
44 ### transfer authentication setup
46 # should we test for something else/better than the existence of this
47 # directory to know that we should go through the setup?
48 if [ -d "$SYSDATADIR"/gnupg-authentication ] ; then
50 # run the authentication setup
51 monkeysphere-authentication setup
55 # i think we'll need to run something like
56 # gpg_core_sphere_sig_transfer after transfering certifiers ltsigs
58 # do we need to do some sort of transfer of ownertrust?
60 # move the authorized_keys directory
61 mv "$SYSDATADIR"/authorized_keys "$MADATADIR"/
63 # do we need to transfer anything else? running update-users will
64 # regenerate everything else in the sphere keyring, right?
66 #rm -rf "$SYSDATADIR"/gnupg-authentication