X-Git-Url: https://git.cyclocoop.org/?p=lhc%2Fateliers.git;a=blobdiff_plain;f=remote%2Fduplicity-key-send;fp=remote%2Fduplicity-key-send;h=52ff14a63b2057e517b5777500b879d58d778b81;hp=650e21968a464205e9b338ca74aab94cc84469dd;hb=a11ad78672a096632b15a660509d7dd5f7c5eae5;hpb=0d705d8e2a919ee40866307aa3e18b1a5c4e7583 diff --git a/remote/duplicity-key-send b/remote/duplicity-key-send index 650e219..52ff14a 100755 --- a/remote/duplicity-key-send +++ b/remote/duplicity-key-send @@ -2,6 +2,18 @@ tool=$(readlink -e "${0%/*}/..") . "$tool"/remote/lib.sh -gpg --export-options export-reset-subkey-passwd \ +PATH=/usr/lib/gnupg2:"$PATH" + +IFS= read -r pass <<-EOF + $(gpg --decrypt "$tool"/var/sec/openpgp/backup+"$local_hostname"@"$local_domainname".pass.gpg) + EOF +for fpr in $(remote/gpg --list-secret-keys --with-colons --with-fingerprint --with-fingerprint \ + -- "backup+$local_hostname@$local_domainname" | grep '^fpr:' | cut -d : -f 10) + do gpg-preset-passphrase --preset -v $fpr <<-EOF + $pass + EOF + done + +"$tool"/remote/gpg --export-options export-reset-subkey-passwd \ --export-secret-subkeys "backup+$local_hostname@$local_domainname" | -"$tool"/remote/ssh gpg --import - +"$tool"/remote/ssh backup@$local_fqdn gpg --import -