Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/apt-mirror/apt-mirror.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBenjamin Drung <bdrung@debian.org>2014-04-12 17:15:32 +0400
committerBenjamin Drung <bdrung@debian.org>2014-04-12 17:15:32 +0400
commit931dba38096866780bddd19269aa2b9d71e57d64 (patch)
treebb8932350cb8e86390b3133561a775ada2d244db /apt-mirror
parentf69bb013d1a5b991ae2a35759b2e2adbd7fe7e2e (diff)
parent1bea0c5566a8b1e8a28f456d0aaf0dfd73dcec43 (diff)
Merge pull request #31 from EifX/master
Added Proxy support
Diffstat (limited to 'apt-mirror')
-rwxr-xr-xapt-mirror11
1 files changed, 9 insertions, 2 deletions
diff --git a/apt-mirror b/apt-mirror
index b09c3cb..2da9153 100755
--- a/apt-mirror
+++ b/apt-mirror
@@ -113,7 +113,9 @@ my %config_variables = (
"auth_no_challenge" => 0,
"no_check_certificate" => 0,
"unlink" => 0,
- "postmirror_script" => '$var_path/postmirror.sh'
+ "postmirror_script" => '$var_path/postmirror.sh',
+ "proxy_user" => '',
+ "proxy_password" => ''
);
my @config_binaries = ();
@@ -228,7 +230,12 @@ sub download_urls
if ( get_variable("auth_no_challenge") == 1 ) { push( @args, "--auth-no-challenge" ); }
if ( get_variable("no_check_certificate") == 1 ) { push( @args, "--no-check-certificate" ); }
if ( get_variable("unlink") == 1 ) { push( @args, "--unlink" ); }
-
+ if ( length ( get_variable("use_proxy") ) && ( get_variable("use_proxy") eq 'yes' || get_variable("use_proxy") eq 'on' ) )
+ {
+ if ( length ( get_variable("http_proxy") ) ) { push( @args, "-e use_proxy=yes"); push( @args, "-e http_proxy=" . get_variable( "http_proxy" ) ); }
+ if ( length ( get_variable("proxy_user") ) ) { push( @args, "-e proxy_user=" . get_variable( "proxy_user" ) ); }
+ if ( length ( get_variable("proxy_password") ) ) { push( @args, "-e proxy_password=" . get_variable( "proxy_password" ) ); }
+ }
print "Downloading " . scalar(@urls) . " $stage files using $nthreads threads...\n";
while ( scalar @urls )