X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=remote%2Fduplicity-key-send;h=86290bdebac9877f9e4356089bcc95e77589b55f;hp=650e21968a464205e9b338ca74aab94cc84469dd;hb=b1959d9495c8be1d6a6894d564a3abcfc04c28ce;hpb=0d705d8e2a919ee40866307aa3e18b1a5c4e7583 diff --git a/remote/duplicity-key-send b/remote/duplicity-key-send index 650e219..86290bd 100755 --- a/remote/duplicity-key-send +++ b/remote/duplicity-key-send @@ -1,7 +1,17 @@ #!/bin/sh -eu +# SYNTAX: +# DESCRIPTION: envoie sur $local_fqdn la clef OpenPGP utilisée par duplicity(1). tool=$(readlink -e "${0%/*}/..") . "$tool"/remote/lib.sh -gpg --export-options export-reset-subkey-passwd \ - --export-secret-subkeys "backup+$local_hostname@$local_domainname" | -"$tool"/remote/ssh gpg --import - +uid=backup+"$local_hostname"@"$local_domainname" +trap_exit () { + "$tool"/remote/gpg-preset-passphrase --forget "$uid" + } +trap trap_exit EXIT +"$tool"/remote/gpg-preset-passphrase --preset "$uid" + +"$tool"/remote/gpg \ + --export-options export-reset-subkey-passwd \ + --export-secret-subkeys "$uid" | +"$tool"/remote/ssh backup@"$local_fqdn" gpg --import -