#!/bin/bash # # Edit keys. # # Load functions LIB="`dirname $0`/../../lib/keyringer/functions" source $LIB keyringer_set_env $* # Get file keyringer_get_file $2 echo "Make sure that $BASEDIR is atop of an encrypted volume." # Set a tmp file TMPFILE="`keyringer_set_tmpfile edit`" trap "keyringer_unset_tmpfile $TMPFILE ; exit" INT TERM EXIT # Decrypt the information to the file gpg --yes -o $TMPFILE --use-agent -d $KEYDIR/$FILE echo "Press any key to open the decrypted data into $EDITOR, Ctrl-C to abort" read key $EDITOR $TMPFILE # Encrypt again gpg --yes -o $KEYDIR/$FILE --use-agent --armor -e -s $(keyringer_recipients $RECIPIENTS) $TMPFILE # Remove temp file keyringer_unset_tmpfile $TMPFILE