Add --config option

Piotr Pawlow [2016-04-14 16:02:44]
Add --config option
Filename
renew.pl
diff --git a/renew.pl b/renew.pl
index 2cdb8e8..0b25e0e 100755
--- a/renew.pl
+++ b/renew.pl
@@ -6,6 +6,7 @@ use warnings;
 use autodie qw(:all);
 use Date::Parse;
 use LWP::UserAgent;
+use Getopt::Long;

 {
   our @restart_services_cmd = qw(sudo service httpd graceful);
@@ -15,8 +16,10 @@ use LWP::UserAgent;
   our $challenges_dir = 'data/challenges/';
   our $days_left_limit = 14;
   our $csr_dir = 'data';
+  our $config_file;

-  require 'config.pm' if -e 'config.pm';
+  GetOptions("config=s" => \$config_file);
+  require $config_file if defined $config_file;

   sub get_intermediate_cert_url {
     my $crt_fn = shift;
ViewGit