Ajout : remote/duplicity .
[lhc/ateliers.git] / remote / duplicity-key-send
1 #!/bin/sh -eu
2 # SYNTAX:
3 # DESCRIPTION: envoie sur $local_fqdn la clef OpenPGP utilisée par duplicity(1).
4 tool=$(readlink -e "${0%/*}/..")
5 . "$tool"/remote/lib.sh
6
7 uid=backup+"$local_hostname"@"$local_domainname"
8 trap_exit () {
9 "$tool"/remote/gpg-preset-passphrase --forget "$uid"
10 }
11 trap trap_exit EXIT
12 "$tool"/remote/gpg-preset-passphrase --preset "$uid"
13
14 "$tool"/remote/gpg \
15 --export-options export-reset-subkey-passwd \
16 --export-secret-subkeys "$uid" |
17 "$tool"/remote/ssh backup@"$local_fqdn" gpg --import -