diff options
author | Andinus <andinus@nand.sh> | 2020-10-15 00:35:48 +0530 |
---|---|---|
committer | Andinus <andinus@nand.sh> | 2020-10-15 00:35:48 +0530 |
commit | d718d2e0aeaa410659654dac1d224910210c9849 (patch) | |
tree | 5fda047df68789f9ff92a63d90332173713a386b | |
parent | 5341ecc13ae8bdb0b5326652247207136cc68eb2 (diff) | |
download | leo-d718d2e0aeaa410659654dac1d224910210c9849.tar.gz |
Remove unrequired options, don't use prototypes
-rwxr-xr-x | leo.pl | 13 |
1 files changed, 8 insertions, 5 deletions
diff --git a/leo.pl b/leo.pl index d1e9f2d..8dbcd87 100755 --- a/leo.pl +++ b/leo.pl @@ -14,12 +14,12 @@ use Getopt::Long qw/ GetOptions /; my %options = ( encrypt => $ENV{LEO_ENCRYPT}, sign => $ENV{LEO_SIGN}, - delete => $ENV{LEO_DELETE}, + sign => $ENV{LEO_SIGNIFY}, ); GetOptions( \%options, - qw{ verbose encrypt sign delete help } + qw{ verbose encrypt sign signify delete help } ) or die "Error in command line arguments\n"; # Configuration. @@ -137,7 +137,7 @@ sub backup { } # Encrypt, Sign backups. -sub encrypt_sign() { +sub encrypt_sign { my $prof = shift @_; my $file = "$backup_dir/${prof}.tar"; @@ -164,12 +164,15 @@ sub encrypt_sign() { if $options{delete}; } -sub signify() { +sub signify { my $prof = shift @_; my $file = "$backup_dir/${prof}.tar"; + die "\nSignify: seckey doesn't exist\n" + unless $options{signify_seckey} and -e $options{signify_seckey}; + my @options = ("-S"); - push @options, "-s", $profile{_}{signify_seckey}; + push @options, "-s", $options{signify_seckey}; push @options, "-m", $file; push @options, "-x", "$file.sig"; |