#!/usr/bin/perl
#
use Getopt::Long;

GetOptions ('pause!');

my $host = shift;
my $cmd = shift;
my $line = undef;

require Net::Telnet;
import Net::Telnet;
my $webobj = new Net::Telnet (Telnetmode => 0);
$webobj->open(Host => $host,
Timeout => 100000,
Port => 1080);
$webobj->print("GET $cmd&mode=telnet");
$line="";
while ( $line !~ /Remcall was started/i)
{
	$line = $webobj->getline(Timeout => 100000);
}
$line = $webobj->getline (Timeout => 100000);
while ($line !~ /Remcall was finished/i)
{
	print ("$line");
	$line = $webobj->getline (Timeout => 100000);
}

if (defined $opt_pause)
{
	print "Press any key to continue . . .";
	<STDIN>;
}
