From da32a9facf08f733f233b063e83b1557d2830f46 Mon Sep 17 00:00:00 2001 From: Klaas Freitag Date: Sun, 4 Mar 2012 11:11:07 +0100 Subject: [PATCH] owncloud test: Make use of a little cfg file to configure credentials. --- tests/ownCloud/t1.pl | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/tests/ownCloud/t1.pl b/tests/ownCloud/t1.pl index 482fe88470..15b17bfef7 100755 --- a/tests/ownCloud/t1.pl +++ b/tests/ownCloud/t1.pl @@ -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";