diff options
author | Benjamin Drung <bdrung@debian.org> | 2014-04-12 17:15:32 +0400 |
---|---|---|
committer | Benjamin Drung <bdrung@debian.org> | 2014-04-12 17:15:32 +0400 |
commit | 931dba38096866780bddd19269aa2b9d71e57d64 (patch) | |
tree | bb8932350cb8e86390b3133561a775ada2d244db /apt-mirror | |
parent | f69bb013d1a5b991ae2a35759b2e2adbd7fe7e2e (diff) | |
parent | 1bea0c5566a8b1e8a28f456d0aaf0dfd73dcec43 (diff) |
Merge pull request #31 from EifX/master
Added Proxy support
Diffstat (limited to 'apt-mirror')
-rwxr-xr-x | apt-mirror | 11 |
1 files changed, 9 insertions, 2 deletions
@@ -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 ) |