owncloud test: Make use of a little cfg file to configure credentials.

This commit is contained in:
Klaas Freitag 2012-03-04 11:11:07 +01:00 committed by Dominik Schmidt
parent 9916abc072
commit da32a9facf

View File

@ -17,11 +17,26 @@ use strict;
print "Hello, this is t1, a tester for csync with ownCloud.\n";
#
# Adjust data as needed here:
# Adjust data as needed here or better us a t1.cfg file with the following
# content:
# user => "joe",
# passwd => "XXXXXX",
# url => "http://localhost/oc/files/webdav.php"
my $owncloud = "http://localhost/oc/files/webdav.php/";
my $user = "joe";
my $passwd = 'XXXXX'; # Mind to be secure.
if( -r "./t1.cfg" ) {
my %config = do 't1.cfg';
$user = $config{user} if( $config{user} );
$passwd = $config{passwd} if( $config{passwd} );
$owncloud = $config{url} if( $config{url} );
print "Read t1.cfg\n";
}
$owncloud .= "/" unless( $owncloud =~ /\/$/ );
print "Connecting to ownCloud at ". $owncloud ."\n";