daily pastebin goal
25%
SHARE
TWEET

Untitled

a guest Jun 5th, 2017 56 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. #Fuh-zz <fuzzylunkinz@gmail.com>
  2. # Send ART and PDB installer components to egretfiles FTP as a mirror
  3.  
  4. use strict;
  5. use Getopt::Long;
  6. use Net::FTP;
  7. use Digest::MD5;
  8.  
  9. my $build = "";
  10. my $revision = "";
  11. my $version = "";
  12. my $ART = "C:\\inetpub\\wwwroot\\build\\Alleg";
  13. my $PDB = "C:\\inetpub\\wwwroot\\build\\Alleg";
  14. my $server = "ftp.egretfiles.com";
  15. my $user = "build\@egretfiles.com";
  16.  
  17. open(PASS,"C:\\egretfiles.passwd");
  18. my $pass = <PASS>;
  19. close PASS;
  20.  
  21.  
  22. GetOptions("b=s" => \$build, "r=s" => \$revision, "v=s" => \$version);
  23. if($version eq "1.1"){
  24.     $ART .= "R6ART_b$build_r$revision.exe";
  25.     $PDB .= "R6PDB_b$build_r$revision.exe";
  26. }
  27. else if($version eq "1.0"){
  28.     $ART .= "ART_b$build_r$revision.exe";
  29.     $PDB .= "PDB_b$build_r$revision.exe";
  30. }
  31. else{ die "No version specified! Command line switch '-v' either 1.1 or 1.0"; }
  32.  
  33. my $ftp = Net::FTP->new($server, Debug => 0, Port => 21, Passive => 1)
  34.     or die "Cannot connect to '$server' $@";
  35.  
  36. $ftp->login($user,$pass)
  37.     or die "Cannot login ", $ftp->message;
  38. print "Uploading PDB to $server\n";
  39. $ftp->put($PDB)
  40.     or die "Put failed ", $ftp->message;    
  41. print "Uploading ART to $server\n";
  42. $ftp->put($ART)
  43.     or die "Put failed ", $ftp->message;
  44.  
  45. print "Files uploaded OK\n";
  46. $ftp->quit();
  47.  
  48.  
  49. exit 0;
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top