-die unless (defined ($Config->{'uri'}) and defined ($Config->{'bind_dn'})
- and defined ($Config->{'password'}));
+if (-e $ENV{'HOME'} . '/.licomrc')
+{
+ $Config = get_config ($ENV{'HOME'} . '/.licomrc');
+}
+elsif (-e '/etc/licom/licom.conf')
+{
+ $Config = get_config ('/etc/licom/licom.conf');
+}
+else
+{
+ $Config = get_config ();
+}
+
+if ($ENV{'DEBUG'})
+{
+ require Data::Dumper;
+ print STDERR Data::Dumper->Dump ([$Config], ['Config']);
+}
+
+unless (defined ($Config->{'uri'}) and defined ($Config->{'bind_dn'})
+ and defined ($Config->{'password'}))
+{
+ die (<<ERROR);
+The configuration has not been found or is not complete. At least the options
+uri, bind_dn and password are needed.
+ERROR
+}