dnssec-keytool.pl
branchhs12
changeset 71 e25fc893e203
parent 69 fdf4df74d8c5
child 72 d3d2108f07da
--- a/dnssec-keytool.pl	Mon Jan 03 16:13:54 2011 +0100
+++ b/dnssec-keytool.pl	Mon Jan 03 16:49:56 2011 +0100
@@ -9,6 +9,7 @@
 use Pod::Usage;
 use File::Basename;
 use if $ENV{DEBUG} => "Smart::Comments";
+use my::Config qw(get_config);
 
 my $ME = basename $0;
 
@@ -22,7 +23,7 @@
 
 MAIN: {
     ### reading config
-    my %conf = read_conf("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf");
+    my %conf = get_config("$FindBin::Bin/dnstools.conf", "/etc/dnstools.conf");
 
     my ($cmd, @zones) = read_argv($conf{master_dir});
 
@@ -69,24 +70,6 @@
     return ($cmd, @zones);
 }
 
-sub read_conf(@) {
-
-    # read configuration
-    my @conffiles = @_;
-    my %return;
-
-    my ($_) = grep { -f } @conffiles;
-    open(my $cf, $_) or die "Can't open $_: $!\n";
-
-    while (<$cf>) {
-        s/#.*//;
-        s/\s//g;
-        next unless length;
-        my ($cname, $ccont) = split(/\s*=\s*/, $_, 2);
-        $return{$cname} = $ccont;
-    }
-    return %return;
-}
 
 sub rm_keys ($@) {