Using proxy server for zmupdate.pl

If you've made a patch to quick fix a bug or to add a new feature not yet in the main tree then post it here so others can try it out.
Post Reply
essup
Posts: 77
Joined: Tue Jun 13, 2006 2:08 pm

Using proxy server for zmupdate.pl

Post by essup »

Code: Select all

--- zmupdate.pl.old   2006-08-22 10:23:14.000000000 +0200
+++ zmupdate.pl   2006-08-22 10:23:02.000000000 +0200
@@ -73,6 +73,7 @@
 my $version = '';
 my $db_user = ZM_DB_USER;
 my $db_pass = ZM_DB_PASS;
+my $proxy = '';
 sub Usage
 {
     print( "
@@ -139,6 +140,11 @@
          my $ua = LWP::UserAgent->new;
          $ua->agent( "ZoneMinder Update Agent/".ZM_VERSION );
 
+         if( $ENV{'http_proxy'} ne '' ) {
+            $ua->env_proxy();
+            print( "Using proxy: ".$ENV{'http_proxy'}."\n" );
+         }
+
          my $req = HTTP::Request->new( GET=>'http://www.zoneminder.com/version' );
          my $res = $ua->request($req); 
I already posted this patch here but i thought it should get its own thread.
Post Reply