diff options
author | Matt Goins <mjgoins@openflows.com> | 2009-02-17 22:31:17 -0500 |
---|---|---|
committer | Matt Goins <mjgoins@openflows.com> | 2009-02-17 22:31:17 -0500 |
commit | 8e3de9de8bc67b3e9e2c490a7e3142fde7742044 (patch) | |
tree | d0cb80bf0d37da795721167ecbf42423a570f578 /src/transition_0.22_0.23 | |
parent | 3b81cd012e8224490a3836cccbd7d082a061658e (diff) | |
parent | 25e870d1d7109f9e37460c26de4a05a05adfc760 (diff) |
Merge commit 'jrollins/master'
Diffstat (limited to 'src/transition_0.22_0.23')
-rwxr-xr-x | src/transition_0.22_0.23 | 69 |
1 files changed, 69 insertions, 0 deletions
diff --git a/src/transition_0.22_0.23 b/src/transition_0.22_0.23 new file mode 100755 index 0000000..3328e8c --- /dev/null +++ b/src/transition_0.22_0.23 @@ -0,0 +1,69 @@ +#!/bin/bash + +# This is a post-install script for monkeysphere, to transition an old +# (<=0.22) setup to the new (>0.22) setup + +SYSDATADIR=${MONKEYSPHERE_SYSDATADIR:-"/var/lib/monkeysphere"} + +MADATADIR="${SYSDATADIR}/authentication" +MHDATADIR="${SYSDATADIR}/host" + +############################################################ +### transfer host setup + +if [ -d "$SYSDATADIR"/gnupg-host ] ; then + + if [ -s "$SYSDATADIR"/ssh_host_rsa_key ] ; then + + # This would be simple, but it would generate a new pgp key, + #and we don't want that, right? + #monkeysphere-host expert import_key "$SYSDATADIR"/ssh_host_rsa_key + + # create host home + mkdir -p "${MHDATADIR}" + mkdir -p "${MHTMPDIR}" + mkdir -p "${GNUPGHOME_HOST}" + chmod 700 "${GNUPGHOME_HOST}" + + # transfer the host secret key from the old home to the new + GNUPGHOME="$SYSDATADIR"/gnupg-host gpg --export-secret-keys \ + GNUPGHOME="$MHDATADIR" gpg --import + + # make sure the ssh_host_rsa_key.pub and ssh_host_rsa_key.pub.gpg + # files exist + + # anything else? + + fi + + #rm -rf "$SYSDATADIR"/gnupg-host + +fi + +############################################################ +### transfer authentication setup + +# should we test for something else/better than the existence of this +# directory to know that we should go through the setup? +if [ -d "$SYSDATADIR"/gnupg-authentication ] ; then + + # run the authentication setup + monkeysphere-authentication setup + + # transfer certifiers + # FIXME: how? + # i think we'll need to run something like + # gpg_core_sphere_sig_transfer after transfering certifiers ltsigs + + # do we need to do some sort of transfer of ownertrust? + + # move the authorized_keys directory + mv "$SYSDATADIR"/authorized_keys "$MADATADIR"/ + + # do we need to transfer anything else? running update-users will + # regenerate everything else in the sphere keyring, right? + + #rm -rf "$SYSDATADIR"/gnupg-authentication + +fi + |