Commits

Palmer, 2E0EOL  committed f0a7985

Read user-specific configuration file

  • Participants
  • Parent commits e7cc200
  • Branches f/201210-conf

Comments (0)

Files changed (1)

 use LWP::Simple qw(get);
 use XML::Feed;
 use Data::Dumper;
+use Daybo::ConfReader;
 use strict;
 use warnings;
 use diagnostics;
 
 sub main()
 {
-	ReadStream(URL());
+	my @defKeys;
+	my $conf = Daybo::ConfReader->new();
+	my $conffile = "$ENV{HOME}/.dlpodget.rc";
+	if ( -f $conffile ) {
+		$conf->Reload() if ( $conf->SetFn($conffile) );
+	}
+	if ( $conf->GetKeys(undef, \@defKeys) ) {
+		if ( 'enable' ~~ @defKeys ) {
+			if ( !$conf->GetDatum(undef, 'enable') ) {
+				print(STDERR "Configuration disabled.\n");
+			}
+		}
+	}
+	#ReadStream(URL());
 	return 0;
 }