Read configuration from /etc/ownCloud/t1.cfg

This commit is contained in:
Klaas Freitag 2014-02-10 15:07:56 +01:00
parent 43345dc236
commit b84253054a

View file

@ -82,8 +82,11 @@ sub initTesting(;$)
{ {
my ($prefix) = @_; my ($prefix) = @_;
if( -r "./t1.cfg" ) { my $cfgFile = "./t1.cfg";
my %config = do 't1.cfg'; $cfgFile = "/etc/ownCloud/t1.cfg" if( -r "/etc/ownCloud/t1.cfg" );
if( -r "$cfgFile" ) {
my %config = do $cfgFile;
warn "Could not parse t1.cfg: $!\n" unless %config; warn "Could not parse t1.cfg: $!\n" unless %config;
warn "Could not do t1.cfg: $@\n" if $@; warn "Could not do t1.cfg: $@\n" if $@;
@ -92,12 +95,14 @@ sub initTesting(;$)
$owncloud = $config{url} if( $config{url} ); $owncloud = $config{url} if( $config{url} );
$ld_libpath = $config{ld_libpath} if( $config{ld_libpath} ); $ld_libpath = $config{ld_libpath} if( $config{ld_libpath} );
$csync = $config{csync} if( $config{csync} ); $csync = $config{csync} if( $config{csync} );
print "Read t1.cfg: $config{url}\n"; print "Read config from $cfgFile: $config{url}\n";
} else {
print STDERR "Could not read a config file $cfgFile\n";
exit(1);
} }
$owncloud .= "/" unless( $owncloud =~ /\/$/ ); $owncloud .= "/" unless( $owncloud =~ /\/$/ );
print "Connecting to ownCloud at ". $owncloud ."\n"; print "Connecting to ownCloud at ". $owncloud ."\n";
$d = HTTP::DAV->new(); $d = HTTP::DAV->new();