From d718d2e0aeaa410659654dac1d224910210c9849 Mon Sep 17 00:00:00 2001 From: Andinus Date: Thu, 15 Oct 2020 00:35:48 +0530 Subject: Remove unrequired options, don't use prototypes --- leo.pl | 13 ++++++++----- 1 file 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"; -- cgit 1.4.1-2-gfad0