Monday, December 15, 2008

Perl code to initiate a shutdown from website

#!/app/perl5005/bin/perl -w

use lib "/Progra~1/Perl/site/lib";

use HTTP::Request::Common qw(POST);
use LWP::UserAgent;
use vars qw($MP);

$| = 1; # unbuffer output

# Shutdown the Matrix Pricer first
$ua = LWP::UserAgent->new;
my $response = $ua->request(POST "http://localhost:8251/shutdown", [username => 'rdgadmin', confirm => 'yes']);

        print STDERR "ERROR - could not shut down DMSwaps MatrixPricer\n";

# sleep for a minute so the PMT has no chance to restart it.


No comments:

Post a Comment