diff options
author | Andinus <andinus@nand.sh> | 2020-10-15 18:23:26 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-10-15 18:23:26 +0530 |
commit | 5924071b7c85e90f37b61ddfb755483686de76a1 (patch) | |
tree | 3d71e759b89f4464dd184b6998b5f6a0db4d8248 | |
parent | 561874a1000dfb4ab60fa4e679c50e869896b976 (diff) | |
download | leo-5924071b7c85e90f37b61ddfb755483686de76a1.tar.gz |
Add option to specify gpg recipients
-rwxr-xr-x | leo.pl | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/leo.pl b/leo.pl index da0af3b..074223a 100755 --- a/leo.pl +++ b/leo.pl @@ -70,6 +70,7 @@ $backup_dir .= "/$ymd"; path($backup_dir)->mkpath; # Create backup directory. my $gpg_fingerprint = $options{gpg_fingerprint} || "`nil'"; +my @gpg_recipients = split / /, $options{gpg_recipient}; my $gpg_bin = $options{gpg_bin} || "gpg"; # Print help. @@ -142,8 +143,15 @@ sub encrypt_sign { my $file = "$backup_dir/${prof}.tar"; my @options = (); - push @options, "--recipient", $gpg_fingerprint, "--encrypt" - if $profile{$prof}{encrypt}; + push @options, "--default-key", $gpg_fingerprint; + + if ( $profile{$prof}{encrypt} ) { + push @options, "--encrypt"; + push @options, "--recipient", $gpg_fingerprint; + push @options, "--recipient", $_ + foreach @gpg_recipients; + } + push @options, "--sign" if $profile{$prof}{sign}; push @options, "--verbose" if $options{verbose}; |