From b9f7aecc81d9483c3db2ba49559cdb441ae81e6b Mon Sep 17 00:00:00 2001 From: Vincent Le Gallic Date: Mon, 21 Oct 2013 00:30:41 +0200 Subject: [PATCH] Key singing-party \o/ --- import_caff_sigs.sh | 43 +++++++++++++++++++++++++++++++++++++++++++ 1 file changed, 43 insertions(+) create mode 100755 import_caff_sigs.sh diff --git a/import_caff_sigs.sh b/import_caff_sigs.sh new file mode 100755 index 0000000..2028668 --- /dev/null +++ b/import_caff_sigs.sh @@ -0,0 +1,43 @@ +#!/bin/bash + +# Pour récupérer toutes les signatures des mails dans le dossier +# idoine stocké sur zamok + +# NB : si tu n'as pas "cadre", bah t'es puni, remplace par echo + +# ------- + +# On lance l'agent gpg avec un pinentry commandline +cadre "Starting gpg-agent" +eval $(gpg-agent --daemon --pinentry-program /usr/bin/pinentry-curses) +echo $GPG_AGENT_INFO +agentpid=$(echo $GPG_AGENT_INFO | cut -d: -f 2) + +# On récupère les mails de signatures +where=`mktemp -d` +cadre "Storing mails copied in ${where}" + +scp zamok:~/Mail/.Signatures/cur/*:2,a ${where} + +# On traite les mails un par un +cadre "Decrypting and importing signatures" +for mail in ${where}/*; +do + gpg2 --decrypt ${mail} | gpg2 --import; +done + +# On marque (peut-être) les mails distants comme lus +cadre "Cleaning up" +echo -n "Mark distant e-mails as read ? [Y/n]" +read -r ans +[[ "${ans}" = "n" ]] || [[ "${ans}" = "N" ]] || ssh zamok rename 's/2,a$/2,Sa/' Mail/.Signatures/cur/*:2,a + +# On fait le ménage +echo -n "Remove local tempfolder ? [Y/n]" +read -r ans +[[ "${ans}" = "n" ]] || [[ "${ans}" = "N" ]] || rm -rfv ${where} + +cadre "Sending freshly-signed key to servers" +echo -n "Sure ? [Y/n]" +read -r ans +[[ "${ans}" = "n" ]] || [[ "${ans}" = "N" ]] || gpg --send-keys A94025B0 -- 2.39.2