[prev in list] [next in list] [prev in thread] [next in thread]
List: ipcop-svn
Subject: [Ipcop-svn] SF.net SVN: ipcop:[7506] ipcop/trunk/src/scripts/blacklistupdate.pl
From: owes () users ! sourceforge ! net
Date: 2014-04-29 13:56:20
Message-ID: E1Wf8WF-0005Fx-Td () sfs-ml-1 ! v29 ! ch3 ! sourceforge ! com
[Download RAW message or body]
Revision: 7506
http://sourceforge.net/p/ipcop/svn/7506
Author: owes
Date: 2014-04-29 13:56:19 +0000 (Tue, 29 Apr 2014)
Log Message:
-----------
Use upstream proxy for blacklist updates.
Modified Paths:
--------------
ipcop/trunk/src/scripts/blacklistupdate.pl
Modified: ipcop/trunk/src/scripts/blacklistupdate.pl
===================================================================
--- ipcop/trunk/src/scripts/blacklistupdate.pl 2014-04-26 18:14:47 UTC (rev 7505)
+++ ipcop/trunk/src/scripts/blacklistupdate.pl 2014-04-29 13:56:19 UTC (rev 7506)
@@ -20,6 +20,7 @@
#
# $Id$
#
+
use strict;
use warnings;
@@ -43,6 +44,10 @@
$updatesettings{'ENABLED'} = 'off';
$updatesettings{'ENABLE_AUTOUPDATE'} = 'off';
$updatesettings{'CHECKUPDATES'} = 'off';
+my %proxysettings;
+$proxysettings{'UPSTREAM_PROXY'} = '';
+$proxysettings{'UPSTREAM_USER'} = '';
+$proxysettings{'UPSTREAM_PASSWORD'} = '';
my @categories;
my $blacklist;
@@ -55,6 +60,9 @@
if (-e "$updconffile") {
&General::readhash("$updconffile", \%updatesettings);
}
+if (-e '/var/ipcop/proxy/settings') {
+ &General::readhash('/var/ipcop/proxy/settings', \%proxysettings);
+}
while (@ARGV) {
my $argument = shift;
@@ -131,6 +139,7 @@
my $blacklist_url = '';
my $blacklist_src = '';
+ my $proxy_login = '';
my $source_url = '';
my $source_name = '';
my @source_urllist = ();
@@ -195,8 +204,17 @@
}
system("mkdir $target");
- system("/usr/bin/wget -o $target/wget.log -O $blacklist $blacklist_url");
+ if (($proxysettings{'UPSTREAM_PROXY'}) && ($proxysettings{'UPSTREAM_USER'})) \
{ + $proxy_login = "--proxy-user=\"$proxysettings{'UPSTREAM_USER'}\"";
+ if ($proxysettings{'UPSTREAM_PASSWORD'}) {
+ $proxy_login .= " \
--proxy-password=\"$proxysettings{'UPSTREAM_PASSWORD'}\""; + }
+ }
+ $ENV{'http_proxy'} = $proxysettings{'UPSTREAM_PROXY'};
+ system("/usr/bin/wget $proxy_login -o $target/wget.log -O $blacklist \
$blacklist_url"); + $ENV{'http_proxy'} = '';
+
if (-e $blacklist) {
system("/bin/tar --no-same-owner -xzf $blacklist -C $target");
This was sent by the SourceForge.net collaborative development platform, the world's \
largest Open Source development site.
------------------------------------------------------------------------------
"Accelerate Dev Cycles with Automated Cross-Browser Testing - For FREE
Instantly run your Selenium tests across 300+ browser/OS combos. Get
unparalleled scalability from the best Selenium testing platform available.
Simple to use. Nothing to install. Get started now for free."
http://p.sf.net/sfu/SauceLabs
_______________________________________________
Ipcop-svn mailing list
Ipcop-svn@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/ipcop-svn
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic